<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by aditya goel on Medium]]></title>
        <description><![CDATA[Stories by aditya goel on Medium]]></description>
        <link>https://medium.com/@adityagoel123?source=rss-604be50c4ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*k4f5eqvZGa_fhfSY.</url>
            <title>Stories by aditya goel on Medium</title>
            <link>https://medium.com/@adityagoel123?source=rss-604be50c4ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 04:13:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adityagoel123/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deep Dive into Kubernetes || Part 2]]></title>
            <link>https://adityagoel123.medium.com/deep-dive-into-kubernetes-part-2-5969ccf8f81f?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/5969ccf8f81f</guid>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sun, 04 Jan 2026 05:22:13 GMT</pubDate>
            <atom:updated>2026-01-04T05:22:13.216Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are landing here directly, please go throug<a href="https://adityagoel123.medium.com/deep-dive-into-kubernetes-part-1-fa4f611d72b3">h <strong>this </strong>blog first</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ERLVVnVvYHlVTkPy.png" /></figure><p><strong><em>Question :-</em></strong> What is Kubernetes ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hy3bnyZdVqBdZsDX5Q4Gg.png" /></figure><p><strong><em>Question :- </em></strong>How do we check the Kubectl version ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PAerQcXLsLzx74H8QkWB7Q.png" /></figure><p><strong><em>Question :- </em></strong>What is the usual way of deploying to Kubernetes ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-HYR8j31M8becydcdD-hQ.png" /></figure><p><strong><em>Question :- </em></strong>Show the process of creating a Kubernetes Deployment from scratch ?</p><p><strong>Step #1.) </strong>We shall be using this specific repository which is already present in the DockerHub :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Oitzgp5bJcNFYI8geV5rw.png" /></figure><p><strong>Step #2.) </strong>For this specific repository, we are going to use this image :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GnYMlyiyeIlhSlN2fBcsDg.png" /></figure><p><strong>Step #3.) </strong>Using the aforementioned docker-image, we shall be creating a Kubernetes Deployment :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YwPLbk9kwDkIabKBvxEgYw.png" /></figure><p><strong>Step #4.) </strong>Now, we can also expose this deployment as a service, so that we can access the endpoint of this microservice :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6Qzpo-3j2-whgcXDHu24A.png" /></figure><p>Now, if we go to the dashboard, we can see that the service has been exposed by our afore-mentioned command :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-YAFkp1u7ssTWe3lDLSDg.png" /></figure><p>Using the afore-mentioned Endpoint, we can access our micro-service :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*WDyJgqIaOfM0GM33FQ6mjw.png" /></figure><p><strong>Step #5.) </strong>Now, under the hoods, the aforementioned command (as mentioned in step #3) shall be creating :- Deployments → ReplicaSet → Pods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1-dlqpQbaQfguY3Z7ux_g.png" /></figure><h3>Concept of Pod</h3><p><strong><em>Question :- </em></strong>Here is how the relationship between Nodes, Pods and Containers looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4BMKzU9uRxwh-ZAQvWJIA.png" /></figure><p><strong><em>Part #1.) </em></strong>We can also see the detailed information about all of the existing pods :-</p><ul><li>Note that, every Pod have got a unique IP-Address with it.</li><li>Number of specific containers present inside this specific Pod are : 1/1 i.e. Only ONE container is present inside of this Pod.</li></ul><p>On a concept side, One Pod can have multiple containers inside it, but here there is only a single container inside this Pod. Within a sindle Pod, the containers can talk to each other via the localhost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxacuyhZEiNc79BP9oMr2g.png" /></figure><p><strong><em>Part #2.) </em></strong>Here is what a Pod means, in words of Kubernetes itself as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*Ix3PvETuvV0vO8a2zzrTxA.png" /></figure><p><strong><em>Part #3.) </em></strong>We can also see the detailed information about a single pod, by copying the ID of the Pod from the Part #1 above. We can see a lot of details about the Pod through this command :-</p><ul><li>It tells us that, this Pod is running in the default namespace. Namespace is a very important concept, as it provides the isolation to one part of the cluster from another part of the cluster.</li><li>It also shows us the Node, inside which, this Pod is running.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R7UGzPKF7l5QjWAih2Pv-A.png" /></figure><h3>Concept of ReplicaSet</h3><p><strong><em>Question :- </em></strong>Demonstrate the benefit of ReplicaSet here ?</p><p><strong>Step #1.) </strong>Here, we can see that, we have ReplicaSet as shown below.</p><ul><li>There are 3 ways to get the information about the ReplicaSet as shown in the screenshot below.</li><li><strong><em>Purpose of ReplicaSet → </em></strong>It is to make sure that, if some pods go un-healthy OR are not well, then these pods can be brought back asap. The ReplicaSet ensures that, specific number of pods are running always.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMQWpTCOHvJ8e1gcYHvFlQ.png" /></figure><p><strong>Step #2.) </strong>Here, let’s now intentionally kill one of the existing pods. What we shall observe is that → The very next moment, we can see that, ReplicaSet spawns a new Pod with a different name as shown in below screnshot :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzRHhf8QD7gd-wno6TWdIw.png" /></figure><p>Thus, in this way, the application would continue to be available, up &amp; running and available. <strong><em>ReplicaSet always keeps on monitoring the count of Pods. </em></strong>As soon as it finds that, count of current pods is less than the count of desired pods, it immediately kicks the new pod creation process.</p><p>Here, is the meaning of ReplicaSet in the words of the Kubernetes documentation itself :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*q1RNobK6nwiGXgp_NhIZ_w.png" /></figure><p><strong><em>Question :-</em></strong> Now, if load rises on the application, then how can we ensure that our deployment scales effectively ?</p><p><strong>Answer → </strong>We can effectively scale the Kubernetes-Deployment as shown below, which shall add the new pods to the K8S deployment :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JT2akwdAwpazorVgAYqHg.png" /></figure><p><strong><em>==&gt; </em></strong>This work of adding the new pods, is being done by the ReplicaSet. From the above screenshot, we can see that, the 2 pods are launched just very latest.</p><p>==&gt; These pods are also doing the load-distribution now, amongst themselves.</p><p>The same can be verified by opening the link to the App now. Here for the first time, we can see that, the output from the App looks like this :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*jqXKgnRKp7UVnmUZnhgxeg.png" /></figure><p>Here for the second time, we can see that, the output from the App looks like this (Note that, we are intentionally printing the #podId along with the Hello World in output) :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*oxVh7i4ch9fttNAFLd_w1g.png" /></figure><p>Also, we have done the up-scaling of Deployment above but we can also verify from our ReplicaSet as the same has also being scaled-up :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TL4suGoDpeweEYp5omj6lw.png" /></figure><p>In the background, there are a lot of events which would had happenned. We can see them like this :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fYu-s8IA9DNXWIQsZHBGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfWPf7PmfbZeL_MtqfaGPg.png" /></figure><h3><em>Concept of Deployment</em></h3><p><strong><em>Question :- </em></strong>Demonstrate the benefit of Deployment here ?</p><p><strong>Step #1.) </strong>Recall that, we created a Deployment earlier, in the beginning of this blog :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YwPLbk9kwDkIabKBvxEgYw.png" /></figure><p>Now, let’s try to set the image version to some version-number, which doesn’t exists, basically we want to see the behaviour :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzk1wgf-xQHmkt-JkUCotA.png" /></figure><p><strong>Step #2.) </strong>Although it shows that, the image has been successfully updated, but the application doesn’t goes down.</p><ul><li>We can see that, the application is running perfectly fine.</li><li>Even though, we made a mistake while updating the deployment, but still the application has not yet gone down.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*Yb9h8AgasxwmCgLQ9tGIjg.png" /></figure><p><strong>Step #3.) </strong>Let’s see what happens in the background for this situation :-</p><ul><li>Here, we have our original ReplicaSet which is perfectly fine and it has 3 pods desired as well as available.</li><li>We also observe that, there is another ReplicaSet which have got desired-pod-count as ONE, but Ready state Pods are ZERO.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ArKklU35AtXZpOsng8FljQ.png" /></figure><p>We can also verify that, the status of ONE pod shows as “<strong><em>InvalidImageName</em></strong>”, just because this pod can’t be started because, an invalid image has been specified :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*G9NX-PsLrqtindFwWAB7Ew.png" /></figure><p><strong>Step #4.) </strong>Let’s now proceed ahead to set the right image name now. First, let’s verify the right image that we have :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24I6Uxlh_vmRZ3cXvnxK7Q.png" /></figure><p>Now, we go ahead and set this specific version : 0.0.2.RELEASE :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukIyzqPpbnTkn0fvsvRGhA.png" /></figure><p>As soon as we set the right version and execute this command, we would observe that, the pods are changing now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWq65jiXHKQ9caRyKM7X6g.png" /></figure><p>Also, after few moments, we shall observe that, the replicaSet is also changed now to a new replicaSet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kf-376zYgETfwM4WU3bTYA.png" /></figure><p>We can also observe that, the updated version of the application is now up &amp; available with us :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*mnO0u0_vlHfT1PrsUgLOuA.png" /></figure><p><strong>Step #5.) </strong>Let’s now verify the sequence of events that happenned with this change of replicaSet :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILY_boaBqFpe4dsPlOokBg.png" /><figcaption>0</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEyh12pFFTbIH7xE8rV-gQ.png" /></figure><p><strong><em>Strategy adopted by the Deployment →</em></strong> Rolling Updates :- A deployment is very very important to make sure that you are able to update new releases of applications without downtime. :-</p><ul><li>What it does is, “Let’s say I have five instances of V1 and I want to update to V2.”</li><li>The rolling update strategy, it updates one pod at a time. So it launches up a new pod for V2. Once it’s up and running, it reduces the number of pods for V1.</li><li>Next, it increases the number of pods for V2 and so on and so forth until the number of pods for V1 becomes zero. And the all the traffic goes then to V2.</li></ul><h3>Concept of Service</h3><p><strong><em>Question :- </em></strong>What is the need of a Service ?</p><p><strong><em>Step #1.) </em></strong>See that, when we try to access our application, it serves via one of the available pods :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*-zj1os4YdH1vjJH1EhG4sw.png" /></figure><p>Next time, we hit this endpoint, it serves via some another pod maybe :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*rg4c7NANpE7d7FZgpAUxQg.png" /></figure><p><strong><em>Step #2.) </em></strong>We can also observe that, each Pod have its own IP-Address :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFKfRgJ4WuY6cHBayq_6MA.png" /></figure><p><strong><em>Step #3.) </em></strong>Now, if we delete one pod, the replicaset would bring up another pod immediately as shown in the below screenshot : The age of one of the Pod is merely 12 seconds whereas for other pods, it is 32 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Upk_34INZde7LTW_rvWGGg.png" /></figure><p><strong><em>Step #4.) </em></strong>Similarly, if we delete another pod, we can observe that a yet another pod comes-up but with a different IP-Address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UD177AgGgt58D2aD1gobEg.png" /></figure><p>Thus, if we want to avoid the IP-address of our service to change frequently, then we can have it fixed with the help of a Service. That’s the main objective of having a service :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikyBkPd8FUmFN189B3h5hg.png" /></figure><h3>Learnings So Far :-</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*xc1_CSIB0iFZQkOx2fnIrw.png" /></figure><ul><li>When we created a Kubernetes Deployment, K8S automatically creates for us → Deployment, ReplicaSet, Pod.</li><li>When we expose a Kubernetes Deployment, K8S automatically creates for us → Service.</li></ul><p><strong><em>==&gt; </em></strong>Each of these concepts have one important responsibility to offer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*mQxkmORMpFOBWbwiEQg-Sg.png" /></figure><p><strong>1.) </strong>A Container always lives inside the Pod. The container can’t exist independently on its own.</p><p><strong>2.)</strong> A Deployment is very important, in order to ensure the release of new application without any downtime.</p><p>That’s all in this blog. We shall meet you in next blog for this series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5969ccf8f81f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking through Azure Cloud || Part11 || Synapse]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-cloud-part11-synapse-7e03415c3c1f?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e03415c3c1f</guid>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 02:54:05 GMT</pubDate>
            <atom:updated>2026-01-03T06:45:13.415Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gab7C4TdQC5EZ__SK_i8YA.png" /></figure><p><strong><em>Question: </em></strong>Talk about the Azure-Synapse-Analytics ?</p><p><strong><em>Part #1.) </em></strong>The Azure Synapse is an enterprise analytics service that accelerates time to insight across data warehouses and big data systems.</p><ul><li>“<strong><em>Time to Insight</em></strong>” refers to the amount of time it takes to derive meaningful and actionable insights from the data.</li><li>“<strong><em>Big data systems</em></strong>” are the software and hardware solutions that are designed to store, process, and analyze large, complex data sets.</li></ul><p>And with the help of Azure Synapse Analytics, you can accelerate time to insight across data warehouses and big data systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*oHpHkYUuV4rcvkpVM8fUyA.png" /></figure><p><strong><em>Part #2.) </em></strong>The Azure-Synapse brings together the best SQL-Technologies used in enterprise data warehousing, Spark technologies used for the Big Data Data Explorer for log and time series analytics, pipelines for data integration and ETL and processes and deep integration with other Azure services like power-BI, cosmos DB, and Azure Machine Learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*xor1rPAsb1TFp7HEULup9A.png" /></figure><p><strong><em>Part #3.) </em></strong>Let us understand more about the Azure Synapse with the help of Data Engineering pipeline :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*cPy9OF_twtIH2BRo9o6qJA.png" /></figure><p><strong>1.) </strong>In the data engineering pipeline, we have the data sources, for example, data source one, data source two up to data source n. The data sources can be on premises data, cloud data, or the streaming data.</p><p><strong>2.) </strong>These are the three important steps in the data engineering pipeline ETL operations, big data analytics, and storing the data in data warehouses.</p><ul><li>We have to build the ETL operations on that data using the tools like Azure Data Factory.</li><li>After building the ETL operations, we have to do big data analytics. In big data analytics, we have to use the tools like Databricks.</li><li>After that, we have to store the data in data warehouses like SQL DB.</li></ul><p><strong>3.) </strong>The Azure Data Factory is also connected to the ADLs, that is Azure Data Lake storage. After ETL operations, data is also stored in ADLs.</p><p><strong>4.) </strong>At the end, we are taking the data from data warehouses and applying the business intelligence tools like power BI. With the help of these BI tools, we can visualize the data and at the end, we are providing this data to business decision makers.</p><p><strong><em>==&gt;</em></strong> The Azure Synapse Analytics brings all these capabilities at a single place. In Azure Synapse, you can do ETL operations, big data analytics and data warehouses. So, this is a single tool to do all these capabilities as well as you can use the business intelligence tools in Azure Synapse Analytics.</p><p><strong><em>Question: </em></strong>Show the steps to launch the Azure-Synapse-Analytics ?</p><p><strong><em>Step #1: </em></strong>Go-to the Azure-Synapse-Analytics at Azure Portal and hit the “<strong><em>Create New Workspace</em></strong>” button :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QOF34nJPncsCzRu1i7rvpQ.png" /></figure><p><strong><em>Step #2: </em></strong>Once, we specify the name of resource-group, storage-workspaceName, storageAccountName and storageFileSystemName, we would be able to see the Syanspe-Workspace being created :-</p><ul><li>Resource-Group (newly created) → “<strong><em>aditya-synapse-project</em></strong>”.</li><li>Synapse-Workspace (newly created) → “<strong><em>adisynapse</em></strong>”.</li><li>Storage Account (newly create) → “<strong><em>adiprojectstoragesynapse</em></strong>”.</li><li>File System (newly create) → “<strong><em>adifilesystem</em></strong>”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wG7KqZLvDjYb0dTHo9MmMQ.png" /></figure><p><strong><em>Question: </em></strong>Show the project inside the Azure-Synapse-Analytics ?</p><p><strong><em>Step #1: </em></strong>Let’s now go inside our storage-account &amp; container and create the directory inside it with the name as : “<strong><em>Data</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUinpMza1wCKjxXfljsLqQ.png" /></figure><p>We shall now upload the 2 files, with which we shall work throughout this project :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRNeibo190sLMIgygQXESg.png" /></figure><p>Once the files are successfully uploaded inside the storage-account, we can see these 2 files :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMAiDZ1EOjcWfG42XhCP4g.png" /></figure><p><strong><em>Step #2: </em></strong>Since this storage-account is linked to the Synapse-Studio, we can also see these 2 files inside the synapse-studio as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMqPWgVWsOgs-ApIbrSQRA.png" /></figure><p><strong><em>Step #3: </em></strong>Now, we can see the SQL-Pool inside the Synapse-Studio :-</p><ul><li>Formally it is known as SQL Data Warehouse. It is a component of Azure Synapse Analytics used for high performance data warehousing and structured data analytics.</li><li>SQL pool provides massively parallel processing architecture for the query execution. So, this is all about the SQL pool.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*LKOKmAPQ3PEqSduoZzgjqQ.png" /></figure><p>There are two types of SQL-Pools :-</p><ul><li>Serverless SQL Pool.</li><li>Dedicated SQL Pool.</li></ul><p>The SQL-Pool is created when we have created the synapse workspace itself.</p><ul><li>Type → “<strong><em>Built-In</em></strong>”.</li><li>Status → “<strong><em>Online</em></strong>”.</li><li>Size → “<strong><em>Auto</em></strong>”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHYhQeNZSwAUZvcYk0J0Jg.png" /></figure><p>If we can go into the details of this SQL-Pools, we can see it’s details :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxxNthoYy9oRnV4y0fzaWA.png" /></figure><h3>PART #1 :: SQL-POOL</h3><p><strong><em>Example #1 → </em></strong>Let’s now see the URL of the file that we uploaded above :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cxY1oQgiKtlA0xPfpiXHgg.png" /></figure><p>Let’s now perform some analytics now:- Let’s head to the “<strong><em>Develop</em></strong>” pane and write a SQL-Script. This SQL-Script would query to our data-set that we just uploaded above.</p><pre>SELECT<br>*<br>FROM <br>OPENROWSET (<br>    BULK &#39;https://adiprojectstoragesynapse.dfs.core.windows.net/adifilesystem/Data/employee.csv&#39;,<br>    FORMAT = &#39;csv&#39;,<br>    HEADER_ROW = TRUE,<br>    PARSER_VERSION = &#39;2.0&#39;<br>) AS [result]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UOkfQrbUw_beIWoqA0Epzg.png" /></figure><p>That’s how we can write our First SQL-Query to view the data present in the ADLS-Gen2. We can now “<strong><em>Publish-All</em></strong>” all of these changes.</p><p><strong><em>Example #2 → </em></strong>Let’s now perform the GroupBy operation on our data now :- Let’s head to the “<strong><em>Develop</em></strong>” pane and write this new SQL-Script :-</p><pre>SELECT<br>dept, SUM(salary) AS TotalSalary<br>FROM <br>OPENROWSET (<br>    BULK &#39;https://adiprojectstoragesynapse.dfs.core.windows.net/adifilesystem/Data/employee.csv&#39;,<br>    FORMAT = &#39;csv&#39;,<br>    HEADER_ROW = TRUE,<br>    PARSER_VERSION = &#39;2.0&#39;<br>) AS [result]<br>GROUP BY dept</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MzkhAAn14UfgAQfJKncYEA.png" /></figure><p>That’s how have written our Second SQL-Query to perform the aggregation on the data present in the ADLS-Gen2.</p><p>==&gt; We can now “<strong><em>Publish-All</em></strong>” all of these changes. Let’s press on the Publish button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0VBjORJAGo66r8Wij_ajw.png" /></figure><p><strong><em>==&gt; </em></strong>We can also see the Chart of this data from the “<strong><em>Views</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0jFoLac2G46r25KiSke-XQ.png" /></figure><p><strong><em>Example #3 → </em></strong>Let’s now analyse the NYC Taxi Data (in the PARQUET data format) with the serverless SQL Pool :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJqzyvOCRTI1MT4TL85w4A.png" /></figure><p><strong><em>Example #4 → </em></strong>Let’s now see the Top 100 Records of this data-set (NYC Taxi Data (in the PARQUET data format)) in the another way i.e. from Storage-Account itself :-</p><ul><li>Head to “<strong><em>Data</em></strong>” Pane → “Linked” → “ADLS Gen2” → Storage-Account → Container.</li><li>Right click on the File → “Select TOP 100 rows”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3bVpokmP5euKgYBbJkNUA.png" /></figure><p>This would generate the code automatically :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5AkrntZxzDXioW1tCa8t3Q.png" /></figure><h3>PART #2 :: SERVERLESS-SPARK-POOL</h3><p><strong><em>Question → </em></strong>Explain about the serverless spark pool ?</p><p><strong><em>Answer → </em></strong>The serverless spark pool is a way of indicating how a user wants to work with the spark.</p><ul><li>When you start using a pool, a spark session is created if needed.</li><li>The spark pool controls how many spark resources will be used by that session.</li><li>It also controls how long the session will last before it automatically pauses.</li><li>We pay for the spark resources used during that session and not for the pool itself, and this is because it is a serverless spark pool.</li></ul><p>This way, a spark pool lets you use Apache Spark without managing the clusters, and it is similar to how a serverless SQL pool works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*RHoWT2K5Cxgc5Qp6R77PMA.png" /></figure><p><strong><em>Example #1 → </em></strong>Let’s now create the Apache-Spark-Pool :-</p><p><strong><em>Step #1 :- </em></strong>First head to “Manage” section → “Apache Spark Pools” → “New”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cuBKCWoVZ-yJgD1jbE8UGA.png" /></figure><p><strong><em>Step #2 :- </em></strong>Now, here we get a enough room for customisations, as in what type of Spark-Pool cluster that we wanted to create under “Basics” section :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wc0-NJfkpAZV_lpyHsFXiA.png" /></figure><p><strong><em>Step #3 :- </em></strong>Now, proceed to “Additional Settings” section, to select some more types of configurations :- Here note that, after 15 mniutes of Inactivity, the Spark-Pool would pause.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kuX9WfYhWVo1ZRW2osaOoA.png" /></figure><p><strong><em>Step #4 :- </em></strong>Finally, under “Review + create” section, we get to review what exactly we shall be creating :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nyn5XNcWBXDnIOAZv0MJgw.png" /></figure><p><strong><em>Step #5 :- </em></strong>Once we hit the “Create” Button, we shall be able to see that, we have a new Spark-Pool created :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DHbI_c59S37qiYeC7Xhjw.png" /></figure><p>To see the created spark-pool, click on this name and it would show us our newly created spark-pool inside this Synapse-workspace :-</p><ul><li>Here, we can also see the URL of this newly launched SparkPool.</li><li>We can also modify the settings of this Spark-Pool, in case we wish to do so.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkQ-b37r9FsZm36jT86Pkw.png" /></figure><p><strong><em>Example #2 → </em></strong>Let’s now show the example of using the Spark-Pool ?</p><p><strong><em>Step #1 :- </em></strong>First head to the “Develop” section → “Add New Resource” → “NoteBook” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QdSsVp38M8xhzdv5m7pCog.png" /></figure><p><strong><em>Step #2 :-</em></strong> Now, if you click at the Configure-Session button, you would observe that, there doesn’t exist any session yet :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8_U3qlqcs0XmJNWGlp8RQ.png" /></figure><p>Let’s now write a simple print statement, so that the session can be established :-</p><ul><li>We can see here that, we wrote a simple print statement.</li><li>We can see the session has now been created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hBc9E-E6nGl-wFxAihDMrQ.png" /></figure><p><strong><em>Example #2 → </em></strong>Let’s now show the example of Analysing the data (Let’s see top 10 records) with the Spark-Pool ?</p><p><strong><em>Step #1 :- </em></strong>First head to the “Data” pane → “Linked” → “ADLSGen2” → Refer to the file and click on Properties :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSAFUCAX7yvNK50Vej7QbQ.png" /></figure><p>Now, note the ABFSS Path of the Data-File (to which we want to read) from the Properties section:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NbnUEyPYX0By_ApZXlVyA.png" /></figure><p><strong><em>Step#2:- </em></strong>Now head to the “Develop” pane → Write the NoteBook code to load the data from this parquet file into a Spark-DataFrame named “<strong><em>df</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Z_bUg8LATpID-w8J4R8uw.png" /></figure><p><strong><em>Step#3:- </em></strong>Now , we can also see the top 10 rows of the DataFrame :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngWPTm9MMGAt_fIXCI06UQ.png" /></figure><p><strong><em>Example #3 → </em></strong>Let’s now show bring this entire data from this DataFrame to the Database ?</p><p><strong><em>Step #1 :- </em></strong>First head to the “Data” pane and from there we can see that, there doesn’t exists yet any database here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRUdkaJfwLBn-OQURhku3Q.png" /></figure><p><strong><em>Step #2 :- </em></strong>We shall not create the SQL-Database from here directly, rather we shall get the Database created with the help of the Spark-Code :-</p><pre>spark.sql(&quot;CREATE DATABASE IF NOT EXISTS nyctaxi&quot;)<br>df.write.mode(&quot;overwrite&quot;).saveAsTable(&quot;nyctaxi.trip&quot;)</pre><ul><li>Here, we shall create the database with the name of “<strong><em>nyctaxi</em></strong>”.</li><li>Here, we shall create the Table with the name of “<strong><em>nyctaxi.trip</em></strong>”.</li><li>Also, whatever the data we are currently holding in the DataFrame, we shall be writing the same to a Table that we just created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gwu9EFv7Zc97Q7WoLXT43A.png" /></figure><p>And we can now verify from the “<strong><em>Data</em></strong>” from the Database :-</p><pre>newDFFromDB = spark.sql(&quot;SELECT * FROM nyctaxi.trip&quot;)<br>display(newDFFromDB)</pre><ul><li>Here, we have created a new dataframe, but this time, this new dataframe is being loaded from the Table that we just recently created.</li><li>And then, we are displaying this dataframe.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWjtRwP-3B97N_ispRmo-A.png" /></figure><p>Another verification that we can do is :- If we go to the “Data” pane again, we can very well see that, there do exists the database, table and records inside this table :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Fs_yiubnGACHRVnzfw9cw.png" /></figure><p><strong><em>Example #4 → </em></strong>Let’s now perform some simple analysis from this data which is now present in our ?</p><p><strong><em>Step #1 :- </em></strong>First, we shall write Spark-Script to fetch the data in aggregated format from the Spark-Database :-</p><pre>analysisDataFrame = spark.sql(&quot;&quot;&quot;<br>   SELECT PassengerCount,<br>       SUM(TripDistanceMiles) as SumTripDistance,<br>       AVG(TripDistanceMiles) as AvgTripDistance<br>   FROM nyctaxi.trip<br>   WHERE TripDistanceMiles &gt; 0 AND PassengerCount &gt; 0<br>   GROUP BY PassengerCount<br>   ORDER BY PassengerCount<br>&quot;&quot;&quot;) <br><br>display(analysisDataFrame)<br><br>analysisDataFrame.write.saveAsTable(&quot;nyctaxi.passengercountstats&quot;)</pre><ul><li>We are performing the desired aggregation here with PassengerCount and total sum of distance travelled by them.</li><li>We then display this aggregated data in this dataframe.</li><li>We then write this data into a new table, which is also created on the fly here now.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STo8BcFfVnCQO1efwcOlnw.png" /></figure><p><strong><em>Step #2 :- </em></strong>We can also verify that, whether this new table got created OR Not from the “Data” Section :-</p><ul><li>We need to first refresh the database, so as to see the newly created table.</li><li>We now right click on the new table-name and write an auto generated sql-script to see the top 100 records.</li><li>The same data can be seen here in the newly created Table as well.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*djv4GsiqArN-aH0qjPBtVA.png" /></figure><p><strong><em>Step #3 :- </em></strong>We can now bring the data from this table (<strong><em>passengercountstats</em></strong>) into a Spark-DataFrame :-</p><pre>df = spark.sql(&quot;SELECT * FROM nyctaxi.passengercountstats&quot;)<br>display(df)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZmvMzWzCJhy-e-ISEPHsNw.png" /></figure><p><strong><em>Example #5 → </em></strong>Let’s now bring this data into the Storage and perform some validations ?</p><p><strong><em>Step #1 :- </em></strong>Now, whatever data we have loaded into the DataFrame (as shown in above steps), we can write this data into the Storage Account. Let’s first see the “<strong><em>Container</em></strong>”. It contains only one folder right now :: “<strong><em>Data</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3UGBlRj3wR0qGAmV0dvVQ.png" /></figure><p><strong><em>Step #2 :- </em></strong>Let’s execute this script now, which shall save the data in the 2 different formats i.e. CSV &amp; PARQUET :-</p><pre>df.write.mode(&quot;overwrite&quot;).csv(&quot;/NYCTaxi/csv_format&quot;)<br>df.write.mode(&quot;overwrite&quot;).parquet(&quot;/NYCTaxi/parquet_format&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5fqEz270KeKGVYJ2YF69g.png" /></figure><p><strong><em>Step #3 :- </em></strong>As soon as we execute this script, we can see the new directory getting created inside the Container :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mnAxkMcwFCDf9IWhRruRkA.png" /></figure><p>We can now go inside this new folder named : “NYCTaxi”. There is sub-folder named “<strong><em>csv_format</em></strong>” created inside it, as per the instructions we gave in the aforementioned script :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*faRqungt4D6kDdsQHEQ8eA.png" /></figure><p>There is another folder “parquet_format” inside the folder “NYCTaxi” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PZdIeOXgYx-fvSt0bvLnlg.png" /></figure><p><strong><em>Step #4 :- </em></strong>Similarly, we can also create the file with the same name inside the folder. Let’s execute the following script now :-</p><pre>df = spark.sql(&quot;SELECT * FROM nyctaxi.passengercountstats&quot;)<br>df = df.repartition(1)<br>df.write.mode(&quot;overwrite&quot;).csv(&quot;/NYCTaxi_2/csv_format&quot;)<br>df.write.mode(&quot;overwrite&quot;).parquet(&quot;/NYCTaxi_2/parquet_format&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFDDEh6zPsLl9B79Cp8XOA.png" /></figure><p>This shall also create a new folder named “<strong><em>NYCTaxi_2</em></strong>” inside our container :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7T5WNTAbCAgAXlr9HvaYQ.png" /></figure><p>Inside this folder, we can see 2 hierarchies i.e. 2 different folders :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufny55QRjr41LafJW1nHdw.png" /></figure><p>Inside each one of these sub-folders, we can see the files which has now been auto-created. The first sub-folder is “<strong><em>csv_format</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eKc92XW-WCtU_ulLr-iRuA.png" /></figure><p><strong><em>Step #5 :- </em></strong>If we want, we can also see the data from this file as shown above screenshot, by right clicking on this file and “<strong><em>Select TOP 100 rows</em></strong>”. This shall auto-generate the code :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cm3zeImmIYc-eaN2uWLsMQ.png" /></figure><p><strong><em>Step #6 :- </em></strong>There is one another approach through which we can see the contents inside the folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mM03nvRsogv5OFIaYnehlg.png" /></figure><p>As shown in above screenshot, Right click on the file and click on : “Load to DataFrame”. This would generate a small script :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEAL2YBx92jaCTvWvuQfuA.png" /></figure><p>Copy this script &amp; we shall bring this to our Note-Book where we were executing all the queries earlier. We can very well see the data from this Storage-Container now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQqiYIjuDAd8kgFXDk7P3g.png" /></figure><p>Finally, in order to save our work, we can “Publish-All” our changes now as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZyy7bTw_vhdjIBddLPd-g.png" /></figure><p><strong><em>Example #6 → </em></strong>Let’s also show the approach to analyse the data from Storage-Account from PARQUET-format ?</p><p><strong><em>Step #1 :- </em></strong>Now, let’s head back to our Linked Azure Data Lake Storage Gen2 Storage-Account. We can see the folder named : “<strong><em>parquet_format</em></strong>” here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kmnCKOpP6l-voNXTLttaGg.png" /></figure><p><strong><em>Step #2 :- </em></strong>Now, go inside this folder : “<strong><em>parquet_format</em></strong>” and we would see this file. Now, right click on this file and click on “<strong><em>Load to Dataframe</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jCCfj92gwplVmPmIKU7hA.png" /></figure><p><strong><em>Step #3 :-</em></strong> This shall generate a script, as shown below :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aLboLcxW-D8DgWHmjs4AOw.png" /></figure><p><strong><em>Step #4 :-</em></strong> We copy this script and bring it onto our main notebook, where we were writing all the queries. Once we execute this script, we can see the data from this parquet-file as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ax08f9GnIoAOxy4H0OdZAw.png" /></figure><p>That’s all that we have in this blog. We shall meet you in next blog in this series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e03415c3c1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking Through Azure || Part 10]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-part-10-77fed8e9c888?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/77fed8e9c888</guid>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 10:43:16 GMT</pubDate>
            <atom:updated>2025-07-15T10:43:16.075Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are landing first time, this is<a href="https://medium.com/@adityagoel123/walking-through-azure-cloud-part-7-ea9f07433f8b"> the link to go for you</a>. In this blog, we shall learn about how can we deploy a simple web application onto our VM in the Azure Cloud :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xjph_z3NyUQkE8M4.png" /></figure><p><strong><em>Question → </em></strong>Explain about the Virtual-Machine ?</p><p><strong>Step #1.) </strong>This is the first step towards hosting an application &amp; making it available to the users :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*PxAA6AugPVXGfT9TuCmL1Q.png" /></figure><p><strong>Step #2.) </strong>Now, here are the repercussions to this situation :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*lP8UqexPN9HIgAaGfJmdtQ.png" /></figure><p><strong>Step #3.) </strong>Here is the alternative to all this :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*4i6Nl904R1ZX9_jyuPtUzA.png" /></figure><p><strong>Step #4.) </strong>Following are the steps involved in deploying a Virtual-Machine :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*TxwID3cY9Y_21_UVyzkybg.png" /></figure><p><strong><em>Question → </em></strong>Assuming that, we have spinned-up a Windows based VM, how do we connect to the same ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*6uGhaGzWvOFfy1t4Ogkzfw.png" /></figure><p>Let’s talk about the Architecture first :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*HWz9w2s9et8gFvYCeFPogg.png" /></figure><p><strong><em>Question → </em></strong>Setup a Project (based in .Net language) at our local machine and run it ?</p><p><strong>Step #1.) </strong>Open the folder : “<strong><em>tmp2</em></strong>” in Visual-Studio-Code :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hryGfvYLBWXVfidtmcwDw.png" /></figure><p><strong>Step #2.) </strong>Now, go inside the Visual-Studio-Code and click on : “<strong><em>Show and Run Commands</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EETeo1ytsLVh2B4t89v0AA.png" /></figure><p><strong>Step #3.) </strong>Next, we click on “New Project” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBY49Se0tl6j8emGZ-aoxQ.png" /></figure><p><strong>Step #4.) </strong>Next, we select : “ASP.NET Core Web App” from the options :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxLZgK14b5U13-6S33zKaQ.png" /></figure><p><strong>Step #5.) </strong>Let’s give the name of this app as : “learningapp” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pc3pO28r89jjCvPYtbHGgA.png" /></figure><p>With this, the entire project skeleton shall be formed inside the IDE :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8PUzVZ-mKhMqRBhXu_gdQ.png" /></figure><p>We can also see the Solution-Explorer view for this project :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzZ5rde0pf0giLnPNHcQEw.png" /></figure><p>This project can now also be seen in the folder view :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0jSATk2LBqM3Cx_Dl2GX8A.png" /></figure><p><strong>Step #6.) </strong>Let’s now go ahead and run this project by right clicking on the project :: “Debug” → “Start New Instance” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*P8-yCcp4ii4XUsw40C9rwQ.png" /></figure><p>Once we Start the new Instance of this Project, we can see the logs flowing in the terminal as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B-ouLEfOG9qQJOLPWn_9Hg.png" /></figure><p><strong>Step #7.) </strong>Here is now we can see the output, in the form of this WebApp being accessible from the Browser :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmeVcCMvX7h2hJ8jHoY0Lg.png" /></figure><p><strong>Step #8.) </strong>Now, we publish the .NET based application with the help of this command :- “<strong><em>dotnet publish -c Release -o ./bin/Publish</em></strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mw4bWagMDgC5Q0UA-kCT5w.png" /></figure><p>After the above step is succesful, we can see that, build artefacts are created in the below shown folder :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ph2ncodaFKswYI2jPC9Z3w.png" /></figure><p><strong>Question → </strong>Now imagine that, I want to host my ASP.NET based application on the afore-created Windows based Virtual-Machine. Show steps, what all things we need to do there ?</p><p><strong>Step #1.) </strong>We first need to install a IIS Web-Server on our Virtual-Machine :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a-C-RPfmF8z8MZW4y-jYtg.png" /></figure><p>Let’s login (We shall login via the Windows RDP based mode) to this VM now and open the “Server Manager” at this VM :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FzvbO286pdVozfBocsiJaA.png" /></figure><p>Let’s now configure the Web-Server on our VM :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umFYiBnY8VTPE23OetwusQ.png" /></figure><p>Let’s select the Roles now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*W3AQAYpM4kcgZUD96san3A.png" /></figure><p>Let’s select the Server-Roles now :: Click on check-box for : “Web Server (IIS)” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*HE-cryL3Vb4GygA2WM1ahw.png" /></figure><p>Here is we can see the Installation-Progress of Web-Server :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gxG_RKdRW25KkqNJJMBBYA.png" /></figure><p>Once done, we can see the status here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbQP3ItSslEUgqbgiegSQg.png" /></figure><p><strong>Step #2.) </strong>We also need to enable the Inbound Port for this VM. So, we go to this VM on dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tcyzveL1u7fWmZWrMPw9Q.png" /></figure><p>Here, we go to the Network-Settings :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4VWmsrzYJ5Faqrs92i3wg.png" /></figure><p>Once we scroll to the bottom, we can add this Inbound-Rule :- Here, we are adding a rule which allows Incoming traffic from any source at Port 80 :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIN70_IABiSaA29_usiA1A.png" /></figure><p><strong>Step #3.) </strong>Once both of the above steps are done, we can check that, the default view of web-server is visible :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4izqlRkYKmRHvQnsRZJFJg.png" /></figure><p><strong>Step #4.) </strong>Let’s now modify the Settings of our IIS Web-Server within our VM : “<strong><em>IE Enhanced Security Configuration</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPQF6UIXXDzGz44vEG-7uw.png" /></figure><p>Now, for this specific setting, turn it off :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SffM90_ExNMdJ2S0K9rrOw.png" /></figure><p><strong>Step #5.) </strong>Next, in order for us to be able to run our .NET based application, we need to install the ASP.NET runtime (Hosting Bundle) as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkL5linSb0CktWs0R_G1ZQ.png" /></figure><p>Inside our VM, let’s first download the .NET Core Hosting Bundle :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rw-pVp_xNDeXExQF8LCwQg.png" /></figure><p>Inside our VM, let’s download the Runtime :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrK6dFrigIHYJnSOIH_xHQ.png" /></figure><p>After the Hosting Bundle is installed, let’s go ahead and create a new folder inside our VM, from which we shall be hosting our App :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ub30EOI-YhaDcoRA0yYPew.png" /></figure><p><strong>Step #6.) </strong>Let’s now create the Website inside this Web-Server :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fcs_Rb-t2eKiKeLNibf1xg.png" /></figure><p>Now, click on “Basic Settings” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NutZstBjvGWDacXSCdEriw.png" /></figure><p>Here, now click on “Edit” Settings for this site :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8c-FknhjSoLjfEf_R1Cug.png" /></figure><p>We now change the port from 80 to 8080 :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxYBYpLiOi9corEGQ7ZGBg.png" /></figure><p>After we have changed the port, here are the settings :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPyHCQmdzReZeowp7JiMsQ.png" /></figure><p>Now, we create the another Site like as shown in the screenshot below :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*eoXa95r71TLEpx_6QMy2xg.png" /></figure><p>Here, we select the physical path as the same one which we created above in Step #5 :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Da6MG41TG6C41aZhaAmQwQ.png" /></figure><p>Finally, we have the “<strong><em>LearningApp</em></strong>” website created now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRZrdOuw0hchQMbCqEmqIg.png" /></figure><p><strong>Step #7.) </strong>Now, let’s connect to our VM, but before that, we modify the settings little bit, in such a manner that, the local-disk C: from our local computer is being shared on the VM :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bThgKXDve3xKcm6Ijsa2Zw.png" /></figure><p>Now, login inside the VM and we can see that, the C-drive from my local computer is now visible inside the Virtual-Machine :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUI1FgZd56_89INoCSI7cQ.png" /></figure><p>Let’s now copy the publish folder (of our App) that we created in above step from this C-Drive to the Virtual-Machine :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RxE-zkY-bYEKVKZF-bxqvA.png" /></figure><p>Let’s start the copy operation :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SaO5XPofKIDQUqKngYBlQ.png" /></figure><p>Here is now, we can see the folder being successfully copied on the Virtual-Machine :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSveBeCL9joZ8bQgaaOKfw.png" /></figure><p>Once the publish folder is done copying, we can see see that, the same application is now being reflected on the web-browser :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiy_IY3yFtv0AyUhMnwZvg.png" /></figure><p>That’s all in this blog. We shall meet you in next blog. if you liked it, please do clap on this page.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77fed8e9c888" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking Through Azure || Part 9]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-part-9-215591f7e4cf?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/215591f7e4cf</guid>
            <category><![CDATA[azure-storage]]></category>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 07:06:31 GMT</pubDate>
            <atom:updated>2025-06-15T07:06:31.110Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are landing first time, this is<a href="https://medium.com/@adityagoel123/walking-through-azure-cloud-part-7-ea9f07433f8b"> the link to go for you</a>. In this blog, we shall learn about accessing Microsoft Storage Queue Resource :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*rypayUElhADncKiA.png" /></figure><p>Let’s talk about the Architecture, that we are going to discuss in this blog :-</p><ul><li>Users wants to upload the Videos to the Application.</li><li>Application saves those videos into the DataStore.</li><li>Module processes these videos from the DataStore.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*rK1cvBk8UvlSKlbznjIQ3Q.png" /></figure><p><strong>Question → </strong>What are the problems associated with the afore-mentioned design &amp; what’s the solution ?</p><p><strong>Answer → </strong>If the Processing module crashes, then there is no way of keeping track of what all videos got processed and what all videos were not processed ? Therefore, <strong><em>the solution for this problem</em></strong> is to have an Storage-Queue in between of the following two components :-</p><ul><li>Video-Store.</li><li>Video-Processing-Module → This module is the one, which actually process the video.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4szbs8ADLkllHxMz3CLa9Q.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue ?</p><p><strong>Step #1.) </strong>We first open the Azure-Storage-Account :- In the left hand side pane, we can see the various options for Data-Storage within the Storage-Account :-</p><ul><li>Containers.</li><li>File Shares.</li><li>Queues.</li><li>Tables.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9UQkQbXp4T2zHTBM2uUIA.png" /></figure><p><strong>Step #2.) </strong>We now go to the Queues option here and create a new queue with name as “<strong><em>appqueue</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LSOkEvEqglvW7r8LEiGGlA.png" /></figure><p><strong>Step #3.) </strong>We now go inside this Queues option and perform :-</p><ul><li>Add a new Message to this Queue.</li><li>The Message sent to the Queue would expire in 7 days.</li><li>The message sent is encoded in Base64 format.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_qaNNJ95XZgyfBli0fW7w.png" /></figure><p><strong>Step #4.) </strong>We can now see that, the message is now successfully arrived into the Queue. We can also see the properties of the message which have been saved to the Queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTw79N66HFJ1NLYBqFOmEQ.png" /></figure><p><strong>Step #5.) </strong>Similarly, let’s push another message to the same Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WL42US0EdMop8SsWBrH1eA.png" /></figure><p><strong>Step #6.) </strong>Now, we can consume/dequeue the message from this Queue :- As soon as the message is being de-queued from the Queue, that message is gone forever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKnSZoHQDbhxd2bPRjIovg.png" /></figure><p>After the dequeue operation is successful, we can see that, only one message is being left in the queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*efWH_N61azk6vTkcbKztCg.png" /></figure><p><strong>Step #6.) </strong>Now, we can also clear the queue and this option shall finish all the messages from queue :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73xk0iHtzmZBDA8uyU44sg.png" /></figure><p>After we perform this operation, we can see that the queue is empty now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYj21woNn0q0tJv-tOq-xw.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code for pushing the messages to the Queue ?</p><p><strong>Step #1.) </strong>We first go to our Visual-Studio-Code and Add New Project :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2Bw9Wivuspe_HiRRUs-mQ.png" /></figure><p><strong>Step #2.) </strong>We now create a Console-App :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_O_UVJPJvyKw5OIYJV2xEQ.png" /></figure><p><strong>Step #3.) </strong>We now create the name of project as “<strong><em>storagequeue</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2U6vf-LncpW6GiFbFCuRQ.png" /></figure><p><strong>Step #4.) </strong>We now add the package to our environment by this command :-</p><p>dotnet add package Azure.Storage.Queues</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PpWzLFo9tmod189yTTG06A.png" /></figure><p><strong>Step #4.) </strong>We now go to Azure Portal and take the ConnectionString for our Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UmoUenELrJuVys3UFGuWYQ.png" /></figure><p><strong>Step #5.) </strong>We now can refer to the Azure documentation for pushing the messages to the Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VMJv2efYHuNf4bRj8tvkVQ.png" /></figure><p>Now, we write the code in C-Sharp language, which would connect to this Storage-Queue and push the messages to it :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHgtFk-V7cK_He-Qwx-HKw.png" /></figure><p><strong>Step #6.) </strong>We now execute this code-piece &amp; can see the messages being pushed to Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcLEt8dRMQTimLD7cMT-Ag.png" /></figure><p><strong>Step #7.) </strong>We now can verify from the Azure Portal that, our logs are getting pushed to the Azure Storage Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EQIwdUFFcikLxMtI4l7KA.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for peeking (i.e. Just Reading) into the messages ?</p><p><strong>Step #1.) </strong>We first write the code for Peeking the message from line no. 19 to 28 as shown below :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HPfISJBEvGgJpU2mGcUNRw.png" /></figure><p><strong>Step #2.) </strong>Now, we execute our code and we can see that messages are being read from queue. Please note here that, these messages shall not be deleted from the Storage-Queue i.e. they would still be present into the Queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zyrrVOT1pMZ2jJYJ57cKbQ.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for Reading &amp; Deleting the messages ?</p><p><strong>Step #1.) </strong>We first write the code for ReceiveMessage from the Queue. Here note that, we have not deleted the message after reading the same :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Movcoz2bQpUXpOm2gnJYSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bppow9X-6dESEwX5ifP_9Q.png" /></figure><p><strong>Step #2.) </strong>We now execute this code and can see that, the messages are being read from the queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*uWrMx1WIkxzYdgIO3SzLtA.png" /></figure><p><strong>Step #3.) </strong>Initially, there were around 5 messages in our Storage-Queue. We read the three messages, so we are now left with 2 messages in the queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ds6WEjBE8lvsOx27I5QTw.png" /></figure><p>But note that, since we didn’t explicitly deleted the messages from the Queue, they shall re-appear into the queue after 30 seconds of Invisibility Timeout :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNw9qwuuuzyfKhVWJgEWsQ.png" /></figure><p>This is because :-</p><ul><li>The code that we wrote above would only make the message Invisible for 30 seconds (default) so that no other consumer/instance should be able to read this message during this 30 second period.</li><li>As a good practice, the consumer have to manually delete the message from the queue, after the message is being processed succesfully.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Glmdwbi1o1fGTIJlGOYijw.png" /></figure><p><strong>Step #4.) </strong>Now, we explicitly delete the message, after the processing is done successfully :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YrecX44u6sSRfwUX_zxwg.png" /></figure><p>Now, we re-run this code again :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*dmS0FBtJEkO2zVtRyCtSFQ.png" /></figure><p>And we can see that, the messages which has been consumed shall not re-appear into the queue now. So, Message 2, 3, 4 are consumed successfully and Message 0, 1 are now remaining in the queue now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RRXE_XOqoEh-RUSRuiv0g.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for knowing the length of the Queue ?</p><p><strong>Step #1.) </strong>We first write the code for checking the length of the queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*eocZHuLZPKyRPP6S6BhIIw.png" /></figure><p><strong>Step #2.)</strong> If we execute this code now, we can see the output :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*1deGvBBXac6bhFxxuLG6Jg.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for pushing the object into the Queue ?</p><p><strong>Step #1.) </strong>We first write the blueprint for Object (“<strong><em>Order</em></strong>”) that we wanted to push to the Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*i2eKgyAOzSYjD5x0EE7E0w.png" /></figure><p><strong>Step #2.) </strong>We now write the code to initialise the instances of this class and push to the queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOLMPtGKpeSanIiRHCxVWA.png" /></figure><p><strong>Step #3.) </strong>Now, if we execute this code, we can see, it is successfully pushing the messages into the Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*w-NLTFRFY9DoTRaFTciLvA.png" /></figure><p><strong>Step #4.) </strong>We can also verify that, the messages are now visible into the Azure Dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxjlHTLwDfC_i8q8Hu6GHQ.png" /></figure><p>Here, we can see a sample message by clicking upon it :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9gXt7xYllvDPM9faCQwCg.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for receiving the object from the Queue, using Azure Functions ?</p><p><strong>Step #1.) </strong>We first create an Azure Function inside our Workspace :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDzRigmJHdncx9guBsmVow.png" /></figure><p>Next, We now create a new Project :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NSZdKphGLum3JQx0-K3w7w.png" /></figure><p>Now, we select our Runtime as .NET :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugiASUY7MOBPqDxnllXTdQ.png" /></figure><p>Here, we now select the : “<strong><em>Azure Queue Storage Trigger</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8n3RpZzYob5bwOOEgzUbA.png" /></figure><p>For this very purpose, we shall need a Storage Account and we shall be using the Azurite Emulator for Local Storage :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8lfO7LAoBtfw358WDG7zSg.png" /></figure><p>Next, we specify the Queue Name :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfVDn8_NSlwaljBjuuYrsQ.png" /></figure><p><strong>Step #2.) </strong>We now write the code for consuming from the Queue i.e. QueueTrigger. Note here that, we have consumed the message in the format of :<strong><em> QueueMessage </em></strong>:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LO6KCeTmadXW889ihSO4eQ.png" /></figure><p><strong>Step #3.) </strong>We now check the ConnectionString for our StorageAccount which we shall be configuring in our codebase for QueueTrigger :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tdiaFEmPbeN1x0xaU8nMNw.png" /></figure><p>In below code-snippet, we configure the connection-url that we got from above dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*dB7LYoAGUgU1og2f66GYPQ.png" /></figure><p><strong>Step #4.) </strong>Now, let’s go ahead and consume from the Queue. Here we can see the logs which indicates something fishy. Our consumption have failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmeZNl5VVNjQApeWP2HKcA.png" /></figure><p>We can see that, there are no messages remaining in our queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGutbal2vDw_X1rM5Ziqhg.png" /></figure><p>Also, these messages have automatically landed to an another queue which is also known as Poison-Queue. This Poison-Queue is something which got automatically created, because the messages could not be processed here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5QVxqL8bmzMfXv7v89cvg.png" /></figure><p>In order to debug this, let’s add logging to our code with mode as Trace :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*Tmj2enYACORUlgv1mEupfA.png" /></figure><p>Now, if we try to consume the message again, we can see the error clearly that : <strong><em>The message decoding has failed</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pchyVqCZiKPz1lu6l2joEg.png" /></figure><p><strong>Step #5.) </strong>Now, let’s go ahead and fix this issue at the time when the messages are being sent to the Queue. So, we perform the encoding of the message to Base64 format :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J21NtJPYu3t6KS7FwJcFcQ.png" /></figure><p>Let’s run this code, so as to see whether messages are being sent to the queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*RrM6YDvruKl5eoDbyNdmGA.png" /></figure><p>We can also verify the messages being received at the Azure dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JXTX-xztjxv7YyYbT5dcAA.png" /></figure><p>If we now re-run the QueueTrigger, we can see the messages consumed clearly :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-U6KjItZ0QzoHsHYkGgnA.png" /></figure><p>Also, we can see that, there are no messages remaining in our queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGutbal2vDw_X1rM5Ziqhg.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for receiving the object from the Queue, using Azure Functions , in the same format/Type as that of Object rather than Generic message format ?</p><p><strong>Answer → </strong>Note that, we have already re-pushed the messages to this queue, before proceeding to consume from these messages :-</p><p><strong>Step #1.) </strong>We first modify the code of our Azure Function, so as to receive the Object as it is, while consuming from the Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UAEtkNdatNnIH8pEc_Mkw.png" /></figure><p><strong>Step #2.) </strong>We now consume the message from this Queue and can see that, the messages started to be consumed :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dud1O45nCeRIp2gfM08A5Q.png" /></figure><p><strong>Question → </strong>Show the demo of using the Storage-Queue through the C-Sharp Code, for receiving the object from the Queue, using Azure Functions and writing the same into the Storage — Table ?</p><p><strong>Step #1.) </strong>We first create a Table with name as : “<strong><em>Order</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9H1cO-LYlX_4CDHk0jPDA.png" /></figure><p>Once the Table is created, we can see this on the dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTeyXVSNurQ9Wc44S7mC2w.png" /></figure><p>We can see that, as of now, there are no records in this Table :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z3uDHTts8wAopOPDSLDUCA.png" /></figure><p><strong>Step #2.) </strong>We now write the code of this Class, whose object shall be saved to the Table :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yinH8CaXFDtuNGvvNvDsPA.png" /></figure><p>Now, we write the code for consuming the messages from the Queue :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSYpfaCE8jyINCgu2TGkSQ.png" /></figure><p><strong>Step #3.) </strong>We can see that, on line no. 20 above, we can see that, there is an error. Here, we install the Azure Extension for Tables using this command :-</p><p>dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Tables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IWP66QN1GMmFNyc4SBCFfg.png" /></figure><p>As we install the aforesaid extension, we can see that, this error is gone from the codebase :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtXaNCpldk6HsZiEkxjxRw.png" /></figure><p><strong>Step #4.) </strong>Finally, we can see that, while we execute the code of our Consumer again, we can see that the messages are being consumed successfully from the Queue and are being saved to the Table effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41uXMeri5AmkIm5oHZORtA.png" /></figure><p>We can also verify from the Azure Dashboard that, these records are now visible at the Azure Portal Dashboard as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrmWqYDM3I2U6Olm9YrDsg.png" /></figure><p>That’s all in this Blog. We shall see you in next blog. If you gained something from this blog, I encourage you to clap on this page.</p><p><strong>References :- </strong><a href="https://learn.microsoft.com/en-us/azure/storage/queues/storage-quickstart-queues-dotnet?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-visual-studio-code">https://learn.microsoft.com/en-us/azure/storage/queues/storage-quickstart-queues-dotnet?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-visual-studio-code</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=215591f7e4cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking through Azure Cloud || Part-7]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-cloud-part-7-c7ad80bd0b0d?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7ad80bd0b0d</guid>
            <category><![CDATA[adf]]></category>
            <category><![CDATA[azure-data-factory]]></category>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sun, 25 May 2025 12:36:10 GMT</pubDate>
            <atom:updated>2025-06-14T06:22:41.688Z</atom:updated>
            <content:encoded><![CDATA[<h3>Walking through Azure Cloud || Part-8</h3><p>If you are landing first time, this is<a href="https://medium.com/@adityagoel123/walking-through-azure-cloud-part-7-ea9f07433f8b"> the link to go for you</a>. In this blog, we shall learn about Data-Engineering from Microsoft-Azure :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQGVFj8S_pQePiD_VRwEfg.png" /></figure><p><strong><em>Background → </em></strong>The resources shown in the above slide are the most commonly used resources by any data engineers to build any kind of data engineering projects.</p><p><strong>Step #1.) </strong>So, the data source that we are going to use in this particular use case is : On-Premises-SQL-Server-Database. Imagine that, inside the database we are having like 6 or 7 tables. And here, we are going to migrate this database completely to cloud.</p><ul><li>So, as part of this the first step, would be using a tool called Azure Data Factory.</li><li>The Azure Data Factory is a ETL tool, which is mainly used for data ingestion.</li><li>What we are going to do is :: The data factory will be used to connect to On-Premises SQL server database, in order to copy all the tables from the database and move all the tables to the cloud.</li></ul><p><strong>Step #2.) </strong>For Data Storage in the cloud, we are going to make use of Azure Data Lake Gen2.</p><ul><li>ADLS2 is the storage solution in Azure.</li><li>The data which is stored in Azure Data Lake is pretty cheap.</li></ul><p><strong>Step #3.) </strong>Once the data has been added into the ADLS2, we’ll be using a tool called Azure Databricks to transform all the raw data into the most curated data.</p><ul><li>Azure Databricks is a big data analytics tool which is mainly used for high end data analytics workloads.</li><li>In simpler words, we can say that using Azure Databricks we can actually write the code either in SQL or PySpark or Python.</li></ul><p><strong>Step #4.) </strong>There is a concept called Lake House architecture. Usually, In this architecture, the Azure Data Lake will be divided into multiple layers. We have different layers such as bronze layer, silver layer and gold layer.</p><p><strong><em>1.) Bronze layer → </em></strong>ADF connects to the on premise server database, copies the data and put the data into the Azure Data lake.</p><ul><li>So inside Azure Data Lake, the Azure Data Factory puts the data first into the bronze layer, which means that the bronze layer has an exact copy of what the data looks like in this data source.</li><li>Usually, we are not going to touch any data inside the bronze layer, and we are not going to change the format or anything inside the bronze layer. So, this is going to be the source of truth.</li><li>One of the main advantages of this is, for example, in the subsequent data transformations that we are going to do if something goes wrong, you can come back to this bronze layer and get all the data to be retrieved, which is going to be the same as the data source.</li></ul><p><strong><em>2.) Silver Layer →</em></strong> So once the data has been copied to this bronze layer by Azure Data Factory, we then use Azure Data Bricks to connect to this bronze layer, do some data transformation and load the transformed data into the silver layer.</p><ul><li>These silver layer and gold layer is kind of a different levels of transformation.</li><li>For example the first level of transformation is silver layer And the next layer of transformation is the gold layer.</li><li>So in bronze to silver layer the transformation might be kind of simple, like changing the column names or changing the data types, because a lot of times the on premise kind of data types and the cloud data types is not really compatible.</li><li>So we may need to change few things based on how it is going to support it into the cloud. So those kind of minimal transformation can be done in this silver layer.</li></ul><p><strong><em>3.) Gold Layer → </em></strong>And once the data has been transformed using Azure Data Bricks and the final data has been loaded into the silver layer, we then do another set of transformation using same Azure Databricks.</p><ul><li>And this data is going to be loaded finally to this gold layer.</li><li>So this gold layer is the final cleanest form of data. So we all need to have a clean data right.</li><li>So one of the main task of data engineers is to clean the raw data into the most curated data which means that all this data transformation is done by the data engineers using Azure Databricks in different zones.</li></ul><p>So that’s called Lake House Architecture.</p><p><strong>Step #5.) </strong>So once the data has been loaded to the gold layer, now we are using another tool called Azure Synapse Analytics.</p><ul><li>Azure Synapse analytics is kind of similar to what is on premise SQL server database.</li><li>We can also create the same kind of database, similar to how we can create using the on premise SQL database.</li><li>We can also create all these database and tables using Azure Synapse Analytics and once these database and tables have been set up in Azure Synapse Analytics, all the data that is present in the gold layer will be loaded to all the tables that we have created in Azure Synapse Analytics.</li><li>So now at the end of this step, the Azure Synapse Analytics will have a kind of a similar data warehousing model of how it looks like in On-Premise-SQL-database.</li></ul><p>Step #6.) Next, we are going to do further analysis on the data that has been stored inside the Azure Synapse Analytics using a tool called power BI.</p><ul><li>PowerBI will get all the data that has been loaded into the Azure Synapse Analytics and we could create a different kind of reports like the charts, bar charts or whatever the reports that we want in power BI.</li><li>Usually, either the Data-Analyst OR Data-Engineers (and sometimes Devs) are the one who will be creating reports in power BI.</li></ul><p><strong><em>Question → </em></strong>Showcase the process of copying a particular table from On-Premise Database Table to Azure ?</p><p><strong>Solution → </strong>Here, we have first created the following resources :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*HfgpUF_Q_F4QKLwwkFmu3g.png" /></figure><p>Here is our local database on our own server :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*gztQivUBJQbKq5bW_KsxDQ.png" /></figure><p>We now create a User, using which we shall be logging-in to our database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*76uaMb_foBX9dDxHSrFJAg.png" /></figure><p>On the user “<strong><em>mrk</em></strong>”, we give the permission of “db_datareader”, so that our user have necessary permissions :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-zQYUGlyYuT5XiW0fKNtw.png" /></figure><p>Here, we create the “<strong><em>username” </em></strong>as a Secret in the KeyVault :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*HtFzx0RZcHSe5Us8opDDmQ.png" /></figure><p>Next, we also create “password<strong><em>” </em></strong>as an another secret in the KeyVault :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JtysuOPwnrBt4AwI5k0DHQ.png" /></figure><p>Finally, we are having 2 secrets in the KeyVault :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtM6rouDvqGXPiXZ-JQjVA.png" /></figure><p>Now, we go to “<strong><em>Azure Data Factory</em></strong>” and we shall be setting-up the Data-Copy operation from our On-Premise-Database-Table to the Azure ADLS. So, let’s go ahead &amp; click on the “Launch Studio” here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJ1fFJtzl-aQkME-q7lleQ.png" /></figure><p>Now, there is a concept of “Integration-Runtimes” :-</p><ul><li>AutoResolveIntegrationRuntime → Used for the scenarios where we want to connect to the Azure resources itself.</li><li>SelfHostedIntegrationRuntime → Used for the scenarios where we want to connect to customer’s On-Premise resources.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8NlgczHG6hQeHoD1KSkWw.png" /></figure><p>Now, we go ahead and create a new SHIR (Self Hosted Integration Runtime) → We now choose Azure, Self-Hosted :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lc3rzAlHexEeIBpi9hj2og.png" /></figure><p>Next, we choose here Self-Hosted as the option :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31RTQl9IODt4xhrJs-KgVQ.png" /></figure><p>We now specify the properties of IR Setup like Name, Description and Hit the Create Button →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxqrQgwJwfAfzwZFGrzdhQ.png" /></figure><p>For the setup, we have 2 options :-</p><ul><li>Express Setup → This is used when we want to setup for our own computer.</li><li>Manual setup → This is used when we want to setup at multiple other computers in a company.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhkn5oVqJ6_9okN6PzvH-w.png" /></figure><p>Let’s go ahead with Express Setup for now. Once the express setup is done, we can open the “<strong><em>IR</em></strong>” from our computer and this would look something like this :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4wN3aoqHWoNtfETtCRm6w.png" /></figure><p>Next, we can see here that, SHIR is now up &amp; running :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQDamTKEVYUiGbsudV_MGQ.png" /></figure><h3>Part A. Copying a single Table from On-Premise Database to Azure Cloud</h3><p>Next, we come in the “Author” Section, where we can lay down a Pipeline. Note that, a Pipeline would have multiple Activities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDPk8QHISRAxmQ9nRANFPg.png" /></figure><p>We specify the name of this pipeline as : “<strong>copy_pipeline</strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HDXtGSKXvTdL77khozu2xg.png" /></figure><p>Inside this pipeline, we can create the Activities. One such activity that we would demonstrate is to copy one of the Table from On-Premise to Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*or8MknW9jvwrSX2OUnpvJw.png" /></figure><h4><strong>Part-1 : Source</strong></h4><p>Let’s now go to the Source and configure a new DataSet. We shall choose “SQL-Server” because we want to connect to the On-Premise-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0g30cVspKIJkb5M1Vp4b4Q.png" /></figure><p>Here, we specify the name of the property and then have to attach a Linked-Service :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*idF4p3XGI3SPdaM4xs8GDg.png" /></figure><p>We shall create a new Linked-Service :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dqgjljmC9nSYtePGeTEvtA.png" /></figure><p>The properties specified above have been copied from the On-Premise SQL Server itself. For example, we can go to our On-Premise Database Engine :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*j72B2lCWHDSEzbZlB2YfLg.png" /></figure><p>We now copy the Server-name as “<strong><em>localhost</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5znor_xF3vFsRhETIcpvtQ.png" /></figure><p>We copied the Database Name from our On-Premise :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPy0dbkQAwNuIQ2PEz8_og.png" /></figure><p>Now, we choose the AuthenticationType as “SQL-Authentication”. Here the userName is being entered as manually :--</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2yk2XlS0QG4ZJfs1iW1BQ.png" /></figure><p>For password, we would use it from KeyVault’s secret. Let’s first create Azure-KeyVault-Linked Service :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qaonTm7mamv4WVgponG2bw.png" /></figure><p>After we create the Linked-Service, the Secrets would not load yet :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osiA5MiQhKe_uYSY5vfd8g.png" /></figure><p>For this to work, we need to allocate the permission in the keyVault :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*Gy3w9v6ZfUfm4AjGjUMvdg.png" /></figure><p>Next, we select our Principal (Azure Data Factory in this case) to which the permissions have to be allocated :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ivf4Bxky1zcwrC09zIFyeQ.png" /></figure><p>After the permissions are allocated, we can see that, the secrets would be loading easily without any concerns :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4NB33MFNE9tW46FM7xqfQ.png" /></figure><p>Now, we choose the Secret Name :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HZ6Dudihd1vXx3SQU2pPPw.png" /></figure><p>Once the Linked-Service for the SQL-Server (On-Premise Database Server) is created, we shall be able to see the Tables (These are the tables which are visible in the On-Premise Database) loading :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*otEH6_JjZp_-ogH6H_TUog.png" /></figure><p>Next, let’s choose the Table-Name (“<strong><em>SalesLT.Address</em></strong>”) to which we wanted to copy from On-Premise-Database to the Azure :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYA7W3RGQhtxJQAgFFNo1A.png" /></figure><p>Here, we can also see the preview of the data from the “<strong><em>Preview data</em></strong>” option :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffbXNZ8FoWiRTYDgIGyG1A.png" /></figure><p>Here is how the data look like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KyJNERBXeg3xd9VufZuYYA.png" /></figure><h4>Part-2 : Sink</h4><p>Now, we go and configure the Sink DataSource where finally the data shall be saved :- We shall choose ADLSGen2 from here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCHVbgSUXAJq0LQdYflSEg.png" /></figure><p>We choose the format of the data as Parquet :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ucw-YFAsKI3659i7iT22Ug.png" /></figure><p>Next, we provide the properties of this configuration. Here, we first create the Linked-Service :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bOA0gAjWykdaYLM6t0aCig.png" /></figure><p>We specify the properties of the Linked-Service here like Name, IR type, Authentication Type, etc..</p><ul><li>Note here that, we are choosing the AutoResolveIntegrationRuntime because the sink datasource is present in none other than Azure itself.</li><li>AuthenticationType being chosen here is AccountKey.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Avn3cqyV4vPYdYkGMqPbA.png" /></figure><p>We choose the Storage Account Name into which the data has to be copied :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lAiEBYlo9eY3aYxAlLFViw.png" /></figure><p>Here, we also choose the Folder into which data has to be dropped :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nolJR3UxEqYf2F70L2KcHg.png" /></figure><p>Here, once we select this path, we can see the properties section :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hFzHOVMTs7pqv3JmUvnlGw.png" /></figure><h4>Part3 : Testing the Pipeline</h4><p>Now, we can debug our Pipeline that we have just laid down by “Debug” button :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YzcMubmNDk-XxYVxlShnvg.png" /></figure><p>Once we started the debug Pipeline option, we can see that, we get here the Output as follows :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMnhy9ewmm8RyG3RE9Bsaw.png" /></figure><p>After sometime the process would be finished :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbkTNCy7Q4X6Bb5QT6V0rA.png" /></figure><p>And we can now verify from the Storage-Account as well, whether the data has been copied OR not :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*duQt6mMcCQ3egN21r-IO8Q.png" /></figure><p>Finally, we click on the Publish-All button to publish these changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uy8L-dzw0uTtwRuLzwX32w.png" /></figure><h3>Part B. Copying the entire DataBase from On-Premise Database to Azure Cloud</h3><p>First &amp; foremost, we come in the “Author” Section, where we can lay down a Pipeline. Note that, a Pipeline would have multiple Activities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDPk8QHISRAxmQ9nRANFPg.png" /></figure><p>We specify the name of this pipeline as : “<strong>copy_all_tables</strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BPllgjESceCzzaTLQ_-GQ.png" /></figure><p>Before, we create the activities here under this pipeline :-</p><ul><li>Let’s have a look at all the tables (present in the <strong>SalesLT </strong>schema), to which we want to copy from On-Premise to Azure-Cloud.</li><li>We have overall 10 Tables, which has to be copied.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETKooHzP_DMghHbuBXcvag.png" /></figure><p>Now, we head back to ADF and create our first activity “Lookup”.</p><ul><li>This activity shall lookup for all the tables in our On-Premise Database.</li><li>We have specified the name of this activity as : “<strong><em>Look for all tables</em></strong>”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrF1tzDbYOT23gJse6LrDQ.png" /></figure><p>Let’s configure a fresh/new Source-DataSet here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gayC3j_OQFxoKPAW8Q2Kfw.png" /></figure><p>We choose SQL-Server as new data-source :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1aZOGgj7LXuoFl-TRwBgA.png" /></figure><p>We name this new SQL-Server as “<strong><em>SqlDBTables</em></strong>” and utilise our existing LinkedService named “<strong><em>onpremsqlserver</em></strong>” (This was created in Part-A above) :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxGY6lXcGxD5XmseoJd7vg.png" /></figure><p>As a part of this LinkedService :-</p><ul><li>We can see that, the we are using SHIR, which shall be installed on the On-Premises Machine where our SQL-Server is present.</li><li>Also, we would not select any specific table here in the “Lookup” step, because we wanted to perform the look-up for all the tables.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4T6zLuY2rKOKJtIuyUKUtw.png" /></figure><p>After we configure this Activity, here is how it looks at Azure-Dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-O3mBGkCwBSO5knzJNIpFA.png" /></figure><p>Because, we wanted to look-up for all the tables present in the SalesLT schema, therefore we would write the query here in the “Lookup” activity, in order to fetch all the tables :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LONRWSinlW1Xpg3CMYB7qw.png" /></figure><p>We can also check the tables fetched by clicking upon the “<strong><em>Preview Data</em></strong>” button :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTZLxepeD6Z4ERxC5WYBNw.png" /></figure><p>So far finally, We can look for the final page of the pipeline : “<strong><em>copy_all_tables</em></strong>”, where there exists one activity named “<strong><em>Look for all tables</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yNlIQN_WnBEz3oVuu7Dkhg.png" /></figure><p>Now, we perform the “<strong><em>Debug</em></strong>” step for this pipeline :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S3-Uz3VT41rIKKwLh8ARMg.png" /></figure><p>We can see that, under “Output” tab, there exists a Job which is queued up :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bGZSSS8q-vQP7y78zzD52g.png" /></figure><p>Once this pipeline is succeeded, the status can be seen below :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ovCZlIgaM6iYeY_jIHqmvA.png" /></figure><p>In order to see the output, we have to click on the special button under the “Output” folder :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-siCZyAcKlX-IhjBq23USw.png" /></figure><p>First, we can look at Input here, which is nothing but the query that we configured in the Lookup activity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0L4AEDt_p6wO5mEg_YDsQ.png" /></figure><p>And next, we can see the output, which is nothing but the list of all the tables that we fetched from this Pipeline :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LsGQmENOb5cTjDKx27TSMQ.png" /></figure><p>Next, we want to iterate over all the table-names that we have got and copy them one by one. So, we create a new activity called “<strong><em>ForEach</em></strong>” and attach it to Lookup activity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9ISeGVlukjW9Tm8g1sfqA.png" /></figure><p>We name this activity as : “<strong><em>ForEach Schema Table”</em></strong> :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SRolhohKL0DzWErOFiXXg.png" /></figure><p>Now, we go to Settings tab to explore some configurations for this new activity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zrio171VMhiAZqf4BuSWPw.png" /></figure><p>Now, we click on this button : “<strong><em>Add Dynamic Content</em></strong>” for this activity under settings and build this activity of this pipeline : Basically, we are reading from the previous Activity and reading its <strong><em>output.value</em></strong> →</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYRWmnIabuUBrhzHrxSfnw.png" /></figure><p>Next, we go to “<strong><em>Activities</em></strong>” section of this specific Activity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJtH3-IBzrJ8mlg0ol1Qhw.png" /></figure><p>Here, we specify the “<strong><em>Copy Data</em></strong>” as activity inside this “<strong><em>ForEach</em></strong>” activity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWoWCJJWOgxUclU1qr9SJA.png" /></figure><p>We change it’s name first of all to : “<strong><em>Copy Each Table</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BNIJzpm6z75hGDeZFTvNA.png" /></figure><p>Now, we go inside the Source configuration for this activity and make use of the “<strong><em>SqlDBTables</em></strong>” Source DataSet :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lwFjyY61Ka5BBLLegQ0puw.png" /></figure><p>Next, we make use of the existing Linked-Service and SHIR :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-cbAB0n0zIUskEVUZZaKw.png" /></figure><p>And we also configure the below shown Pipeline Expression Builder, because for every table there, I want to read all the rows from that table :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQQPiRn_KSZMoGOTLZE4IA.png" /></figure><p>Now, we move on to Sink portion of this Activity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OcbgCyz00SlVnymYT5XvUw.png" /></figure><p>We want to choose the Sink as ADLSGen2 :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtNxdYX2Tsu1jgZ7_jtt4w.png" /></figure><p>We also choose the format of the data that we wanted to store in the ADLSGen2 as “<strong><em>Parquet</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kb4D5J0EbpQKdosCSnOp5Q.png" /></figure><p>Once we choose this format, we specify its properties like its name and file-path. We click on “Browse” button on this file-path :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aLFXcE89RaBbtwty8nD0bA.png" /></figure><p>Here, we select the folder that we have created already in our storage account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aR_LqiF-EiPvkviCE0MyrA.png" /></figure><p>And after we select this folder, this is how dashboard look :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPpN0ZDQ3Zz2s-WteBLaRw.png" /></figure><p>We want to organise our data in the ADLSGen2 like this :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*lH7g0o3pzOEvCiOktQsC4A.png" /></figure><p>Now, we go to Sink part of this Activity &amp; open the Sink DataSet :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8JfWgay0kAdwPc609G50g.png" /></figure><p>Here, we specify following 2 parameters :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3h5j9GNf-fwHPjypKfs-A.png" /></figure><p>Here, finally, the sink portion of this dataset looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yfm1XFWetbvOoHPLiHvy4Q.png" /></figure><p>We also build the pipeline through expression builder, with the help of 2 parameters that we created above :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKVOmZXA6LIMoLqO00f6Eg.png" /></figure><p>And our sink property looks like this :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIrqLurv8O5Q6uBuc82Hiw.png" /></figure><p>We finally now go to Publish the Pipeline :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWyL8cFmIvT4MiZWz0WOyA.png" /></figure><p>And once the pipeline is published succesfully, we can see the same from Dashboard :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tUWgvyLudtzG5JkV7CZfKg.png" /></figure><p>We now run this Pipeline with the help of Trigger on the ADF :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBIyWfr8GmHEM6xfjYvztA.png" /></figure><p>We can see the Triggered Runs as well for this pipeline :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDuvuERmTLOtc63mchy3Lg.png" /></figure><p>Here, we can see the details of all the activities involved in this pipeline :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r1reYgqlPEqADah2PCQaUA.png" /></figure><p>As we have 10 tables and all of these tables have some data, after sometime we can see the status would change to Success :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24mUCuNei_nLxwOrLJ2X6g.png" /></figure><p>And finally we can see the output here i.e. Inside the ADLSGen2 Storage, we can see that, a new folder has been created for each individual table in the “bronze” folder of ADLSGen2 Storage :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IM0ktNBb2VZ-7VMewXvz7A.png" /></figure><p>That’s all in this blog. We shall meet you in next blog. If you enjoyed learning about ADF, please do clap on this page. See you soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7ad80bd0b0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking through Azure Cloud || Part6.2]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-cloud-part6-2-0dcd2f91b26f?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dcd2f91b26f</guid>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sun, 04 May 2025 08:18:46 GMT</pubDate>
            <atom:updated>2025-05-04T08:18:46.809Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are landing first time, this is the <a href="https://adityagoel123.medium.com/walking-through-azure-cloud-part6-1-6fe12e43f49d">link to go for you</a>. In this blog, we shall learn about Cosmos-DB offering from Microsoft-Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ykMgElH0nyNfC9OhrEd75g.png" /></figure><h4>Part 1. Consistency in Cosmos-DB</h4><p><strong><em>Question → </em></strong>Talk about the Data Consistency Levels in Cosmos DB ?</p><p><strong><em>Answer → </em></strong>There are many consistency levels which are supported by Cosmos-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riTKVTIuA1pj1jD9mIJfvA.png" /></figure><p>Here is the understanding about each one of these levels :-</p><ul><li>If we are in Banking Domain OR any other Financial Domain, the consistency level should be kept as Strong.</li><li>If we are in Social-Media Domain, the consistency level can be kept as Eventual, because it hardly matters if some likes OR comments comes out of order.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*105gyfyakBlSwf5JrhXMoA.png" /></figure><p><strong><em>Strong Consistency → </em></strong>For example if writes are happening in Region : “<strong><em>West US 3</em></strong>” and reads happens from “<strong><em>West US</em></strong>” &amp; “<strong><em>North Central US</em></strong>”, then the reads would see the latest data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXKiZLV_kXVWMxKjwx-G1g.png" /></figure><p><strong><em>Bounded Staleness → </em></strong>For example if writes are happening in Region : “<strong><em>West US 3</em></strong>” and reads happens from “<strong><em>West US</em></strong>” &amp; “<strong><em>North Central US</em></strong>”, then the reads would be visible after sometime. They shall not be immediately visible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2GkuKOZpPPj7fSKQ4FsBkg.png" /></figure><p><strong><em>Eventual Consistency → </em></strong>For example if writes are happening in Region : “<strong><em>West US 3</em></strong>” and reads happens from “<strong><em>West US</em></strong>” &amp; “<strong><em>North Central US</em></strong>”, then the reads may not be in order AND they would be visible late i.e. not instantaneous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lLkmtLyFTUyE5ngLjLv8_g.png" /></figure><p><strong><em>Question → </em></strong>Give one end to end demo about the Data Consistency Levels in Cosmos DB, through codebase ?</p><p><strong>Step #1.) </strong>Here we have coded the Model, which shall be used to ingest/save the documents into Cosmos-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*4LhmNIGwthEH65METTqwaw.png" /></figure><p><strong>Step #2.) </strong>Assuming that, we have some records already present into our Container :-</p><ul><li>Let’s try to fetch the documents, with the help of this codebase as shown below.</li><li>Note that, by default the Strong consistency Level shall be applied.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jCtrMEwry-8e8t0i97jow.png" /></figure><p><strong>Step #3.) </strong>Here, we can see the charge in terms of RUs in order to fetch the record on the basis of Id + PartitionKey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d33WDccxnpm1rJtJ2k7dxg.png" /></figure><h4>Part 2. Writing Data to Multiple Regions in Cosmos-DB</h4><p><strong><em>Question → </em></strong>Can we have an option, through which we can write the data to multiple regions simultaneously ?</p><p><strong>Step #1.) </strong>We can enable the Multi-Region writes, from Cosmos-DB Dashboard UI :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vykYBpw9vWs7FNFstE1hvw.png" /></figure><p>If we scroll to the right, we can see that, the write has been now enabled in the multiple regions. In the below screenshot, we have 3 regions where writes shall happen :-</p><ul><li>West US.</li><li>West Central US.</li><li>Canada Central.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q83OmTTLPoo6LLrIfVo6ug.png" /></figure><p><strong>Step #2.) </strong>We can also see here on the Overview page that, there are 3 Write-Locations as well as there are 3 Read-Locations :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAI92ivAwTVVmtkIIZOpmg.png" /></figure><p><strong>Step #3.) </strong>Now, let’s first note down the connection-strings, in order to connect to this Cosmos-Database :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UM1ZMRCmYm8fOO0fIT8SA.png" /></figure><p><strong>Step #4.) </strong>Now, let’s try to now code for the same :- We first define the endpoint and key, the ones that we copied from above :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tbWZ7tBMX-1KJdy-YBg-Nw.png" /></figure><p>Now, we try to insert the record into the Cosmos-DB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55ohyP3EKIaXDK-EzhxB-g.png" /></figure><p>Note that, since Multi-Region-Writes are enabled, there are 20.57 RUs consumed, which are quite high, even for a simple write of a record. This is because, we are writing in 3 regions at a single point in time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swcQAxEAsdAyN3ZjAqF8gg.png" /></figure><p><strong>Step #5.) </strong>Now, we can go to the Cosmos-Dashboard and see the same record that we have inserted through the code :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGWyqBj9V8at0a2lSK4Frg.png" /></figure><h4>Part 3. Querying from Cosmos-DB</h4><p><strong><em>Question :- </em></strong>Give one end to end Demo to play with Cosmos-DB API of NoSQL-API, especially from querying prospective ?</p><p><strong>Answer → </strong>Let’s imagine that, we already have a Container named “<strong><em>products</em></strong>” and it already contains some Documents.</p><p><strong>Step #1.) </strong>This is how, we can fire the Select Query on our Cosmos-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25Z54kDfTtsISTKuChkDew.png" /></figure><p><strong>Step #2.) </strong>For the afore-said select-query, we can also see the number of RUs being consumed :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Cw_lx1snI4gLqyfKAqASg.png" /></figure><p><strong>Step #3.) </strong>We can also perform selective projection from the table i.e. we can only fetch some limited columns :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*w95XLqCyjO-s4WkVvYPpeQ.png" /></figure><p><strong>Step #4.) </strong>We can also query from our Container on the basis of some where clauses i.e. query on some column as shown in below query.</p><ul><li>In the below screenshot, we can see the RUs charged to us for this query.</li><li>Please note that, since Cosmos had to do little extra work, therefore the count of RUs being consumed are little higher.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqDQqDeypHXjCkzQhDA7dw.png" /></figure><h4>Part 4. Ingesting &amp; Querying the data to Cosmos-DB</h4><p><strong><em>Question :- </em></strong>Give one end to end Demo to play with Cosmos-DB API of NoSQL-API, especially from Documents-Ingestion prospective ?</p><p><strong>Answer → </strong>Now, we shall be Ingesting some records/documents into the Container named “<strong><em>products</em></strong>” :-</p><p><strong>Step #1.) </strong>This is how, we can save/ingest a fresh/new document into our Container in Cosmos-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FBx5jiBRv23g0YBLeQi9Aw.png" /></figure><p><strong>Step #2.) </strong>Similarly, we can also ingest some another document.</p><ul><li>While we are ingesting a document into Cosmos, the fields that we ingested specifically are : “categoryId”, “categoryName”, “price”.</li><li>While we are ingesting a document into Cosmos, the fields that get auto-created (i.e. System Generated) by themselves are : “id”, “_rid”, “_self”, “_etag”, “_attachments”, “_ts”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GniaEDv8x1JdOQwgzp2_ow.png" /></figure><p><strong>Step #3.) </strong>Similarly, we can also ingest some another document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*22wLfdH51OFzUqRqvbl-gg.png" /></figure><p><strong>Step #4.) </strong>Similarly, we can also ingest some another document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxQHELYqvym3aNIuxZ9E8w.png" /></figure><p><strong>Step #5.) </strong>Similarly, we can also ingest some another document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoCqabX8fnOGmc4CPy1s3w.png" /></figure><p><strong>Step #6.)</strong> Now, we fetch the documents from Cosmos through SQL Query :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CRfM2zht2N9_CZErRbHxdQ.png" /></figure><p>In this case, the total RUs being charged for querying all these documents are :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WGVB9VSaFgMlsUZIH323g.png" /></figure><p><strong>Step #6.)</strong> Now, let’s fetch some selective data only from the Containers :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*PdggRfG1_kmoLhT_qqDEyA.png" /></figure><p>Note that, in the above query, considering the Record #1 :-</p><ul><li>Key is “categoryName”.</li><li>Value is : “Apple”</li></ul><p>Similarly note that, in the above query, considering the Record #2 :-</p><ul><li>Key is “categoryName”.</li><li>Value is : “Banana”.</li></ul><p>If we only want to fetch the values out of the K,V pairs, then we can fetch the same through this query :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*YBy_ep8rTOKjKSs8uv7u2A.png" /></figure><p><strong>Step #7.)</strong> Now, if we only want to fetch unique values of a particular attribute :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*iMUAIFYh_55c_CZ6NVnr6w.png" /></figure><p>Now, if we only want to fetch unique values i.e. only names of a particular attribute :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*5CKnFFhOi8_4eG7COIq6eQ.png" /></figure><h4>Part 5. Another demo for Querying the data to Cosmos-DB</h4><p><strong>Step #1.) </strong>Using the “<strong><em>cosmicworks</em></strong>” tool, let’s insert some data to our database and container which already exists :-</p><ul><li>Database → <strong><em>cosmosdb255</em></strong></li><li>Container → <strong><em>product</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYLwBC2JwruO3c0dYW6t6A.png" /></figure><p><strong>Step #2.) </strong>We can now verify that, the records are now visible in our container :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*LEtHcFYkiUbHQD8cel6MjQ.png" /></figure><p><strong>Step #3.) </strong>By default, Cosmos creates the Indexes on all the fields :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-8oDtwfh1l8DiQUtnL67g.png" /></figure><p><strong>Step #4.) </strong>Now, let’s query on this Container and note the RUs consumed are 8.41 :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6L75HpvwscEhvYsDtzDJOg.png" /></figure><p><strong>Step #5.) </strong>Now, let’s query on this Container and additionally ask for ordering of data too. So, here cosmos have to do some extra bit of work. Therefore we can observe that, the count of RUs being consumed are little higher :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ltNUw9r77OMICsFl1ySntQ.png" /></figure><h4>Part 6. Playing with Gremlin-API of Cosmos-DB</h4><h4>Part 6.1 Creating a Database :-</h4><p><strong><em>Question :- </em></strong>Give one end to end Demo to work with Cosmos-DB API of Gremlin Graph ?</p><p><strong>Answer → </strong>We shall show the demo for Cosmos-GraphDB :-</p><p><strong>Step #1.) </strong>We here create the Cosmos-DB-Account first :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3Yl19KZKTp3voOq3obocw.png" /></figure><p><strong>Step #2.) </strong>We now choose the API along with which, we shall work in Cosmos-DB-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bLm7mCinkDZurKrOVKsTw.png" /></figure><p><strong>Step #3.) </strong>We now choose the capacity mode from following 2 options :-</p><ul><li>Provisioned Throughput.</li><li>Serverless.</li></ul><p>Here, we shall be choosing the Serverless Mode :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WxWb7gmtSTSSz0etZF0I8A.png" /></figure><p><strong>Step #4.) </strong>Finally, we hit the Create Button here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ht0Y7VmUkZVVazCGzVXqg.png" /></figure><p>Once the account is created, we can see our deployments :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y9Y4ed9rYl7h9qd_VWvuBA.png" /></figure><p>Here is how, our Cosmos-DB-Account would look like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kZ2zILl_LIwrFMmDIZXAqA.png" /></figure><p><strong>Step #5.) </strong>Let’s now create a Database :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSh0TulAPRiEkgrBO84SDg.png" /></figure><h4>Part 6.2 Creating Container inside the Database :-</h4><p><strong>Step #6.) </strong>Now, we create a Container/Table/Graph inside this particular Database :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZ6kM7se2YQVNHKpTVIiUQ.png" /></figure><p>Here, we can see that, we now have :-</p><ul><li>Database Name → “<strong><em>graph-database</em></strong>”.</li><li>Table/Container → “<strong><em>persons-graph</em></strong>”.</li></ul><p>Inside this Container, there can be multiple entries OR Rows OR Records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KELgZQuVOOpkoAgftNbYsQ.png" /></figure><h4>Part 6.3 Inserting Vertices into the Graph :-</h4><p><strong>Step #7.) </strong>Here is how we can insert the Vertices into this Container :- g.addV(‘person’).property(‘name’, ‘Ravi’).property(‘age’, 39).property(‘userid’, 2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z0LhyMAUKXLFWwI4IHXtnA.png" /></figure><p>Inserting another record :- g.addV(‘person’).property(‘name’, ‘Ranga’).property(‘age’, 40).property(‘userid’, 1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGnbwjWohLxMCQ8oSJVjcg.png" /></figure><h4>Part 6.4 Inserting Edges into the Graph :-</h4><p><strong>Step #8.) </strong>Here is how we can insert the Edges into this Container :- g.V().hasLabel(&#39;person&#39;).has(&#39;name&#39;, &#39;Ranga&#39;).addE(&#39;knows&#39;).to(g.V().hasLabel(&#39;person&#39;).has(&#39;name&#39;, &#39;Ravi&#39;))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pb0PPWZdT_qwuiN2yoDM0Q.png" /></figure><p>Inserting another Edge:- g.V().hasLabel(&#39;person&#39;).has(&#39;name&#39;, &#39;Ranga&#39;).addE(&#39;knows&#39;).to(g.V().hasLabel(&#39;person&#39;).has(&#39;name&#39;, &#39;Ranjith&#39;))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWyNkYWz0IIyAniJEp51hw.png" /></figure><h4>Part 6.5 Fetching Vertices from the Graph :-</h4><p><strong>Step #9.) </strong>Here is how we can fetch the graph’s vertices :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZlF99cvmJRJn6JEpfvJqgg.png" /></figure><p>So, we can see that :</p><ul><li>We have 3 vertices i.e. 3 persons that we added to this Graph : [Ravi, Ranga, Ranjith].</li><li>For every person, there are some properties that do exists.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOU9DsgMzsymRM6BxpSK0w.png" /></figure><h4>Part 7. Indexing with Cosmos-DB</h4><p><strong><em>Step #1.)</em></strong> We assume here that, our Database already exists here. Let’s go and check the Connection-Strings and Keys here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8nhhMB0_A74El6Nv4QQRw.png" /></figure><p><strong><em>Step #2.)</em></strong> Let’s create a new container here with the name as “<strong><em>products</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*vYcVUFhq_zKJM93M2MDvlw.png" /></figure><p><strong><em>Step #3.)</em></strong> By default, Cosmos creates indexes on all the fields/columns of a table. We can see the same from here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*8YyeVnHO1n8HM4gzX_c1pQ.png" /></figure><p><strong><em>Step #4.)</em></strong> Next, lets go to the code. As shown in below snapshot, we are showing the mechanism to insert the records into the Cosmos-Containers :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WsuRjjXIZ6HfWCRosBuIQ.png" /></figure><p>We are generating some records ourselves, which we shall be ingesting to our Container. Each record (that we generate here) shall have following fields :-</p><ul><li>Name.</li><li>Price.</li><li>CategoryId.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGUwrYE_OHHrEItcN3dYPQ.png" /></figure><p>This is how the final leg of our code looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*KmDpw508-257J4DNxjhecQ.png" /></figure><p>Once we execute this code snippet, we can see here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OifVPun9U-bjaow-J-UDw.png" /></figure><p>We can verify the documents from our Cosmos-Dashboard as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfYZtOFR_v-nQp1qgkKcfQ.png" /></figure><p><strong>Step #5.) </strong>Let’s now query our Table on the basis of the field : “name”.</p><ul><li>Note that, we dont have any records for name = “Licensed”. This is an intentional empty query that we have fired.</li><li>Also, as of now, the name field is indexed, because this field was indexed from Container creation time itself.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zquPVesLpQiEtu_PcbfT7Q.png" /></figure><p>Note that, the RUs being charged for this query are : 2.8 RUs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8F9lYfHK4TXvNQKVc2tdA.png" /></figure><p>Similarly, we now query our table on the basis of “<strong><em>price</em></strong>” which is again the indexed field. Here as well, note down the RUs that are there :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FC7S5-R88SrXfmQeXh1fnA.png" /></figure><p><strong>Step #6.) </strong>Now, let’s create the index on only “<strong>price</strong>” field and no other field :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G7v9pB4oGDvPXsidQuldvw.png" /></figure><p><strong>Step #7.) </strong>Here, if we now query on the “<strong><em>name</em></strong>” field (which is no more a indexed field in Cosmos Container), we can see the RUs consumed shall be too much.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rpXFUAxcWVG5_x_LkfYcfQ.png" /></figure><h4>Part 8. Indexing Optimisation with Cosmos-DB</h4><p><strong><em>Step #1.)</em></strong> Let’s assume that, we already have a Database (named “<strong><em>cosmicworks</em></strong>”) and a Container (named “<strong><em>products</em></strong>”) inside it. By default, Cosmos creates indexes on each and every field as shown here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeTIx7U5xKZb_8XOacRGqg.png" /></figure><p>What we are going to do here is : To read through our sample file and create the document into our Cosmos-Container :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJO921v19m3B5YmqIQ_rWw.png" /></figure><p>We are using the Library from Cosmos, in order to Upsert the Item into Cosmos-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39hlU9EHMKOQsmxCVZeo8A.png" /></figure><p><strong>Step #2.) </strong>Let’s now Build our Program : dotnet build</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3CmG0Fb1CZO77lYU95WGw.png" /></figure><p>We now execute our program and interesting thing to note here is that, the RUs consumed to insert this record into our Container are 48.38. This is because of the reason that, indexing on all the fields is by-default ON (as we saw in the Step #1 above) :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*ru748jfWJaP0z4_Jpu9gIQ.png" /></figure><p>And hence we can verify that, we can see our Record into our Container :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WlSzchWc1wje7rBVExbhw.png" /></figure><p><strong><em>Step #3.)</em></strong> Let’s now go ahead and modify the settings in such a manner that, we only create the Indexes on only 2 below mentioned fields &amp; remove indexes from any other field :</p><ul><li>name.</li><li>categoryName.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1I_8_rgptaJfxAqUn9LJyA.png" /></figure><p>We now again insert our record into Container. Couple of things to note here that :-</p><ul><li>Our RUs consumed have reduced from 4838 to 8.38.</li><li>This is because, we are now NOT indexing on all the fields, but rather just indexing on only 2 fields.</li></ul><p><strong><em>Learning here is that →</em></strong></p><ul><li>If the indexing is ON on all the fields, then during write operation, much-higher RUs shall be consumed.</li><li>If the indexing is ON on all the fields, then during read operation, much-lesser RUs shall be consumed.</li></ul><p>Therefore, we should only create the Index on the fields which are really required to be queried later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*-HC6TzwiiWk-J1SXV9KSkg.png" /></figure><p>Now, let’s do one more experiment here by removing indexing from even these 2 fields as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*bTtw5ANjXoArjUQi-woJpw.png" /></figure><p>Now, if we try to ingest a record once again, we can note that, the count of RUs consumed have further reduced :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*skO3iZrqlECyemc-RLEBsw.png" /></figure><p>That’s all in this blog. If you liked reading it, do clap on it. We shall see you in next blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dcd2f91b26f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking through Azure Cloud || Part6.1]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-cloud-part6-1-6fe12e43f49d?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fe12e43f49d</guid>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sun, 04 May 2025 04:26:07 GMT</pubDate>
            <atom:updated>2025-05-04T04:26:07.269Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are landing first time, this is the <a href="https://medium.com/@adityagoel123/walking-through-azure-cloud-part-2-ca0110e7ca95">link</a> to go for you. In this blog, we shall learn about Cosmos-DB offering from Microsoft-Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eUzBCBkOMU8y8tWL.png" /></figure><p><strong><em>Question → </em></strong>What is Cosmos-DB ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9recy86KcPbYzgzpxBesw.png" /></figure><p><strong><em>Question → </em></strong>How the data is organised inside the Cosmos-DB ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hX_jFK8SiGrtUlxqEvEg0Q.png" /></figure><p><strong><em>Question → </em></strong>What are various APIs exposed by Cosmos-DB ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNF6kK3Y8fye2XJpm0OLFg.png" /></figure><p>This is how the dashboard interface of the Cosmos-DB homepage looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eappylyehxRw_cF7Po0Ofw.png" /></figure><p><strong><em>Question → </em></strong>How is Cosmos-DB different from other databases ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auml8f3y3UW59dd_Y2AOqA.png" /></figure><p><strong><em>Question → </em></strong>What are the naming conventions used with Cosmos-DB for various APIs ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8kOV-s7lUCKWVOjOPLxsIg.png" /></figure><p><strong><em>Question → </em></strong>Explain about the concept of Request-Unit (“<strong><em>RU</em></strong>”) in Cosmos-DB ?</p><p><strong>Answer → </strong>RU stands for Request-Unit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwdUI8w1bJlYxCNepCu8ZQ.png" /></figure><ul><li>The usage in Cosmos-DB is expressed in terms of RU.</li><li>Each Database Operation (like Read, Insert, Delete, etc.) consumes a variable number of RUs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-_3K4TGoNzeYTrjEORRzA.png" /></figure><p><strong><em>Question → </em></strong>At what level, do we configure the RUs i.e. whether we do at Container Level OR Database level ?</p><p><strong>Answer → </strong>Yes, this is very much possible and its a good practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58LqgNZfhgdqzniO1fOHMA.png" /></figure><p>If we have to configure the RU at Database level, this is how it would look like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SkskE-GzTn44StHWIe9BAw.png" /></figure><p>If we have to configure the RU at Container level, this is how it would look like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxC09_2RGLK7D_v7rYI52w.png" /></figure><p>If we have to configure the RU at mixed level, this is how it would look like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EYB4tgLhGgVm_NTNVJVVNQ.png" /></figure><p><strong><em>Question → </em></strong>Talk through example about the computation for RUs ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F15qy9ZYXTYpSafSTG5uxA.png" /></figure><p><strong><em>Question → </em></strong>How do we compute, for our particular workload, how much of RUs shall we need ?</p><p><strong>Answer → </strong>Azure have exposed a Capacity-Calculator where we can compute the number of RUs that we shall need for our specific use-case based upon combination of all the below factors :-</p><ul><li>Size of Item in our workload.</li><li>Read Traffic per second.</li><li>Create Traffic per second.</li><li>Update Traffic per second.</li><li>Delete Traffic per second.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stLmqIImhC7vyHq-5UoW8A.png" /></figure><p>Here, Cosmos-Capacity-Calculator have automatically computed : How many RUs shall be needed for the given CRUD load (Assuming that the size of our Item is 1 KB) :-</p><ul><li>Create Traffic would be 10 RPS → 50 RUs/sec.</li><li>Read Traffic would be 50 RPS → 50 RUs/sec.</li><li>Updates Traffic would be 99 RUs/sec.</li><li>Delete Traffic would be 0 RUs/sec.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9Z5rYsiHZkG75H9izUn7A.png" /></figure><p>Similarly, if we know increase the item-size to 2 KB, we can see the updated costing :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*UN4NfgajdAZheep8kPwPcg.png" /></figure><p><strong><em>Question → </em></strong>Talk about the concept of Logical &amp; Physical Partitions available with Cosmos-DB ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-iqO0fAcm-2x9RMvZ7YAw.png" /></figure><p>In simpler words, we can say that, each container may physically exist at multiple Physical Machines. But this all is abstracted from the User i.e. User would never come to know, at which all machines my container is being stored ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WwKPRjwzzLIS6wDqNtlPeg.png" /></figure><p><strong><em>Question → </em></strong>Talk more about the concept of PartitionKey in Cosmos-DB ?</p><p><strong><em>Answer → </em></strong>Imagine that :-</p><ul><li>We choose the PartitionKey as “<strong><em>City</em></strong>” for our use-case.</li><li>In this case, whenever we insert any records / documents in the container, all those records with partitionKey as “<strong><em>London</em></strong>” shall be stored in one single logical partition.</li><li>Similarly, all those records with partitionKey as “<strong><em>Paris</em></strong>” shall be stored in one single different logical partition.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IcS6lJjsflsOjnWJgQDwOw.png" /></figure><p><strong><em>Question → </em></strong>What shall happen, if there are too many records for a given city i.e. London ?</p><p><strong><em>Answer →</em></strong> Usually a Container is divided into logical partitions on the basis of the partitionKey.</p><ul><li>Imagine, we get comparatively higher count of records for city : “London”.</li><li>In this case, it would lead to problem of Hot Partition, because the logical-partition (corresponding to city: London), shall be too much populated as compared to the other partitions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bI8jtIO3sPiiWlSiFzNJtw.png" /></figure><p>Therefore, our strategy to choose the partitionkey should be such that, the records should get distributed equally amongst all the Logical-Partitions, so that we can avoid the Hot-Partitions.</p><p><strong><em>Question → </em></strong>Talk through an example of Single Partition Query ?</p><p><strong><em>Answer → </em></strong>In below example, we have chosen userName as the partitionKey. Therefore, all the records which have userName as ‘Sara’ shall be saved in one single logical partition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Iu5Y9_K9mnjuashOXNPRg.png" /></figure><p><strong><em>Question → </em></strong>Show where we configure the RUs ?</p><p><strong>Answer → </strong>Since ours is a free account, we get 1000 RU per second and 25 GB of storage amount. See in below screenshot, this is how, it is configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7MG4jILmx3CK7kIfD7tdmg.png" /></figure><p><strong><em>Question → </em></strong>Let’s talk about various scenarios to talk about How Cosmos-DB should be used ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpi3R6l6FhHpKcexTDb6hw.png" /></figure><p><strong><em>Question → </em></strong>What if we want the items to be auto-deleted from the Cosmos-DB-Container, after a certain time-period ? Do we have some TTL like feature in Cosmos-DB ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*7reU6ivwnVqwc5250VtpAw.png" /></figure><p>We shall use TTL feature of Cosmos-DB in following scenarios :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*uq-plzmiCmJy0VDSpjP7Tg.png" /></figure><p>We can define the TTL at Container level. This shall automatically apply the TTL to all the items inside this container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*jJ6F9uJYNb3d1d5l7BEOLA.png" /></figure><p>In case, we want to apply TTL at Record/Document level, we choose the option : “On (no default)” and define the TTL for the document through code, while ingesting.</p><p><strong><em>Question → </em></strong>What is the difference between two available ways to of configuring the Cosmos-DB in terms of Capacity i.e. “<strong><em>Provisioned</em></strong>” and “<strong><em>Serverless</em></strong>” ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bvr151g_2ICAGHrgCgQzA.png" /></figure><p>Here is the snippet from the MSFT documentation itself :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMdLRizwc6G__xa81yY8kw.png" /></figure><p><strong><em>Question :- </em></strong>Talk more about the Pricing Calculator for Cosmos-DB Account ?</p><p><strong>Answer → </strong>We can check for the pricing from Azure website as well. Imagine that we are checking for API choice as : NoSql. Now there are 3 options available to us :-</p><ul><li>Standard Provisioned Throughput (Manual).</li><li>Automatic Provisioned Throughput.</li><li>Serverless.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*12hdYP6-nV0U-5o0YVqRNg.png" /></figure><p><strong><em>1.) Let’s check first for Standard-Provisioned-Throughput (Manual) →</em></strong></p><ul><li>We have chosen the RUs as 400 per second.</li><li>Imagine we are going to run this for a month, because we are computing for Monthly cost. In a month approx, we have 730 Hours.</li><li>The costing may vary from Region to Region.</li><li>So, we can see in below screenshot that, the costing shall be : 4 X 730 X 0.008 = 23.36 USD per month for 400 RUs per second.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWfS2YrdCxsqJ5mKd2u3Hw.png" /></figure><ul><li>Also, imagine our dataset would come under the 10 GB, so costing for the same shall be : 2.50 USD per month, as shown below :-</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LaVGN6Kl3Dl0vDa2f5Yakg.png" /></figure><p><strong><em>2.) Let’s now check first for Automatic Provisioned Throughput :-</em></strong></p><ul><li>We have chosen the RUs as 1000 per second, again for a month with 70% utilisation.</li><li>The costing comes to be 61.32 USD per month.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*beIdM8Au5D9Bfr9x-02Cnw.png" /></figure><p><strong><em>Question :- </em></strong>Show by creating an Non-Serverless Account for Cosmos-DB ?</p><p><strong><em>Step #1.) </em></strong>We start to create the Cosmos-DB-Account :-</p><ul><li><strong><em>AccountName → </em></strong>cosmosdbact255</li><li><strong><em>Location →</em></strong> (US) West US</li><li><strong><em>Capacity Mode →</em></strong> Provisioned Throughput</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fe6yFlWQHmh9ZKiSMd7fiw.png" /></figure><p><strong><em>Step #2.) </em></strong>Now here, we choose the Global-Distribution. There are 3 options available here :-</p><p><strong><em>Geo-Redundancy → </em></strong>It means, the data shall be automatically backed-up to the Paired-Region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvyoaiRPSx-FwuxvwrD_rA.png" /></figure><p>Recall that, In step #1, we chosen our Region as : <strong><em>(US) West US. </em></strong>We can see from the publicly-available Paired-Region list that, for this region the paired region is : <strong><em>East US</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qDEVt6LUngDZ9oG1yCn5zA.png" /></figure><p>Therefore, the data from our Cosmos-DB-Account shall be automatically backed-up in paired region :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvyoaiRPSx-FwuxvwrD_rA.png" /></figure><p>If we would had chosen some other region, the paired region would had been different :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lA2BBaCfM0M01iniWtp5rQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKFFvHQ_JHZJP3t0qIN72g.png" /></figure><p>Please note one thing about this option that :-</p><ul><li>Imagine Main Region is 1 and Paired Region is 2.</li><li>Now, our application is writing to Region #1, then in this case, although the data shall be replicated to Region #2, but the data would only be available for Reads in Region #2 and No Direct Write shall happen to the Region #2 directly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*CfNJ_qhNNkdGkf-dvkDPwA.png" /></figure><p><strong><em>Step #3.) </em></strong>Next is the Networking Option for Cosmos-DB-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LwDOlxluz5WrschJCapq3w.png" /></figure><p><strong><em>Step #4.) </em></strong>Next is the BackUp Policy :-</p><p><strong><em>4.a) Option #1 → Continuous BackUp →</em></strong></p><ul><li>This option is available for free of cost for 7 days. For 7 Days, no additional cost shall be incurred on our Subscription.</li><li>This option is also available for 30 days of backup and in this variant, there shall be some modest cost applicable.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_sHyKM8S6bmlY1QUqJL8A.png" /></figure><p><strong><em>4.b) Option #2 → Periodic BackUp → </em></strong>Here we need to configure 2 things :-</p><ul><li>Backup Interval → Can be configured in Hours OR Minutes.</li><li>Backup Retention → Can be configured for last number of days.</li></ul><p>Note that, it is showing us the number of copies would be 2 in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zZmMPI7L5MIry14cuJncpQ.png" /></figure><p>Now, if we perform the backup every 6 hours for 15 days, in this case the number of copies shall be 60 :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49AY_1769xbmn42_Inp9GA.png" /></figure><p>Next, we have three options on where do we want to have the Backup :-</p><ul><li><strong><em>Locally Redundant Backup Storage →</em></strong> It means we want to backup in the same Datacentre, as that where our primary data resides.</li><li><strong><em>Zone Redundant Backup Storage</em></strong></li><li><strong><em>Geo</em></strong> <strong><em>Redundant Backup Storage</em></strong></li></ul><p><strong><em>Question :- </em></strong>For Cosmos-DB, can we enable to Geo-Redundancy after the Account Creation ?</p><p>Answer → Yes, this is very much possible. Imagine our Primary Region is : “US West”, then we can configure the other regions as Replica-Regions. For example, we have shown in below screenshot :</p><ul><li>UK South</li><li>Japan East.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fnWtgNzLj3AwMew9S6jjA.png" /></figure><p>We can also enable the Geo-Redundancy at Account level, even after the Account creation as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_xQu2M8dqSFz-NtR_tOXQ.png" /></figure><p>Once we enable the Geo-Redundancy, from here we can also choose all regions, to which we want our data to be replicated. In below example, we have chosen two additional regions as our Read-Regions :</p><ul><li>South Central US.</li><li>West US 3.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OHZ6G9oaQ1IUYvNZJXSPfQ.png" /></figure><p>We can also see this configuration also reflecting at our Cosmos-DB-Account Page :-</p><ul><li>Read Locations → West US, South Central US, West US3</li><li>Write Locations → West US.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2bONMP_yF5zzEP4JUTT7Q.png" /></figure><p>There shall also be the COGS implications for enabling the Replicas for Cosmos-DB :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYDb-tovhAPvKIg-1a2-ig.png" /></figure><p><strong><em>Question :- </em></strong>Talk about the Service managed Fail-Over ?</p><p><strong><em>Answer →</em></strong> Now, imagine something goes wrong with Cosmos-DB in the West-US-Region (Our Primary region for Writes), in that case we can enable the Automatic-FailOver that should happen to the Primary-Replica-Region. This is how, we get the Reliability with Cosmos-DB.</p><p><strong>Step #1.) </strong>So, let’s first go ahead and Enable-Service-Managed-FailOver. We can also change the priorities for the Replica-Region from the same dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*i4N5_VMFwimykHsoRIwwyg.png" /></figure><p><strong>Step #2.) </strong>Finally, once we save our Settings, we can see that the Automatic-Service-Managed-FailOver has been switched-off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHLUNv_XOV3tXOfm_-FQew.png" /></figure><p>Now, this would be helpful in a scenario, when the Primary Region gets into some trouble from Cosmos-DB side. This is something that we can’t replicate our own-selves.</p><p><strong><em>Question :- </em></strong>Talk about the Manual Service Fail-Over ?</p><p><strong><em>Answer →</em></strong> Now, imagine that we want to manually switch-over to some replica-region.</p><p><strong>Step #1.) </strong>We enable the Failover by manually choosing the Region where we want the Failover to happen :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKzYhS4J9TvAijerqrPXNw.png" /></figure><p><strong>Step #2.) </strong>We can now see that, Manual-Failover is being triggered now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MI7F3wNdsSkS8b7Tor94sw.png" /></figure><p>We can also see that, the changed configuration is also reflecting at our Cosmos-DB-Account Page now :-</p><ul><li>Read Locations → West US, South Central US, West US3</li><li>Write Locations →<strong> West US3</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bB6C14w8KABjZdOoqAtINQ.png" /></figure><p>This is how the response looks like, if we try to read via the SDK :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUyUhU6D-u6cCVKp6NUSVQ.png" /></figure><p>That’s all that we wanted to cover in this blog. Pl clap, if you liked reading it. Do check out the Part #2 for this Blog as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fe12e43f49d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walking through Azure Cloud || Part-7]]></title>
            <link>https://adityagoel123.medium.com/walking-through-azure-cloud-part-7-ea9f07433f8b?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea9f07433f8b</guid>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sat, 03 May 2025 01:54:30 GMT</pubDate>
            <atom:updated>2025-05-23T09:21:14.607Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are landing first time, this is the <a href="https://medium.com/@adityagoel123/walking-through-azure-cloud-part-2-ca0110e7ca95">link</a> to go for you. In this blog, we shall learn about ManagedIdentities from Microsoft-Azure :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qWu2f8yymKwQXv1a.png" /></figure><h3>Example #1</h3><p><strong><em>Question →</em></strong> How the permissions are checked for the Users ?</p><p><strong>Answer →</strong> We can basically assign different Roles to a particular User.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*pbzjtGdGrOSvaTAKLjvBGw.png" /></figure><p><strong><em>Question →</em></strong> Showcase how can our Application, can access some resources which are present in our Azure Storage Account, using the very basic approach ?</p><p><strong>Answer →</strong> Here is how we can access the files present in our Storage-Container :-</p><p><strong>Step #1.) </strong>Let’s first see the files which are present inside our container :-</p><ul><li>Storage Name → “<strong><em>appstore55455344243</em></strong>”</li><li>Container Name → “data”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFZ8mTHuUVyjwfWKDP2SaA.png" /></figure><p><strong>Step #2.) </strong>Let’s now navigate to “Access Keys” section for our Storage Account. Below screenshot, we can see the ConnectionString and Key that we can use, in order to access this storage-account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*qun-wOw7mJSP36ZOJz_V_A.png" /></figure><p><strong>Step #3.) </strong>Here is how our code looks like in order to access this file. We make use of following things :-</p><ul><li>BlobServiceClient</li><li>BlobContainerClient</li><li>BlobClient</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r5IYY-kSDJpqv-feSGw22w.png" /></figure><p>In the above approach, there is a problem — We have manually entered the credentials (i.e. ConnectionString) inside our code.</p><p><strong><em>Question →</em></strong> Showcase how can our Application, can access some resources which are present in our Azure Storage Account without having to mention the connectionString ?</p><p><strong>Answer →</strong> This can be done with the help of “<strong><em>Application-Object</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*T_cKtxZMIq4BEc9vgXEy8w.png" /></figure><p><strong>Step #1.) </strong>Let’s first see navigate inside our EntraId first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oNasiWwbNWQZP__zgk-K9A.png" /></figure><p><strong>Step #2.) </strong>We would register an Application now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHkEolcGbhWaEQ_4JoVrrA.png" /></figure><p><strong>Step #3.) </strong>We would now supply the name of the Application :- In our case, we are specifying the name as “<strong><em>blobapp</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*07Mh5pEnM1J6HmV6OJAWrA.png" /></figure><p><strong>Step #4.) </strong>Once our Application is registered successfully, we take note of following things :-</p><ul><li>TenantId.</li><li>ClientId</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*1GkfieZKmaqq0wMF4jKLVQ.png" /></figure><p><strong>Step #5.) </strong>We would now go inside the : “<strong><em>Certificates and Secrets</em></strong>” as shown below and create the “<strong><em>Client-Secrets</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vX1N7I7rFPA0fLtAmY6uwQ.png" /></figure><p>Here is we can see the “<strong><em>Client Secrets</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h55aUoRl8G2PG3PXHkbeuw.png" /></figure><p><strong>Step #6.) </strong>Now, so far we registered an Application and now, we need to allocate the permission to this Application-Object. So, let’s first go inside the Storage-Account → Access-Control → Add-Role-Assignment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0puUMigzjCwGuF4BuQ9Wlg.png" /></figure><p>Next :-</p><ul><li>We have selected the role as : “Storage Blob Data Reader”.</li><li>Under the option : “<strong><em>Assign access to</em></strong>” :-we choose : “<em>User, Group, or Service Principal</em>” :-</li><li>When we click on Select-Members → we can select our Application-Object i.e. “<strong><em>blobapp</em></strong>”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rS1Mo5dBs5E_fggNJrnMsA.png" /></figure><p>Finally, once the Role is assigned to this ApplicationObject, this is ready to be used in our application-codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cG0iaxbdRsPWUuJcZ2TlRA.png" /></figure><p><strong>Step #7.) </strong>Now, we shall directly access the files, which are present inside our Storage-Account → Container → Files using :-</p><ul><li>ClientSecretCredential</li><li>BlobClient</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*o1ROopmE89P35xNw0IDyVg.png" /></figure><p>Now, when we execute our code at our local-personal-On-Premise-machine, we shall be able to download the file successfully now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*CFLZB4w5fm8fQ4AMS1z5kQ.png" /></figure><p><strong><em>Question →</em></strong> What’s the main dis-advantage of using Application-Object mechanism of accessing the Azure-Resources from the Application codebase ?</p><p><strong>Answer →</strong> The main problem here is :- Even though, we have made use of RBAC, we still needed to embed the credentials of the Application-Object in our codebase :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*W2aKsZTF9ejsUfCjN7jQeg.png" /></figure><h3>Example #2</h3><p><strong><em>Question →</em></strong> What is the alternative to the Application-Objects ?</p><p><strong><em>Answer →</em></strong> The alternative to the “Application Object” is to use : “<strong><em>Managed Entities</em></strong>”. This gives us a way for our Applications to authenticate to Azure Resources without the need of embedding the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*3o1zhIeNyBmp0UQc" /></figure><p><strong><em>Question → </em></strong>What is the main requirement in order to use the “<strong><em>Managed Entities</em></strong>” ?</p><p><strong><em>Answer → </em></strong>The main requirement is :</p><ul><li>Our application-code needs to be hosted on a service that supports Managed-Entities like VM, App-Engine, etc.</li><li>Under the hoods, the “Managed Entities” shall create a Service-Principal for that resource.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*MsYujhSlNqn27efRd1Y7ZA.png" /></figure><p><strong>Step #1.) </strong>After our first is successfully created at our Azure Account, Under the “<strong><em>Identities</em></strong>” section, we enable the System Managed Entity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*pRH1KpOChF7xx80QuOGJGg.png" /></figure><p>Once we enable the “System Assigned Managed Entity”, here is how it would look :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOsJWUgiGenOZZa31WV5nQ.png" /></figure><p><strong>Step #2.) </strong>Now, let’s assign the RBACs. Here, we are saying , we shall allocate the permissions of accessing the Storage-Account to our VM.</p><ul><li>So, for this, we go to the Storage-Account → “Access Control (IAM)”.</li><li>Please note that, this is the Account, that has to be accessed by our application-codebase.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UwlBRJuqj7DgCUVxLg9hvw.png" /></figure><p><strong>Step #3.)</strong> We shall choose the Role as : “<strong><em>Storage Blob Data Reader</em></strong>” and move forward :-</p><ul><li>We choose : “Managed Identity”.</li><li>Under Members, we choose our VM, to which the access to Storage-Account has to be assigned.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3a3MAbNxpxRQuJX0H-9DLw.png" /></figure><p>So, here we choose our VM that we created in aforementioned-step :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhpFxndz4gQfseRxBhnTYw.png" /></figure><p>After the Role has been assigned to the afore-shown VM, here is how the UI would look like. Now, we hit the : “Review and Assign” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*BQKYX2nx-NaVqBVWv5QTdQ.png" /></figure><p><strong>Step #4.)</strong> The class that we shall use to access the Storage-Account from the Application-codebase is : “<strong><em>DefaultAzureCredential</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gnE1k6ji_4MVOGUI-3fbQ.png" /></figure><p><strong>Step #5.)</strong> The code to access the Storage-Account &amp; objects in the container , through the DefaultAzureCredential looks like as follows :-</p><ul><li>BlobClient.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Udsqt6iFxxuUe8nY8XrY4g.png" /></figure><p>Please note that :-</p><ul><li>The aforementioned code-base can’t be executed at our local-on-premise-machine, rather this code can only be executed at VM, which is present inside our Azure Ecosystem.</li><li>In the above mentioned steps, we have created the VM (at which we shall be running the afore-shown code-piece).</li><li>So, we first build the code at our local and would take the executables at our VM.</li></ul><p><strong><em>Question → </em></strong>How does <strong><em>DefaultAzureCredential </em></strong>works under the hoods ?</p><p><strong><em>Answer → </em></strong>Under the hoods, it generates a token, which VM shall be used to hit the Storage-Accounts :-</p><p><strong><em>Step #1.) </em></strong>Here, Azure exposes this endpoint, which we shall copy from here :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzbXV4F_lZgff8PXk2oCRA.png" /></figure><p><strong><em>Step #2.) </em></strong>Let’s now write this code, to access the token for the Storage-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C68IMUTW3jW6nn59h7XTwA.png" /></figure><p><strong><em>Step #3.) </em></strong>We build this code at our local machine and take this executable at the VM. Once the executable is there is at the VM, we shall execute it and we can now see the token, which is what being used under the hoods of ManagedEntity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WTjo7H52Jz8zyVKT0VOtdQ.png" /></figure><p><strong><em>Step #4.) </em></strong>Now, we can also fetch, some more informations from this Token :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_tOeBHK8QiQbVxP9HAJdA.png" /></figure><p><strong><em>Step #5.) </em></strong>Now, we again build the code at our local :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_tOeBHK8QiQbVxP9HAJdA.png" /></figure><p>We now take the executable to VM :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EAGNqwwa1nL1_vtsFn0nUQ.png" /></figure><p>We now execute the same DLL at VM and we can see some additional information from this Token :-</p><ul><li>client_id</li><li>token_type</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMZX6AJ-4cb_0vdAmp5BFw.png" /></figure><p><strong><em>Step #6.) </em></strong>Here is now, we can execute our code to access the Storage Account too :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-yPUR-kIB9zLzz8pUmDXkw.png" /></figure><p>The procedure would remain same. Build at Local → Transfer to VM → Execute at VM.</p><h3>Example #3</h3><p><strong>Question:- </strong>Demonstrate the concept of Managed-Identities with some different example ?</p><p><strong>Step #1.) </strong>Imagine that we have a Virtual-Machine.</p><ul><li>First, we go and enable the System-Assigned Identity at this VM.</li><li>Once we enable to System-Assigned Managed-Identity for this Resource (VM), it would be able to call other Azure services.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFgObXZj8GozecaJ7CxUQQ.png" /></figure><p>Once we enable the System-Assigned-Managed-Identity for this VM, we can see it’s Principal-Id :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzirltkktLF_4LzvszZP6g.png" /></figure><p><strong>Step #2.) </strong>Imagine that our application is running at the afore-said VM and it wants to access the below shown Storage-Account (“<strong><em>tempfunction4567grob884</em></strong>”), then we shall have to : “<strong><em>Add the Role Assignment</em></strong>” on the storage-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FGfNen5juck3b97ZTrpIA.png" /></figure><p>Here, we have to choose the Job-Function-Role : “<strong><em>Storage Blob Data Contributor</em></strong>”, because we want our VM to be able to contribute to the Storage Blob Data :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFxMtU4itASPWMXuQxqWxg.png" /></figure><p>Under the Members section, we can choose “Managed-Identity” and under the MI, we can choose the VM (for which we enabled the MI in step #1) :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5kqnr6VP3ReUoJ9PO2NgOA.png" /></figure><p>We shall be able to see the VM (for which we enabled the MI in step #1) :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGnJ2-NpPELvhGvdSU5xCw.png" /></figure><p>Here, we can see the final step :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHac8d0S9ujbMYPTWWhopQ.png" /></figure><p>So, finally now, our application (running at our VM) would now be able to access the Storage-Account automatically.</p><h3>Example #4</h3><p><strong>Question:- </strong>Demonstrate the concept of UAMI with some different example ?</p><p><strong>Step #1.) </strong>Let’s first create an User-Assigned-managed-Identity :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6ylT_qhPtUvU1TpofKxNw.png" /></figure><p>This is how our UAMI would look like, once it is succesfully created :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aL7EoeY_O6uXQo3q9-_iHg.png" /></figure><p><strong>Step #2.) </strong>Now, we go to our Storage-Account and attach this UAMI to this Storage Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INp6fYbWQmolgDSUvVyxsQ.png" /></figure><p>From the Role, we shall assign the : “Storage Blob Data Delegator” role to the Storage-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6nJ_HAQ945fKfRXl-t4dQ.png" /></figure><p>Now, we associate the Managed-Identity to this Storage-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBhKnWxN7ZDyGnbe_wNicA.png" /></figure><p>Here is how, it would look, after we attach the MI to this Storage-Account :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tE4xYjOPlG94YtvsOuT5Bg.png" /></figure><p>And we can see here that, UAMI has been associated with the Storage-Account succesfully :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJcsb_nDbz0dU9-MroiHIQ.png" /></figure><p><strong>Step #3.) </strong>Now, we associate the afore-created UAMI with our Virtual-Machine.</p><ul><li>Note that, our intention here is that, our application running on this VM, should be able to access the afore-shown Storage-Account.</li><li>We can attach this UAMI to as many resources as we want. Say tomorrow some App-Function wants to access this Storage-Account, then we can associate this same UAMI to that App-Function as well. We don’t need to enable the MI again &amp; again inside the Storage-Account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oAuz5N4qiEWcop2m82rzRQ.png" /></figure><p>Let’s add the Identity to our VM now :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gXl0HUlaV4MrOe8vwmXkkg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea9f07433f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive into Kubernetes || Part-1]]></title>
            <link>https://adityagoel123.medium.com/deep-dive-into-kubernetes-part-1-fa4f611d72b3?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa4f611d72b3</guid>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 11:09:18 GMT</pubDate>
            <atom:updated>2025-04-27T11:09:18.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pz0Hn56nEw7-8Hw1" /></figure><p><strong><em>Question :- </em></strong>What is a Node ?</p><p><strong><em>Answer :-</em></strong> A node is a machine, physical or virtual on which Kubernetes is installed.</p><ul><li>A node is a worker machine and that is where containers will be launched by Kubernetes.</li><li>It was also known as minions in the past.</li></ul><p><strong><em>Question :- </em></strong>What if the node on which your application is running fails?</p><p><strong><em>Answer :- </em></strong>Well obviously our application goes down.</p><ul><li>So you need to have more than one nodes. A Cluster is a set of nodes grouped together.</li><li>This way even if one node fails you have your application still accessible from the other nodes.</li><li>Moreover having multiple nodes helps in sharing load as well.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*vkQr4IDWJJ6eHgH6N1umNQ.png" /></figure><p><strong><em>Question :- </em></strong>Now we have a cluster. But who is responsible for managing the cluster? Where is the information about members of the cluster stored? How are the nodes monitored? When a node fails how do you move the workload of the field node to another worker node?</p><p><strong><em>Answer :- </em></strong>That’s where the Master comes in.</p><ul><li>The Master is another node with Kubernetes installed in it and is configured as a Master.</li><li>The master watches over the nodes in the cluster and is responsible for the actual orchestration of containers on the worker nodes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVv52rQmByGIAmeUKficAA.png" /></figure><p><strong><em>Question :- </em></strong>What are the various components of Kubernetes ?</p><p><strong><em>Answer :- </em></strong>When you install Kubernetes on a system, you’re actually installing the following components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*iPjnlX2_ft7gXxRFEnx6Yw.png" /></figure><p><strong><em>1.) The API server</em></strong> acts as the front end for Kubernetes. The users, management devices, command line interfaces, all talk to the API server to interact with Kubernetes cluster.</p><p><strong><em>2.) The etcd key store </em></strong>is a distributed reliable key value store used by Kubernetes to store all data used to manage the cluster.</p><ul><li>When you have multiple nodes and multiple Masters in your cluster, etcd stores all that information on all the nodes in the cluster in a distributed manner.</li><li>etcd is responsible for implementing locks within the cluster to ensure that there are no conflicts between the Masters.</li></ul><p><strong><em>3.) The Scheduler </em></strong>is responsible for distributing work or containers across multiple nodes.</p><ul><li>It looks for newly created containers and assigns them to nodes.</li><li>The controllers are the brain behind orchestration.</li><li>They are responsible for noticing and responding when nodes, containers or end points goes down.</li></ul><p><strong><em>4.) The controllers</em></strong> make decisions to bring up new containers in such cases.</p><p><strong><em>5.) The Container Runtime</em></strong> is the underlying software that is used to run containers.</p><ul><li>In our case it happens to be Docker, as we shall demo below.</li><li>But there are other options as well like VirtualBox.</li></ul><p><strong><em>6.) Kubelet</em></strong> is the agent that runs on each node in the cluster.</p><ul><li>The agent is responsible for making sure that the containers are running on the nodes as expected.</li><li>So far, we saw two types of servers. Master and Worker and a set of components that make up Kubernetes.</li></ul><p><strong><em>Question :- </em></strong>How are these components distributed across different types of servers? In other words, how does one server become a master and the other the slave?</p><p><strong><em>Answer :-</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bM6C1i4qDvRkbA6mvHHE0w.png" /></figure><ul><li>The worker node or minion as it is also known is — where the containers are hosted. For example, Docker containers.</li><li>And to run containers on a system, we need container runtime installed and that’s where the container runtime falls. In this case it happens to be Docker. This doesn’t have to be Docker. There are other container runtime alternatives available such as Rocket or Cryo.</li><li>The master server has the kube API server and that is what makes it a master.</li><li>Similarly, the worker nodes have the kubelet agent that is responsible for interacting with a master to provide health information of the worker node and carry out actions requested by the Master on the worker nodes.</li><li>All the information gathered are stored in a key value store on the master.</li><li>The master also has the control manager and the Scheduler.</li></ul><p><strong><em>Question → </em></strong>What is our goal with Kubernetes ?</p><p><strong><em>Answer → </em></strong>Our ultimate aim is to deploy our application in the form of containers on a set of machines that are configured as worker nodes in a cluster.</p><ul><li>However, Kubernetes does not deploy containers directly on the worker nodes.</li><li>Rather, the containers are encapsulated into a Kubernetes object known as pods.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*7IC9agbDvmRE3zOQJPCFHQ.png" /></figure><p><strong><em>Question → </em></strong>What is a Pod ?</p><p><strong>Answer → </strong>A pod is a single instance of an application. A pod is the smallest object that you can create in Kubernetes.</p><p>==&gt; Here we see the simplest of simplest cases where you have a single node Kubernetes cluster with a single instance of your application running in a single Docker container encapsulated in a pod.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MqwWUvlS7VfALENRqp4LOg.png" /></figure><p><strong><em>==&gt; </em></strong>What if the number of users accessing your application increase and you need to scale your application?</p><p>==&gt; Solution is : you need to add additional instances of your web application to share the load. Now, where would you spin up additional instances?</p><ul><li>Do we bring up new container instance within the same pod? The answer is No.</li><li>We create new pod altogether with a new instance of the same application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YaOySxoN-gjxvQVvNBZJUQ.png" /></figure><p>As you can see in above diagram, we now have two instances of our web application running on two separate pods on the same Kubernetes system or Node.</p><p><strong><em>==&gt; </em></strong>What if the user base further increases and your current node has no sufficient capacity?</p><p>==&gt; Well then you can always deploy additional pods on a new node in the cluster. You will have a new node added to the cluster to expand the cluster’s physical capacity as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*O3UoJ9gdusnwuhROftnghw.png" /></figure><p>So what I’m trying to illustrate is that :-</p><ul><li>Pods usually have a 1 to 1 relationship with containers running your application to scale up.</li><li>You create new pods and to scale down you delete existing pods.</li><li>You do not add additional containers to an existing pod to scale your application.</li></ul><p><strong><em>Question → </em></strong>Are we restricted to having a single container in a single pod?</p><p><strong><em>Answer →</em></strong> No. A single pod can have multiple containers except for the fact that they’re usually not multiple containers of the same kind.</p><ul><li>There might be a scenario where you have a helper container that might be doing some kind of supporting task for our web application, such as processing a user entered data, processing a file uploaded by the user, etc.</li><li>And you want these helper containers to live alongside your application container?</li></ul><p>In that case, you can have both of these containers part of the same pod so that :-</p><ul><li>When a new application container is created, the helper is also created.</li><li>And when it dies, the helper also dies since they are part of the same pod.</li><li>The two containers can also communicate with each other directly by referring to each other as local host since they share the same network space <strong>Plus</strong> they can easily share the same storage space as well.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*RzxRavdFmOsoEGBAwOsQ9w.png" /></figure><p><strong><em>Question → </em></strong>Explain some important Kube commands ?</p><p><strong><em>1.) Starting the Kubernetes Server at our machine :-</em></strong> minikube start --driver=docker</p><ul><li>You asked Minikube to start a <strong>single-node Kubernetes cluster</strong> using <strong>Docker</strong> as the machine.</li><li>It pulled a lightweight base image (kicbase).</li><li>Created a <strong>Docker container</strong> acting as your Kubernetes <strong>control-plane</strong>.</li><li>Booted up Kubernetes 1.32.0 <strong>inside</strong> that Docker container.</li><li>It also <strong>configured </strong><strong>kubectl</strong> automatically to connect to your new cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H0Zk-sJF6hN8UV3d7OSHSg.png" /></figure><p><strong><em>2.) Checking the Status of Kubernetes Server :-</em></strong> minikube status</p><ul><li>You checked the status. Output says:</li><li>host: Running</li><li>kubelet: Running</li><li>apiserver: Running</li><li>kubeconfig: Configured</li></ul><p>==&gt; This means <strong>Minikube is successfully running a working K8s cluster</strong> inside Docker!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*jHPEKhtmdMULOx1oXAcsJw.png" /></figure><p><strong><em>3.) To see the Nodes of our K8S Cluster :-</em></strong> kubectl get nodes</p><ul><li>You asked Kubernetes to show the cluster’s nodes.</li><li>Output:</li><li>minikube — your single node.</li><li>STATUS = Ready</li></ul><p>==&gt; Your control-plane node is healthy and ready for workloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*tGHxexIoIZxFrKpe4K8UuQ.png" /></figure><p><strong><em>4.) To launch a new Pod containing Docker Container :-</em></strong> <strong><em>kubectl run nginx — image=nginx</em></strong> :-</p><ul><li>What this command really does is it deploys a Docker container by creating a pod. So, it first creates a pod automatically.</li><li>Inside this pod, it will run one container and then deploys an instance of the Nginx docker image. In this case, the Kubelet pulls the Nginx image from the Docker Hub Repository &amp; starts the container.</li><li>Docker Hub, as we discussed, is a public repository where latest Docker images of various applications are stored. You could configure Kubernetes to pull the image from the public Docker hub or a private repository within the organization.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*Q3_IdOcHY5DwSGQ48TUm2A.png" /></figure><p><strong><em>5.) </em></strong>Now that we have a pod created, how do we see the list of pods available? → kubectl get pods</p><ul><li>The kube control get Pods Command helps us see the list of pods in our cluster.</li><li>In this case, we see the pod is in a container creating state and soon changes to a running state when it is actually running.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sx214gYQK_N-SlffEpHpdg.png" /></figure><p><strong><em>6.) </em></strong>Now that we wanted to look into the details of this specific pod → kubectl describe pod &lt;POD_NAME&gt;</p><ul><li>We can see from below screenshot that, the Image being used to launch this pod is : “nginx”.</li><li>It’s current status is : “Running”.</li><li>We can also see the hierarchy of the Events, which shows the lifecycle of this Pod.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_FTZl_yT9zCfq4X9-ULhg.png" /></figure><p>Here is yet another example of one Pod, in which we have two different containers running :-</p><ul><li><strong>nginx → </strong>For this container, there is a Image from which it is being powered.</li><li><strong>agentx →</strong> For this container, it’s status is Waiting.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*km5bkjZsg8SS3lWtFF4khg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Muy72ROPodX4rb4q110pA.png" /></figure><p><strong><em>7.) </em></strong>Now that we wanted to see the Node, on which this particular Pod is running → kubectl get pods -o wide</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*geqobchy7pk8S7AnWoKalg.png" /></figure><p><strong><em>8.) </em></strong>Now that we wanted to delete a particular Pod → kubectl delete pod webapp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*S915xBIwf1NovbqNd3H_LA.png" /></figure><p><strong><em>Question → </em></strong>How do we launch a Pod in Kubernetes using the YAML file ?</p><p><strong>Answer → </strong>Here we have defined the configuration of a Pod :-</p><ul><li>Name of this Pod shall be “myapp-pod”.</li><li>Two labels have been given to it as shown below.</li><li>The value of <strong>kind </strong>is Pod.</li><li>Image being used to launch the container (inside the Pod) is : “<strong><em>nginx</em></strong>”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*gM146T5Xra70c9DutK7OeQ.png" /></figure><p><strong><em>Question → </em></strong>Show the way to generate the YAML file automatically in the Kubernetes ?</p><p><strong>Step #1.) </strong>First, we write this command to generate the YAML File : kubectl run redis — image=redis123 — dry-run=client -o yaml</p><ul><li>Name of this Pod shall be “<strong>redis</strong>”.</li><li>The container (inside this Pod) shall be started from the ImageName : “<strong>redis123</strong>”.</li><li>The kind of this resource is a POD.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*O9Ac-LWN3t15zNGRUiZ_-A.png" /></figure><p><strong>Step #2.)</strong> Now, we save this YAML file into a file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YPJl5aM2APck69yAQHiong.png" /></figure><p><strong>Step #3.)</strong> Now, we view the contents of this file and finally launch a Pod i.e. Create a Pod from this YAML File : kubectl create -f redis.yaml</p><ul><li>Since we intentionally supplied the incorrect ImageName, thats why we can see that, status of the Redis Pod is : “<strong>ErrImagePull</strong>”.</li><li>Pl see below, where we have fetched all the pods using command : kubectl create -f redis.yaml</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*bvTFjOgzHns7ZXOBsPXz0A.png" /></figure><p><strong>Step #4.)</strong> Let’s now go ahead and modify this file “<strong><em>redis.yaml</em></strong>” through VI Editor :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*HLc7AV_LS8P7eTG7j9ZW1A.png" /></figure><p><strong>Step #5.)</strong> Now, we again try to start the Pod from this YAML file : kubectl apply -f redis.yaml</p><ul><li>Finally we can see in below screenshot that, the “redis” pod has been successfully created.</li><li>Since, we already <strong>create </strong>the Pod earlier, but earlier command didn’t worked and therefore we are now doing the <strong>apply </strong>operation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XUZK0gG9eWB9nOuIF_Iaug.png" /></figure><p><strong><em>Question → </em></strong>Explain the concept of Replication-Controller ?</p><p><strong>Step #1.) </strong>If a particular POD dies OR is unhealthy, then our customers shall be suffering because of this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*xKJJkk7J7cvPZE7KOS1f-A.png" /></figure><p><strong>Step #2.) </strong>That’s where the concept of Replication-Controller comes into picture. It would automatically create a fresh &amp; healthy Pod, if existing Pod goes down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*8j9u3y72aw8rSpf5wnRNBQ.png" /></figure><p><strong>Step #3.) </strong>Say, the load on our application increases further more, then the Replication-Controller can help in scaling the Pods even further as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*DnwzEXISI6Bp-XosgwH7lw.png" /></figure><p>Note that, the concept of “<strong>Replication-Controller</strong>” &amp; “<strong><em>Replica-Set</em></strong>” are almost same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*sC_yvVDu6EYp9qPMNqGJyw.png" /></figure><p><strong><em>Question → </em></strong>Showcase the way of creating a ReplicaSet ?</p><ul><li>We specify the apiVersion here as : “<strong>apps/v1</strong>”.</li><li>We specify the <strong>kind </strong>as “<strong><em>ReplicaSet</em></strong>”.</li><li>We specify the <strong>replica </strong>as 3, which means that we shall have 3 pods inside this ReplicationController.</li><li>We specify the <strong>spec </strong>in which we specify the template of the Pod (the one that has to be created inside this ReplicaSet).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgVde7zdsVq5qCypsKsewA.png" /></figure><p>Please note that, the <strong>matchLabels </strong>are very important to be mentioned here, so that ReplicationController can manage/identify the Pods of same type through the help of these labels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbCoyugXtF29oTc82By7lw.png" /></figure><p>Hence, In our above example of creating a ReplicaSet, we shall be creating these 3 Pods and all of them shall be having the label as : “<strong>front-end</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPv5ytKDzxr2CC6lKApMOA.png" /></figure><p>Important commands used above are :-</p><ol><li>To create the ReplicationController → kubectl create -f rc-definition.yaml</li><li>To see the existing ReplicationControllers that exists → kubectl get replicationcontroller</li><li>To see the pods overall → kubectl get pods</li></ol><p><strong><em>Question → </em></strong>Say, we wanted to upscale the ReplicaSet, then how shall we do it ?</p><p><strong>Approach #1 → </strong>We first edit the YAML file as shown below and run the command : kubectl replace -f replicaset-definition.yaml</p><p><strong>Approach #2 → </strong>In case we dont wanted to modify the file, we can also upscale our ReplicaSet on the fly with this command : kubectl scale — replicas=6 -f replicaset-definition.yaml</p><p><strong>Approach #3 → </strong>We can also upscale our ReplicaSet on the fly with the help of the ReplicaSetName too: kubectl scale — replicas=6 -f myapp-replicaset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UC5MnsPz1XdYD_o1MxHIig.png" /></figure><p><strong><em>Question → </em></strong>Show another example of creating a ReplicaSet containing Nginx Pods ?</p><p><strong>Step #1 → </strong>Here is the definition of our <strong><em>replicaset.yaml </em></strong>file looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJWGcwYw7RIlCk13uxX_Wg.png" /></figure><p><strong>Step #2 → </strong>Here is how, we execute this file :- kubectl create -f replicaset.yaml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ur3t810Llycb2RuqVQyIug.png" /></figure><p><strong>Step #2 → </strong>Here is how, we can fetch the replicaset :- kubectl get replicaset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlmcttAfKrIEnoeT8Y_H8w.png" /></figure><p><strong>Step #3 → </strong>Under the hoods, this ReplicaSet created the 3 Pods and we can see the Pods as : kubectl get pods</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ay9Clwy4XS_VAOY3HP-m3A.png" /></figure><p><strong>Step #4 → </strong>We can also see the details of a particular ReplicaSet : kubectl describe replicaset &lt;NAME_OF_REPLICASET&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_G4saPD3ZOSzNpd5aMubDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Od6hLris0bAjzavXgw74fQ.png" /></figure><p><strong>Step #5 → </strong>Let’s now try to delete one of the Pod and we shall see the magic that, ReplicaSet automatically shall be creating a fresh new pod: kubectl delete pod &lt;POD_NAME&gt; Please note the names of the pods in below screenshot and above screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15BLxuYPYAr1inj9jNLOmA.png" /></figure><p><strong><em>Question → </em></strong>Now that, we have a ReplicaSet of 3 pods with label as (<strong>app: myapp</strong>) and say we launch the Pod independently and this Pod also have the label as (<strong>app: myapp</strong>), what shall happen ?</p><p><strong>Step #1 → </strong>Here is the definition of our YAML file with the help of which we shall a fresh Pod. Note that, so far we already have 3 pods running already.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXA_bcvcOIQw5vV4ED_HCQ.png" /></figure><p><strong>Step #2 →</strong> If we see the Pods now, we would still see the 3 pods only, because the ReplicaSet shall be terminating this 4th pod, even if it is running independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XpHOmOuqCLIpff59jQuLyg.png" /></figure><p>And finally we can see that, we have 3 pods running :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEvirCStX0ipak8Qvc-uWQ.png" /></figure><p><strong><em>Summarise the commands learned so far :-</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uWPAKo6qM79k3lxzl100qQ.png" /></figure><p>That’s all in this Blog. We shall see you in another blog with some other concepts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa4f611d72b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache ATLAS || Part-6]]></title>
            <link>https://adityagoel123.medium.com/apache-atlas-part-6-346b289ea811?source=rss-604be50c4ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/346b289ea811</guid>
            <category><![CDATA[apache-atlas]]></category>
            <dc:creator><![CDATA[aditya goel]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 08:52:15 GMT</pubDate>
            <atom:updated>2025-04-21T08:52:15.764Z</atom:updated>
            <content:encoded><![CDATA[<p>If you landed at this page directly, it is recommended to go through this <a href="https://adityagoel123.medium.com/apache-atlas-part-3-1751bfa81cfb">link first</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4ZQvmBMi8dC_zzOz.png" /></figure><h3>Conceptual Time</h3><p><strong><em>Question →</em></strong> What is Glossary in Apache-ATLAS ?</p><p><strong><em>Answer → </em></strong>It basically associates the business meaning to the Entities in the ATLAS.</p><p><strong><em>Question → </em></strong>Show, what is Glossary in general sense ?</p><p><strong><em>In the General Sense: “Glossary” → </em></strong>A <strong>glossary</strong> is a list of terms and their definitions — like a dictionary, but usually specific to a domain. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*mjz5ytO483ViSlY8k38TPA.png" /></figure><p>A <strong>glossary</strong> helps people across teams, projects, and companies understand the same meaning for business terms. It avoids confusion and ensures consistency. See this is how, a sample glossary looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Luo9tO1-_oyOa55WXfDmGQ.png" /></figure><p><strong><em>In Apache Atlas: “Glossary” → </em></strong>A <strong>Glossary</strong> in Atlas is a formal way to capture and manage <strong>business vocabulary</strong> in your Data Catalog. It lets you define:</p><ul><li><strong>Terms</strong> (example: Customer, Order, Revenue)</li><li><strong>Categories</strong> (grouping of terms)</li><li><strong>Relationships</strong> (link terms to data assets like Tables, Columns, Files).</li></ul><p>Example in Atlas:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0kp4qrbuA8YqsA_7_uQhIw.png" /></figure><h3>Demo Time</h3><h4>Glossary</h4><p><strong><em>Step #1.) </em></strong>We create the Glossary with the name as “User” from the ATLAS-UI :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EOSVopM0nF-37ilLr4-pkQ.png" /></figure><p>This is how it looks like, after it is created :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQ5nyCR3N568cO58ll58Uw.png" /></figure><h4>Category</h4><p><strong><em>Step #2.) </em></strong>Inside the Glossary, we can now create the Category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-VyI1U0LpxgQ9QoT3Bhaug.png" /></figure><p>We wanted to create a Category named “<strong><em>Customer</em></strong>” inside this particular Glossary :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gq69oDps0TMSZ2E_-c-7uw.png" /></figure><p>Let’s create another Category named “Seller” inside this same Glossary named “User” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJPi7wEXVbh9_8440kW9tw.png" /></figure><p><strong><em>Step #3.) </em></strong>Inside a particular Category, we can also create the sub-categories too, but we shall not create any sub-category for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7J3t1_OOwQvSGX7luiIFEQ.png" /></figure><p><strong><em>Step #4.) </em></strong>Let’s now create another Glossary as well with name as : “Sales” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5Qryjfe3RebV5eqqF6c7g.png" /></figure><h4>Term</h4><p><strong><em>Step #5.) </em></strong>Now, we can also create the Terms, inside a particular Glossary :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJFR3VPJo5irq8PuYktHCw.png" /></figure><p><strong><em>Step #6.) </em></strong>We create a Term named as “CustomerName” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3g79MpIatu6HPlW973vlg.png" /></figure><p>After the Term is successfully created, here is how it looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnzvnSeMKmcWWnYn9Weegg.png" /></figure><h4>Assigning Category to the Term</h4><p><strong><em>Step #7.) </em></strong>We can now associate the category (<strong><em>Customer</em></strong>) to the term (<strong><em>CustomerName</em></strong>) as well :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0SKRhH9Ur6DMXzVa1IAMFA.png" /></figure><p>After the category is being associated to the Term, here is how it looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkHJxDoRVxyubcEYiXAfiQ.png" /></figure><h4>Adding Classification to the Term</h4><p><strong><em>Step #8.) </em></strong>We can also associate the Classification (<strong><em>CustomerPII</em></strong>) to the term (<strong><em>CustomerName</em></strong>) as well. Note below that, we have chosen the type of classification as “<strong><em>Propagate</em></strong>” which means that, this classification shall be propagated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hb8KxxF9Si1etbUuRkDJ0g.png" /></figure><p>After the classification is being attached to the Term, here is how it looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xG6mPelw55FjjUKNIzQU5w.png" /></figure><p>Let’s also associate one more Classification (“<strong><em>Dimension</em></strong>”) to this Term (“<strong><em>CustomerName</em></strong>”) but this would not be propagated :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wJBjw4fUoZhJfoun6u-hA.png" /></figure><p>After this specific classification is being attached to this Term, here is how it looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uIRq45Q9NzP83TVXKidyGg.png" /></figure><h4>Adding Terms to the Entities</h4><p><strong><em>Step #9.) </em></strong>We shall now associate the Term to the existing Entities in our system.</p><ul><li>Here, the “<strong><em>name</em></strong>” is one entity (i.e. Instance i.e. Object) of the Type: Column, that exists in our system.</li><li>We shall associate the Term to this Column.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffNOpsEj-tJRTbTkXqpozQ.png" /></figure><p>So far, we have only one Term named “<strong><em>CustomerName</em></strong>” and let’s associate this term to the afore-shown entity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7ltIHB3mXZekn2anLwuFw.png" /></figure><p>Once this term (<strong><em>CustomerName</em></strong>) is assigned successfully to this Entity (<strong><em>name</em></strong>) :-</p><ul><li>Below is how the view of the entity looks like.</li><li>Also note that, this entity have also got a propagated-classification with name as “<strong><em>CustomerPII</em></strong>”. Visit to Step #8 where we associated the classification (<strong><em>CustomerPII</em></strong>) with the Term (<strong><em>CustomerName</em></strong>).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FAAWJhHyG5MLMq2nOCJFSQ.png" /></figure><h4>Ease of Search for this Entity</h4><p><strong><em>Step #10.) </em></strong>Now that, the classification (<strong><em>CustomerPII</em></strong>) exists with this entity (<strong><em>name</em></strong>), therefore it is quite easy to search from the ATLAS-UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1PINOsDP47FLDOlRnJxN0A.png" /></figure><h4>Additional Term</h4><p><strong><em>Step #11.) </em></strong>Now, let’s create a new additional Term, this time, inside the “<strong><em>Sales</em></strong>” Glossary :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*4Kqw36m-a3CdzJrxWphGCg.png" /></figure><p><strong><em>Step #12.) </em></strong>We create a Term named as “<strong><em>salesPrice</em></strong>” :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qSLIailQ149WUGJeNsbIA.png" /></figure><p>After the Term is successfully created, here is how it looks like :-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oA6xTMtFq9wYUaUXOKh-tA.png" /></figure><p>That’s all about the glossary in this blog that we wanted to show. If you liked reading it, please do clap on it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=346b289ea811" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>