<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/azure/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 21 May 2025 16:22:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Azure &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Linux Azure Function Isolated Dot Net 9 YAML Template Deployment</title>
		<link>https://sibeeshpassion.com/linux-azure-function-isolated-dot-net-9-yaml-template-deployment/</link>
					<comments>https://sibeeshpassion.com/linux-azure-function-isolated-dot-net-9-yaml-template-deployment/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 27 Apr 2025 11:05:56 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Function]]></category>
		<category><![CDATA[azure function release pipeline]]></category>
		<category><![CDATA[azure function worker process]]></category>
		<category><![CDATA[azure function yaml template and release]]></category>
		<category><![CDATA[dot net 9]]></category>
		<category><![CDATA[dotnet-isolated]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14697</guid>

					<description><![CDATA[Introduction In this post, let&#8217;s see how we can deploy a dot net 9 isolated runtime model project to a Linux based Azure function. Prerequisites Creating the hosting plan It is not mandatory to create a hosting plan, as the resource will be auto created when you create the function, however it is recommended to create one as you can define your naming strategies and more controls. Here we are choosing the consumption plan. You can learn more about the hosting options Azure provides here. Below is the ARM template to create the consumption hosting plan. Creating the Azure function [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading">Introduction</h1>



<p>In this post, let&#8217;s see how we can deploy a dot net 9 isolated runtime model project to a Linux based Azure function.</p>



<h1 class="wp-block-heading"><strong>Prerequisites</strong></h1>



<h2 class="wp-block-heading"><strong>Creating the hosting plan</strong></h2>



<p>It is not mandatory to create a hosting plan, as the resource will be auto created when you create the function, however it is recommended to create one as you can define your naming strategies and more controls. Here we are choosing the consumption plan. You can learn more about the hosting options Azure provides <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale">here</a>. Below is the ARM template to create the consumption hosting plan.</p>



<pre class="wp-block-code"><code>{
    "type": "Microsoft.Web/serverfarms",
    "apiVersion": "2024-04-01",
    "name": "&#91;parameters('funcAppServerFarmName')]",
    "location": "&#91;parameters('funcAppLocation')]",
    "kind": "functionapp",
    "sku": {
        "name": "Y1",
        "tier": "Dynamic"
    },
    "properties": {
        "computeMode": "Dynamic",
        "reserved": true
    }
}</code></pre>



<p><strong>Creating the Azure function</strong></p>



<p>Below is the ARM template to create the Azure function.</p>



<pre class="wp-block-code"><code>{
    "type": "Microsoft.Web/sites",
    "apiVersion": "2024-04-01",
    "name": "&#91;parameters('FuncName')]",
    "location": "&#91;parameters('funcAppLocation')]",
    "kind": "functionapp,linux",
    "identity": {
        "type": "SystemAssigned"
    },
    "properties": {
        "reserved": true,
        "alwaysOn": true,
        "serverFarmId": "&#91;resourceId('Microsoft.Web/serverfarms', parameters('funcAppServerFarmName'))]",
        "linuxFxVersion": "DOTNET-ISOLATED|9.0",
        "siteConfig": {
            "linuxFxVersion": "DOTNET-ISOLATED|9.0",
            "appSettings": &#91;
                {
                    "name": "AzureWebJobsStorage",
                    "value": "&#91;format('DefaultEndpointsProtocol=https;AccountName={0};EndpointSuffix={1};AccountKey={2}', parameters('StorageName'), environment().suffixes.storage, listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('StorageName')), '2022-05-01').keys&#91;0].value)]"
                },
                {
                    "name": "APPINSIGHTS_INSTRUMENTATIONKEY",
                    "value": "&#91;reference(resourceId('Microsoft.Insights/components', parameters('InsightsComponentName')), '2020-02-02').InstrumentationKey]"
                },
                {
                    "name": "FUNCTIONS_EXTENSION_VERSION",
                    "value": "~4"
                },
                {
                    "name": "FUNCTIONS_WORKER_RUNTIME",
                    "value": "dotnet-isolated"
                },
                {
                    "name": "linuxFxVersion",
                    "value": "DOTNET-ISOLATED|9.0"
                },
                {
                    "name": "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED",
                    "value": "1"
                },
                {
                    "name": "CosmosConnectionString",
                    "value": "&#91;concat('@Microsoft.KeyVault(SecretUri=', 'https://',parameters('KeyVaultName'),'.vault.azure.net/secrets/CosmosConnectionString)')]"
                }
            ],
            "minTlsVersion": "1.3"
        },
        "runtime": {
            "name": "dotnet-isolated"
        },
        "httpsOnly": true
    },
    "dependsOn": &#91;
        "&#91;resourceId('Microsoft.Insights/components', parameters('InsightsComponentName'))]",
        "&#91;resourceId('Microsoft.Web/serverfarms', parameters('funcAppServerFarmName'))]",
        "&#91;resourceId('Microsoft.Storage/storageAccounts', parameters('StorageName'))]"
    ]
}</code></pre>



<p>Please make sure to set the values linuxFxVersion, WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED or you may get the error below when you deploy your code to the Azure function.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>Failed to sync triggers for function app &#8216;funcsintest03&#8217;. Error: BadRequest &#8211; Encountered an error (BadGateway) from host runtime. (CODE: 400)</em></p>
</blockquote>



<p>I have a detailed post on the error <a href="https://stackoverflow.com/a/79594377/5550507">here on Stack Overflow</a>. Here is a doc on <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-infrastructure-as-code?pivots=consumption-plan&amp;tabs=json%2Clinux%2Cdevops">Automate resource deployment for your function app in Azure Functions</a>.</p>



<h1 class="wp-block-heading">Create Azure function application</h1>



<p>You can easily create the Azure function using the <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio">Visual Studio by following this post</a>. Please be noted that for my Azure function I am choosing my function to run in an isolated worker process to get the benefits like standard dependency injection, you can read more on this <a href="https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Clinux">here</a>.</p>



<h1 class="wp-block-heading">Create the Azure DevOps pipelines</h1>



<p>Before we create the pipelines, let’s create the template YAML with the file name as func-template.yml so that we can use it for all of our environments like Dev, Test, Prod etc.</p>



<pre class="wp-block-code"><code>parameters:
  - name: azureSubscriptionServiceConnection
    type: string
  - name: functionAppName
    type: string
  - name: stageName
    type: string

stages:
  - stage: ${{ parameters.stageName }}_Stage
    displayName: Release stage ${{ parameters.stageName }}
    jobs:
      - job: ${{ parameters.stageName }}_Release
        displayName: ${{ parameters.stageName }}_Release
        pool:
          vmImage: "ubuntu-latest"
        steps:
          # Download an artifact named 'WebApp' to 'bin' in $(Build.SourcesDirectory)
          - task: DownloadPipelineArtifact@2
            inputs:
              artifactName: "drop"
              targetPath: $(Build.SourcesDirectory)/bin
          - task: AzureFunctionApp@2 # Add this at the end of your file
            inputs:
              azureSubscription: ${{ parameters.azureSubscriptionServiceConnection }}
              appType: functionAppLinux # This specifies a Linux-based function app
              #isFlexConsumption: true # Uncomment this line if you are deploying to a Flex Consumption app
              appName: ${{ parameters.functionAppName }}
              package: $(Build.SourcesDirectory)/bin/*.zip
              deploymentMethod: "zipDeploy" # 'auto' | 'zipDeploy' | 'runFromPackage'. Required. Deployment method. Default: auto.
              #Uncomment the next lines to deploy to a deployment slot
              #Note that deployment slots is not supported for Linux Dynamic SKU
              #deployToSlotOrASE: true
              #resourceGroupName: '&lt;RESOURCE_GROUP>'
              #slotName: '&lt;SLOT_NAME>'
              runtimeStack: 'DOTNET-ISOLATED|9.0'
</code></pre>



<p>Here we use the task AzureFunctionApp@2 task, you can learn more about that task <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-function-app-v2?view=azure-pipelines">here</a>. Next, create a YAML file func-template.yml with the contents below.</p>



<pre class="wp-block-code"><code>trigger:
  - main
stages:
  - stage: Build
    displayName: Build and push stage
    jobs:
      - job: Build
        displayName: Build
        pool:
          vmImage: "ubuntu-latest"
        steps:
          - task: UseDotNet@2
            inputs:
              packageType: "sdk"
              version: "9.0.x" # .NET 9 preview/stable depending on your needs
              installationPath: $(Agent.ToolsDirectory)/dotnet
          - checkout: self
          - script: |
              dotnet restore
              dotnet build --configuration Release
          - task: DotNetCoreCLI@2
            inputs:
              command: publish
              arguments: "--configuration Release --output publish_output"
              projects: "$(System.DefaultWorkingDirectory)/MyFunc.Func/MyFunc.Func.csproj"
              publishWebProjects: false
              modifyOutputPath: false
              zipAfterPublish: false
          - task: ArchiveFiles@2
            displayName: "Archive files"
            inputs:
              rootFolderOrFile: "$(System.DefaultWorkingDirectory)/publish_output"
              includeRootFolder: false
              archiveFile: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
          - task: PublishBuildArtifacts@1
            inputs:
              PathtoPublish: "$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip"
              artifactName: "drop"

  - template: func-template.yml
    parameters:
      azureSubscriptionServiceConnection: "MyFuncdevmi"
      functionAppName: "MyFuncfuncsindev03"
      stageName: "DEV"
  - template: func-template.yml
    parameters:
      azureSubscriptionServiceConnection: "MyFunctestmi"
      functionAppName: "MyFuncfuncsintest03"
      stageName: "TEST"
</code></pre>



<p>In the above YAML file, my function project name is MyFunc and I am using the MyFuncdevmi as the service connection to deploy the Azure function to the DEV environment MyFuncfuncsindev03 and MyFunctestmi to deploy to my TEST environment MyFuncfuncsintest03.</p>



<p>I am using managed identity to create those service connection. You can create a managed identity using the ARM template below.</p>



<pre class="wp-block-code"><code>{
    "type": "Microsoft.ManagedIdentity/userAssignedIdentities",
    "apiVersion": "2024-11-30",
    "name": "&#91;parameters('managedIdentityName')]",
    "location": "&#91;parameters('location')]",
    "tags": {
        "{customized property}": "string"
    }
}&nbsp; &nbsp; &nbsp;</code></pre>



<p>You can follow this doc to create the <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/library/connect-to-azure?view=azure-devops">service connection using the managed identity</a>.</p>



<h1 class="wp-block-heading">Create the pipeline using the YAMLs created</h1>



<p>Go to the Pipeline menu and click on New pipeline button. Select your Azure DevOps repository and click on the option Existing Azure Pipelines YAML file. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/04/image.png"><img fetchpriority="high" decoding="async" width="1024" height="434" src="/wp-content/uploads/2025/04/image-1024x434.png" alt="" class="wp-image-14699" srcset="/wp-content/uploads/2025/04/image-1024x434.png 1024w, /wp-content/uploads/2025/04/image-300x127.png 300w, /wp-content/uploads/2025/04/image-768x325.png 768w, /wp-content/uploads/2025/04/image-1536x651.png 1536w, /wp-content/uploads/2025/04/image-2048x867.png 2048w, /wp-content/uploads/2025/04/image-400x169.png 400w, /wp-content/uploads/2025/04/image-1417x600.png 1417w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Choose the path to your release pipeline YAML file, not the template YAML file, and run your pipeline. If your pipeline is successful, you should be able to see the output as below.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/04/image-3.png"><img decoding="async" width="1024" height="364" src="/wp-content/uploads/2025/04/image-3-1024x364.png" alt="" class="wp-image-14704" srcset="/wp-content/uploads/2025/04/image-3-1024x364.png 1024w, /wp-content/uploads/2025/04/image-3-300x107.png 300w, /wp-content/uploads/2025/04/image-3-768x273.png 768w, /wp-content/uploads/2025/04/image-3-1536x546.png 1536w, /wp-content/uploads/2025/04/image-3-2048x728.png 2048w, /wp-content/uploads/2025/04/image-3-400x142.png 400w, /wp-content/uploads/2025/04/image-3-1689x600.png 1689w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/04/image-1.png"><img decoding="async" width="1024" height="270" src="/wp-content/uploads/2025/04/image-1-1024x270.png" alt="" class="wp-image-14700" srcset="/wp-content/uploads/2025/04/image-1-1024x270.png 1024w, /wp-content/uploads/2025/04/image-1-300x79.png 300w, /wp-content/uploads/2025/04/image-1-768x202.png 768w, /wp-content/uploads/2025/04/image-1-1536x404.png 1536w, /wp-content/uploads/2025/04/image-1-2048x539.png 2048w, /wp-content/uploads/2025/04/image-1-400x105.png 400w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<h1 class="wp-block-heading">Conclusion</h1>



<p>In this post we have learned how to,</p>



<ul class="wp-block-list">
<li>create the Azure function and consumption hosting plan with dotnet isolated worker process</li>



<li>create the temple for the deploying the Azure function</li>



<li>create the release YAML using the template file</li>
</ul>



<h1 class="wp-block-heading">About the Author</h1>



<p>I am yet another developer who is passionate about writing and sharing knowledge. I have written more than 500 blogs on my&nbsp;<a rel="noreferrer noopener" href="https://sibeeshpassion.com/" target="_blank">blog</a>. If you like this content, consider following me here,</p>



<ul class="wp-block-list">
<li><a href="https://github.com/SibeeshVenu">GitHub</a></li>



<li><a href="https://medium.com/@sibeeshvenu">medium</a></li>



<li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li>
</ul>



<h1 class="wp-block-heading">Your turn. What do you think?</h1>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/linux-azure-function-isolated-dot-net-9-yaml-template-deployment/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Build, Deploy, Configure CI &#038;CD Your Static Website in 5 mins</title>
		<link>https://sibeeshpassion.com/build-deploy-configure-ci-cd-your-static-website-in-5-mins/</link>
					<comments>https://sibeeshpassion.com/build-deploy-configure-ci-cd-your-static-website-in-5-mins/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 30 Mar 2025 11:11:50 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[azure static web app]]></category>
		<category><![CDATA[azure static web app custom domain configuration]]></category>
		<category><![CDATA[azure static web app deployment pipeline yaml]]></category>
		<category><![CDATA[azure static web app with azure devops]]></category>
		<category><![CDATA[azure swa]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14675</guid>

					<description><![CDATA[If you have a static website that has contents like HTML, CSS and images and you would like to host them, you can do that in 5 mins with the help of Azure Static Web Apps. Some of the key benefits of static web app are globally distributed content without the need of CDN, free auto-rotated SSL certificate, API support with Azure function. Here in this post we will see how we can create, build, deploy the Azure Static Web app. Prerequisites Create Azure Static Web App Go to the Azure portal and select the static web app. Under the [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>If you have a static website that has contents like HTML, CSS and images and you would like to host them, you can do that in 5 mins with the help of Azure Static Web Apps. Some of the key benefits of static web app are globally distributed content without the need of CDN, free auto-rotated SSL certificate, API support with Azure function. Here in this post we will see how we can create, build, deploy the Azure Static Web app. </p>



<p></p>



<h1 class="wp-block-heading">Prerequisites</h1>



<ol class="wp-block-list">
<li>You must have a repository that has your static files</li>



<li>You must have access to Azure portal</li>
</ol>



<h1 class="wp-block-heading">Create Azure Static Web App</h1>



<p>Go to the Azure portal and select the static web app. Under the deployment settings, make sure you select the Azure devops repository where the static files are pushed. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-19.png"><img decoding="async" width="1024" height="595" src="/wp-content/uploads/2025/03/image-19-1024x595.png" alt="" class="wp-image-14677" srcset="/wp-content/uploads/2025/03/image-19-1024x595.png 1024w, /wp-content/uploads/2025/03/image-19-300x174.png 300w, /wp-content/uploads/2025/03/image-19-768x446.png 768w, /wp-content/uploads/2025/03/image-19-1536x892.png 1536w, /wp-content/uploads/2025/03/image-19-2048x1190.png 2048w, /wp-content/uploads/2025/03/image-19-400x232.png 400w, /wp-content/uploads/2025/03/image-19-1033x600.png 1033w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>For the build preset, select one that suits your project, here I am selecting HTML. The app artefact location or output location is based on the preset that you select. For HTML it is &#8220;/&#8221;, you can learn more on that <a href="https://learn.microsoft.com/en-us/azure/static-web-apps/front-end-frameworks">here</a>. </p>



<p>When you click on the Review + Create button on the portal, the build and release pipeline will be created with YAML file that you can edit later.</p>



<p>You may get the error below when you click the Create button. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Failed to create a Personal Access Token for this user in Azure DevOps. Please deploy your app using the &#8216;Other&#8217; deployment source instead of &#8216;Azure DevOps&#8217;. After the app is created, open it and follow the instructions to get the token and deploy your app.</p>
</blockquote>



<p>If that happens, as the error suggested, select the deployment source as Other and proceed. We will need to configure the deployment once the app is created.</p>



<p>You can also create the static web app using the ARM template, Bicep or Terraform. Read about that <a href="https://learn.microsoft.com/en-us/azure/templates/microsoft.web/staticsites?pivots=deployment-language-arm-template">here</a> and <a href="https://learn.microsoft.com/en-us/azure/static-web-apps/publish-azure-resource-manager?tabs=azure-cli">here</a>. </p>



<h1 class="wp-block-heading">Configure CI &amp; CD deployment</h1>



<p>Once the app is created, you can go to the URLs given for your app and you should see a start page as below. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-20.jpg"><img decoding="async" width="1024" height="691" src="/wp-content/uploads/2025/03/image-20-1024x691.jpg" alt="" class="wp-image-14678" srcset="/wp-content/uploads/2025/03/image-20-1024x691.jpg 1024w, /wp-content/uploads/2025/03/image-20-300x202.jpg 300w, /wp-content/uploads/2025/03/image-20-768x518.jpg 768w, /wp-content/uploads/2025/03/image-20-1536x1036.jpg 1536w, /wp-content/uploads/2025/03/image-20-2048x1382.jpg 2048w, /wp-content/uploads/2025/03/image-20-400x270.jpg 400w, /wp-content/uploads/2025/03/image-20-889x600.jpg 889w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Click on the Manage Deployment Token button under the overview pane and copy the deployment token. We will be setting this value as a secret in our pipeline later.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-20.png"><img decoding="async" width="1024" height="120" src="/wp-content/uploads/2025/03/image-20-1024x120.png" alt="" class="wp-image-14680" srcset="/wp-content/uploads/2025/03/image-20-1024x120.png 1024w, /wp-content/uploads/2025/03/image-20-300x35.png 300w, /wp-content/uploads/2025/03/image-20-768x90.png 768w, /wp-content/uploads/2025/03/image-20-1536x180.png 1536w, /wp-content/uploads/2025/03/image-20-2048x240.png 2048w, /wp-content/uploads/2025/03/image-20-400x47.png 400w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Go to your Auzre DevOps and click on the Pipelines. Click on the New pipleline and select your repository from Azure DevOps. In the configure tab, select Starter pipeline. Replace the content with the below codes. </p>



<p><a href="https://gist.github.com/SibeeshVenu/1c9eeb3a54ebb4bc6a240de46e1e4f61">https://gist.github.com/SibeeshVenu/1c9eeb3a54ebb4bc6a240de46e1e4f61</a></p>



<pre class="wp-block-code"><code>trigger:
  - main

pool:
  vmImage: ubuntu-latest

steps:
  - checkout: self
    submodules: true
  - task: AzureStaticWebApp@0
    inputs:
      app_location: '/' # App source code path relative to cwd
      # api_location: 'api' # Api source code path relative to cwd
      # output_location: 'public' # Built app content directory relative to app_location - optional
      # cwd: '$(System.DefaultWorkingDirectory)/myapp' # Working directory - optional
      azure_static_web_apps_api_token: $(deployment_token)</code></pre>



<p>Click Save and run, the pipeline will fail for the first time as we have not set the deployment_token varible in the pipeline yet. Go to the created pipeline and click on Edit, click on Variables and then click New variable. Set the variable name as deployment_token and paste the deloyment token we copied as the value. Remember to set the value as secret. There are many ways to set the secret for your pipelines, you can read about those <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables?view=azure-devops&amp;tabs=yaml%2Cbash">here</a> and <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&amp;tabs=yaml%2Cbatch">here</a>.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-21.png"><img decoding="async" width="802" height="1024" src="/wp-content/uploads/2025/03/image-21-802x1024.png" alt="" class="wp-image-14681" srcset="/wp-content/uploads/2025/03/image-21-802x1024.png 802w, /wp-content/uploads/2025/03/image-21-235x300.png 235w, /wp-content/uploads/2025/03/image-21-768x981.png 768w, /wp-content/uploads/2025/03/image-21-1203x1536.png 1203w, /wp-content/uploads/2025/03/image-21-400x511.png 400w, /wp-content/uploads/2025/03/image-21-470x600.png 470w, /wp-content/uploads/2025/03/image-21.png 1361w" sizes="(max-width: 802px) 100vw, 802px" /></a></figure>



<p>Run your pipeline again. This time, the pipeline should be successful and you should be able to load your Static web app with your contents now.</p>



<h1 class="wp-block-heading">Configure Custom Domain</h1>



<p>Goto your Static web app and then click on the Add a custom domain tile.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-22.png"><img decoding="async" width="1024" height="302" src="/wp-content/uploads/2025/03/image-22-1024x302.png" alt="" class="wp-image-14682" srcset="/wp-content/uploads/2025/03/image-22-1024x302.png 1024w, /wp-content/uploads/2025/03/image-22-300x89.png 300w, /wp-content/uploads/2025/03/image-22-768x227.png 768w, /wp-content/uploads/2025/03/image-22-1536x454.png 1536w, /wp-content/uploads/2025/03/image-22-400x118.png 400w, /wp-content/uploads/2025/03/image-22.png 1957w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Select the appropriate option as per your needs. I am selecting Custom domain on other DNS.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-23.png"><img decoding="async" width="1024" height="428" src="/wp-content/uploads/2025/03/image-23-1024x428.png" alt="" class="wp-image-14683" srcset="/wp-content/uploads/2025/03/image-23-1024x428.png 1024w, /wp-content/uploads/2025/03/image-23-300x125.png 300w, /wp-content/uploads/2025/03/image-23-768x321.png 768w, /wp-content/uploads/2025/03/image-23-1536x642.png 1536w, /wp-content/uploads/2025/03/image-23-400x167.png 400w, /wp-content/uploads/2025/03/image-23-1436x600.png 1436w, /wp-content/uploads/2025/03/image-23.png 1797w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Enter the domain and select the Hostname record type, here I am selecting CNAME.</p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2025/03/image-25.png"><img decoding="async" width="1024" height="527" src="/wp-content/uploads/2025/03/image-25-1024x527.png" alt="" class="wp-image-14686" srcset="/wp-content/uploads/2025/03/image-25-1024x527.png 1024w, /wp-content/uploads/2025/03/image-25-300x154.png 300w, /wp-content/uploads/2025/03/image-25-768x395.png 768w, /wp-content/uploads/2025/03/image-25-1536x790.png 1536w, /wp-content/uploads/2025/03/image-25-400x206.png 400w, /wp-content/uploads/2025/03/image-25-1167x600.png 1167w, /wp-content/uploads/2025/03/image-25.png 1674w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>If you give the domain without www in it, you may get the below error. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Request Envelope is invalid. Apex Domains must use dns-txt-token as the ValidationMethod.</p>
</blockquote>



<p>You can learn more about the custom domain <a href="https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain">here</a>. Copy the CNAME hostname record and add it to your DNS provider to confirm your domain ownership. It can take up to 48 or 72 hours for DNS entry changes to take effect. Once that period is over, you can come here and try to add the custom domain again. Once it is added you should see a Status as &#8220;Validated&#8221;. </p>



<p>If you want to add the custom domain without &#8220;www&#8221; in it, then you must add a TXT record with the host as &#8220;@&#8221; and value as the code generated in the static web app&#8217;s custom domain section in your domains DNS configuration. You can learn more <a href="https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain?wt.mc_id=azurestaticwebapps_inline_inproduct_general">here</a>.</p>



<p></p>



<h1 class="wp-block-heading">Learn More</h1>



<p>You can learn more about the Static Web App from the tutorials below.</p>



<ol class="wp-block-list">
<li><a href="https://devblogs.microsoft.com/devops/comparing-azure-static-web-apps-vs-azure-webapps-vs-azure-blob-storage-static-sites/">Comparing Azure Static Web Apps vs Azure WebApps vs Azure Blob Storage Static Sites</a></li>



<li><a href="https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?pivots=azure-devops&amp;tabs=vanilla-javascript">Quickstart: Build your first static web app</a></li>



<li><a href="https://azure.microsoft.com/en-us/pricing/details/app-service/static/#overview">Static Web Apps pricing</a></li>
</ol>



<h1 class="wp-block-heading">Conclusion</h1>



<p>In this post we have seen how easily we can creat an Azure static web app, how to deploy or configure CI &amp; CD with your new static web app, and how to configure the custom domain name to your static web app.</p>



<h1 class="wp-block-heading">About the Author</h1>



<p>I am yet another developer who is passionate about writing and sharing knowledge. I have written more than 500 blogs on my&nbsp;<a rel="noreferrer noopener" href="https://sibeeshpassion.com/" target="_blank">blog</a>. If you like this content, consider following me here,</p>



<ul class="wp-block-list">
<li><a href="https://github.com/SibeeshVenu">GitHub</a></li>



<li><a href="https://medium.com/@sibeeshvenu">medium</a></li>



<li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li>
</ul>



<h1 class="wp-block-heading">Your turn. What do you think?</h1>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/build-deploy-configure-ci-cd-your-static-website-in-5-mins/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Post Messages to Microsoft Teams Using Python</title>
		<link>https://sibeeshpassion.com/post-messages-to-microsoft-teams-using-python/</link>
					<comments>https://sibeeshpassion.com/post-messages-to-microsoft-teams-using-python/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 01 Oct 2022 14:34:39 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Key Vault]]></category>
		<category><![CDATA[Microsoft teams]]></category>
		<category><![CDATA[Microsoft Teams Webhook with Python]]></category>
		<category><![CDATA[Send message to Microsoft Teams]]></category>
		<category><![CDATA[Teams Python Client]]></category>
		<category><![CDATA[Teams Webhook]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14592</guid>

					<description><![CDATA[Most of us uses Microsoft Teams on a daily basis, and we post a lot of messages, chats, contents to the platform. However there are times that you may need to post these contents automatically. Here in this post, we will see how we can post content to channel in Microsoft Teams using Python. Let's get started. ]]></description>
										<content:encoded><![CDATA[
<p>Most of us uses Microsoft Teams on a daily basis, and we post a lot of messages, chats, contents to the platform. However there are times that you may need to post these contents automatically. Here in this post, we will see how we can post content to channel in Microsoft Teams using Python. Let&#8217;s get started. </p>



<h1 class="wp-block-heading">Prerequisites</h1>



<ol class="wp-block-list"><li>You will need Python installed on your machine</li><li>You will need to create a Team and a channel in the Team</li></ol>



<h1 class="wp-block-heading">Setting up a channel</h1>



<h2 class="wp-block-heading">Creating a channel</h2>



<p>You will need to <a rel="noreferrer noopener" href="https://support.microsoft.com/en-us/office/create-a-team-from-scratch-174adf5f-846b-4780-b765-de1a0a737e2b" target="_blank">set up Teams before</a> you create a channel, and if you have enough access, it is an easy thing to do. Once the Team is ready to use, you can either use one of the existing channel, or create a new one from the context menu. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="/wp-content/uploads/2022/10/image.png"><img decoding="async" width="303" height="509" src="/wp-content/uploads/2022/10/image.png" alt="" class="wp-image-14594" srcset="/wp-content/uploads/2022/10/image.png 303w, /wp-content/uploads/2022/10/image-179x300.png 179w" sizes="(max-width: 303px) 100vw, 303px" /></a><figcaption>Teams Context Menu</figcaption></figure>
</div>


<h2 class="wp-block-heading">Setting up the connector</h2>



<p>When you have decided which channel to use, click on the three dot on the right-side of your channel name, and then click on the Connectors and then search for the connector &#8220;Incoming Webhook&#8221; and then click on the button &#8220;Add&#8221;. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>The above process might take a few minutes. If you are unable to perform this, you can try using <a href="https://teams.microsoft.com/" target="_blank" rel="noreferrer noopener">the web version of Microsoft Teams</a>.</p><cite>Use of web verstion of Microsoft Teams</cite></blockquote>



<p>The above step will add the connector to your Teams, so that you can start configuring your Webhook. Click on the Configure button.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="/wp-content/uploads/2022/10/image-1.png"><img decoding="async" width="1024" height="196" src="/wp-content/uploads/2022/10/image-1-1024x196.png" alt="" class="wp-image-14595" srcset="/wp-content/uploads/2022/10/image-1-1024x196.png 1024w, /wp-content/uploads/2022/10/image-1-300x57.png 300w, /wp-content/uploads/2022/10/image-1-768x147.png 768w, /wp-content/uploads/2022/10/image-1.png 1129w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Configure Button</figcaption></figure>
</div>


<p>Provide a meaningful name for your Webhook and upload an image if required. Finally click on the Create button. A unique Url will be generated for your Webhook. Copy the Url and save it somewhere, we will later add this to <a rel="noreferrer noopener" href="https://sibeeshpassion.com/tag/azure-key-vault/" target="_blank">Azure Key Vault</a> and use from there. Click on the Done button. Your Webhook now should be shown as configured. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="/wp-content/uploads/2022/10/image-2.png"><img decoding="async" width="1024" height="214" src="/wp-content/uploads/2022/10/image-2-1024x214.png" alt="" class="wp-image-14596" srcset="/wp-content/uploads/2022/10/image-2-1024x214.png 1024w, /wp-content/uploads/2022/10/image-2-300x63.png 300w, /wp-content/uploads/2022/10/image-2-768x161.png 768w, /wp-content/uploads/2022/10/image-2.png 1147w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Webhook Configured</figcaption></figure>
</div>


<h1 class="wp-block-heading">Post Message Using the Connector</h1>



<h2 class="wp-block-heading">Setting up Azure Key Vault</h2>



<p>Configuring the Azure Key Vault is as easy as you set up any other Azure Resource. You may get the steps required from <a rel="noreferrer noopener" href="https://sibeeshpassion.com/why-not-secure-your-keys-and-secrets-asp-net-core-with-azure-key-vault-integration/" target="_blank">this post</a> or <a rel="noreferrer noopener" href="https://learn.microsoft.com/en-us/azure/key-vault/general/overview" target="_blank">this</a>. Add a new secret and paste the Webhook Url value you copied earlier. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Make sure that you had set up the Access Policies on your Azure Key vault.</p><cite>Access Policy</cite></blockquote>



<p>Copy your Azure Key Vault name and the Secret name, we will use this in our Python function. </p>



<h2 class="wp-block-heading">Setting up Python Application</h2>



<p>Let&#8217;s set up our Python application. Create a directory msteams-webhook and create a file <strong>requirements.txt</strong> with the preceeding contents. </p>



<pre class="wp-block-code"><code>pymsteams&#91;async]
azure-identity
azure-keyvault-secrets</code></pre>



<p>Now run the commands below to create a virtual environment, activate the environment and then install the requirements in our environment. If you get a message like &#8220;WARNING: You are using pip version 19.2.3, however version 22.2.2 is available.&#8221;, you can upgrade pip by running the command <code>python -m pip install --upgrade pip</code></p>



<pre class="wp-block-code"><code>py -m venv .venv
.\.venv\Scripts\activate
py -m pip install -r requirements.txt</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>You can learn more abou the Virtual Environment <a rel="noreferrer noopener" href="https://docs.python.org/3/library/venv.html" target="_blank">here</a>.</p><cite>Python Virtual Envrronment</cite></blockquote>



<h2 class="wp-block-heading">Get the Secret from Azure Key Vault</h2>



<p>Let&#8217;s create a new Python file <strong>keyvault_helper.py</strong> with the codes below. </p>



<script src="https://gist.github.com/SibeeshVenu/ce578e01a22000e430d92bd645ae95ea.js"></script>



<h2 class="wp-block-heading">Send Message to Teams Channel</h2>



<p>To send a message to the Teams channel, we are going to use a package pymsteams. This has been already added to our requirements file. Let&#8217;s create a file <strong>notify_teams.py</strong> with the codes below. </p>



<script src="https://gist.github.com/SibeeshVenu/f7262bb8a22c7e84041e16b3f71df7f7.js"></script>



<p>As we have all the set up done, let&#8217;s create main.py file with the codes below to start sending the messages to the Teams channel. </p>



<script src="https://gist.github.com/SibeeshVenu/62f000341b6284d2b92e1c0266647908.js"></script>



<p>Before you run the main file, make sure that you have logged in to the terminal using az login with the account that you had set the access policy in your azure key vault. We can also set this access policies by using a managed identity, or a service principal, so that we can use it for more production scenarios. But for this post, let&#8217;s stick with a user account. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>If you get the error,  <code>VisualStudioCodeCredential: The current credential is not configured to acquire tokens for tenant</code> or <code>SharedTokenCacheCredential: The current credential is not configured to acquire tokens for tenant</code> you can set the values  <code>exclude_shared_token_cache_credential=True</code> or <code>exclude_visual_studio_code_credential=True</code> when you get tokens using <code>DefaultAzureCredential</code> in your <code>get_key_vault_secret</code> function in <code>keyvault_helper.py</code> file. </p><cite>Keyvault Error</cite></blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="/wp-content/uploads/2022/10/image-3.png"><img decoding="async" width="1024" height="201" src="/wp-content/uploads/2022/10/image-3-1024x201.png" alt="" class="wp-image-14598" srcset="/wp-content/uploads/2022/10/image-3-1024x201.png 1024w, /wp-content/uploads/2022/10/image-3-300x59.png 300w, /wp-content/uploads/2022/10/image-3-768x150.png 768w, /wp-content/uploads/2022/10/image-3.png 1302w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>default.py file from Azure Identity</figcaption></figure>
</div>


<p>By this time, we can hope that you will be able to get the secret from the key vault and now we can execute <code>py .\main.py</code> file. Once the file is executed, you should get a response in your cli as preceding. </p>



<pre class="wp-block-code"><code>{"version":"1.1","content":{"headers":&#91;{"key":"Content-Type","value":&#91;"text/plain; charset=utf-8"]}]},"statusCode":200,"reasonPhrase":"OK","headers":&#91;],"trailingHeaders":&#91;],"requestMessage":null,"isSuccessStatusCode":true}</code></pre>



<p>You should also get a message on your Teams channel.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="/wp-content/uploads/2022/10/image-4.png"><img decoding="async" width="1024" height="175" src="/wp-content/uploads/2022/10/image-4-1024x175.png" alt="" class="wp-image-14599" srcset="/wp-content/uploads/2022/10/image-4-1024x175.png 1024w, /wp-content/uploads/2022/10/image-4-300x51.png 300w, /wp-content/uploads/2022/10/image-4-768x131.png 768w, /wp-content/uploads/2022/10/image-4-1536x263.png 1536w, /wp-content/uploads/2022/10/image-4-2048x350.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Message in Teams Channel</figcaption></figure>
</div>


<h1 class="wp-block-heading">Source Code</h1>



<p>You can also see the codes in <a href="https://github.com/SibeeshVenu/msteams-webhook-py" target="_blank" rel="noreferrer noopener">this repository</a>. </p>



<h1 class="wp-block-heading">About the Author</h1>



<p>I am yet another developer who is passionate about writing and video creation. I have written more than 500 blogs on my <a rel="noreferrer noopener" href="https://sibeeshpassion.com/" target="_blank">blog</a>. If you like this content, consider following me here,</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h1 class="wp-block-heading">Your turn. What do you think?</h1>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/post-messages-to-microsoft-teams-using-python/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get Azure Blob Storage Blob Metadata Using PowerShell</title>
		<link>https://sibeeshpassion.com/get-azure-blob-storage-blob-metadata-using-powershell/</link>
					<comments>https://sibeeshpassion.com/get-azure-blob-storage-blob-metadata-using-powershell/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 20 May 2022 16:15:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Azure Storage]]></category>
		<category><![CDATA[Get blob metadata using PowerShell]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14572</guid>

					<description><![CDATA[Here we will see how you can get the metadata of each blob available in your Azure storage account using PowerShell.]]></description>
										<content:encoded><![CDATA[
<p>This is going to be a quick blog post. Here we will see how you can get the metadata of each blob available in your Azure storage account using PowerShell. Here I assume that you have access to your storage account and you will be asked to log in. Let&#8217;s get started. </p>



<h2 class="wp-block-heading">PowerShell command to get the metadata</h2>



<p><a href="https://gist.github.com/SibeeshVenu/a735db3439ca50305a5141ab83d26892" target="_blank" rel="noreferrer noopener">Here</a> is the command to get the metadata of all of your blobs in your storage account. </p>



<script src="https://gist.github.com/SibeeshVenu/a735db3439ca50305a5141ab83d26892.js"></script>



<p>Set your execution policy to Process if you get any policy errors. </p>



<pre class="wp-block-code"><code>Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process</code></pre>



<p>If you get an authorization error as follows, make sure to add a role assignment of <strong>Storage Blob Data Contributor</strong>. You can do this via Access Control (IAM) of your storage account. Read more about this role <a href="https://docs.microsoft.com/en-us/azure/storage/blobs/assign-azure-role-data-access?tabs=portal" target="_blank" rel="noreferrer noopener">here</a>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>PowerShell AuthorizationPermissionMismatch Error</p><cite>Get-AzStorageContainer : This request is not authorized to perform this operation using this permission.<br>RequestId:405a7e1a-f01e-004f-3acd-6a1168000000<br>Time:2022-05-18T15:38:30.5034936Z<br>Status: 403 (This request is not authorized to perform this operation using this permission.)<br>ErrorCode: AuthorizationPermissionMismatch<br>Content:<br>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;&lt;Error&gt;&lt;Code&gt;AuthorizationPermissionMismatch&lt;/Code&gt;&lt;Message&gt;This request is not authorized to perform this operation using<br>this permission.</cite></blockquote>



<p>Once you add the role, you can try running your PowerShell command after a few minutes. Please make sure to provide the values to the variables <strong>$containerName, $subscriptionid, $storageAccName</strong>. Happy coding with PowerShell!</p>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a rel="noreferrer noopener" href="https://sibeeshpassion.com/" target="_blank">blog</a>. If you like this content, consider following me here,</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/get-azure-blob-storage-blob-metadata-using-powershell/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Deploy .net 6 App to Azure from Azure DevOps using Pipelines</title>
		<link>https://sibeeshpassion.com/deploy-net-6-app-to-azure-from-azure-devops-using-pipelines/</link>
					<comments>https://sibeeshpassion.com/deploy-net-6-app-to-azure-from-azure-devops-using-pipelines/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 15 Dec 2021 14:47:13 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[.net 6]]></category>
		<category><![CDATA[Azure DevOps]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14537</guid>

					<description><![CDATA[Working with both Azure and Azure DevOps is always fun, and the possibilities of automation are endless. I have written many articles on these topics and you can read them here. As you all know that the .net6 is been a talk in the market and I can't wait to try out things there. Here in this post, we will see how to use the Azure DevOps pipeline to build, restore and deploy the .net6 application to Azure Web App Service.]]></description>
										<content:encoded><![CDATA[
<p>Working with both Azure and Azure DevOps is always fun, and the possibilities of automation are endless. I have written many articles on these topics and you can read them <a rel="noreferrer noopener" href="https://sibeeshpassion.com/category/azure/" target="_blank">here</a>. As you all know that the .net6 is been a talk in the market and I can&#8217;t wait to try out things there. Here in this post, we will see how to use the Azure DevOps pipeline to build, restore and deploy the .net6 application to Azure Web App Service. Let&#8217;s get started. </p>



<p>At this point, I will assume that you have a .net6 application, Azure Web App Service, and Azure DevOps project with permission to configure the Pipeline and to add a new service connection to the Azure Resource Group. If you are not sure about how to configure the Service Connection to the Azure Resource Group, <a href="https://sibeeshpassion.com/azure-devops-service-connection-with-multiple-azure-resource-group/" target="_blank" rel="noreferrer noopener">this post</a> will help you. </p>



<h1 class="wp-block-heading">Create the YAML files needed</h1>



<p>We will be creating 3 YAML files as listed below. </p>



<ol class="wp-block-list"><li><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?WT.mc_id=AZ-MVP-5001828&amp;view=azure-devops" target="_blank" rel="noreferrer noopener">A template file</a> with the all the tasks, so that we can reuse them for the environment specific pipelines</li><li>A pipeline for Test environment</li><li>A pipeline for the production environment</li></ol>



<h2 class="wp-block-heading">Template file</h2>



<p>Let&#8217;s configure all the tasks needed in our template file. We will have 2 stages in our template. You can <a href="https://sibeeshpassion.com/azure-multi-stage-pipeline-for-asp-net-core-and-azure-deploy-to-azure-app-service/" target="_blank" rel="noreferrer noopener">read this post</a> if you are not sure how to configure the stages in the pipeline. </p>



<ol class="wp-block-list"><li>Build stage, for performing the tasks below <ul><li>Install .Net Core SDK</li><li>.Net restore</li><li>.Net build</li><li>.Net publish</li><li>Publish to Azure DevOps artefacts</li></ul></li><li>Deploy stage, to deploy the artefacts generated to the Azure Web App Service. This will involves the taks below. <ul><li>Download the artefact</li><li>Deploy</li></ul></li></ol>



<p>Our final template file will look like this. </p>



<script src="https://gist.github.com/SibeeshVenu/4951d95a528d6bef87cc353eeb010548.js"></script>



<h2 class="wp-block-heading">Add pipeline for Test environment</h2>



<p>As we have a template available, we can use this to configure the pipeline for our test environment. All you have to do is to refer to this template and pass the required parameters. This is how our pipeline for our test environment can look like. </p>



<script src="https://gist.github.com/SibeeshVenu/6f6d8f7ef94f781e33b71ca031908f1b.js"></script>



<p>Here, the parameter azure subscription is the service connection name that you have created in your Azure DevOps project. Refer <a rel="noreferrer noopener" href="https://sibeeshpassion.com/azure-devops-service-connection-with-multiple-azure-resource-group/" target="_blank">to this</a> to know more.  The wwebAppName is the name of your Azure Web App Service. </p>



<h2 class="wp-block-heading">Add pipeline for Prod environment</h2>



<p>Let&#8217;s create a new pipeline for our Prod environment to see how easily we can reuse the template. </p>



<script src="https://gist.github.com/SibeeshVenu/1c9f4a5d53e696cbb5241efa0bef1ef3.js"></script>



<p>Wasn&#8217;t that cool?</p>



<h1 class="wp-block-heading">Configure the pipelines in the Azure DevOps</h1>



<p>Just creating the YAML field will not create the pipelines in our DevOps, as Microsoft has removed that option due to some security concerns. So we will have to configure them manually for the first time. Let&#8217;s do it. </p>



<ol class="wp-block-list"><li>Go to the Pipelines section from your Azure DevOps and click on the New pipeline button. </li><li>Select Azure Repos Git (YAML) from the next screen. </li><li>Select the repository that you pushed your YAML file code changes. </li><li>Azure DevOps will analyze your repository and sugges the YAML templates. Select the Existing Azure Pipeline YAML file option.</li><li>Selct the branch and the path to your YAML file as in the preceding image, review the same and run the pipeline. </li></ol>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-8.png"><img decoding="async" width="801" height="376" src="/wp-content/uploads/2021/12/image-8.png" alt="" class="wp-image-14538" srcset="/wp-content/uploads/2021/12/image-8.png 801w, /wp-content/uploads/2021/12/image-8-300x141.png 300w, /wp-content/uploads/2021/12/image-8-768x361.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><figcaption>Configure the pipelines in Azure DevOps</figcaption></figure>



<p>That&#8217;s it. Everything else will be working as expected from the next time as we have configured the triggers in the pipelines. If you are getting an error as &#8220;Task &#8220;NETSdkError&#8221; skipped, due to false condition; (&#8216;$(_TargetFrameworkVersionWithoutV)&#8217; &gt; &#8216;$(NETCoreAppMaximumVersion)&#8217;) was evaluated&#8221;, you will have to make sure that you are installing the correct version of the .Net Core SDK as mentioned in <a href="https://stackoverflow.com/a/70352273/5550507" target="_blank" rel="noreferrer noopener">this answer</a>.</p>



<h1 class="wp-block-heading">Source code</h1>



<p>You can get the complete source code from this <a href="https://github.com/SibeeshVenu/deploy-.net6-azure-web-app-yaml" target="_blank" rel="noreferrer noopener">GitHub repository</a>. Please feel free to fork/star. </p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Here in this post, we have learned the following things.</p>



<ol class="wp-block-list" id="block-d40e081d-b702-477c-8b2d-f217c2c2b5fb"><li>How to configure a YAML template</li><li>How to reuse a YAML template in the pipelines</li><li>How to deploy the .net 6 application to Azure Web App Service</li></ol>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/deploy-net-6-app-to-azure-from-azure-devops-using-pipelines/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Integrate Azure App Insights in 1 Minute to .Net6 Application</title>
		<link>https://sibeeshpassion.com/integrate-azure-app-insights-in-1-minute-to-net6-application/</link>
					<comments>https://sibeeshpassion.com/integrate-azure-app-insights-in-1-minute-to-net6-application/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 15 Dec 2021 11:43:51 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[.net 6]]></category>
		<category><![CDATA[azure app insights]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14527</guid>

					<description><![CDATA[Integrating an existing Azure App Insights into your application is never been easier than this. Within a minute you can do this. I am using the .net6 app and visual studio 2022.]]></description>
										<content:encoded><![CDATA[
<p>Integrating an existing Azure App Insights into your application is never been easier than this. Within a minute you can do this. I am using the .net6 app and visual studio 2022. Here are the steps to do that. </p>



<p>Right-click on the project and click on the Connected Service </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-1.png"><img decoding="async" width="800" height="806" src="/wp-content/uploads/2021/12/image-1.png" alt="" class="wp-image-14529" srcset="/wp-content/uploads/2021/12/image-1.png 800w, /wp-content/uploads/2021/12/image-1-298x300.png 298w, /wp-content/uploads/2021/12/image-1-150x150.png 150w, /wp-content/uploads/2021/12/image-1-768x774.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Add connected service menu</figcaption></figure>



<p>Click on the + icon in the Service Dependencies and then select Azure Application Insights from the list </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-2.png"><img decoding="async" width="800" height="561" src="/wp-content/uploads/2021/12/image-2.png" alt="" class="wp-image-14530" srcset="/wp-content/uploads/2021/12/image-2.png 800w, /wp-content/uploads/2021/12/image-2-300x210.png 300w, /wp-content/uploads/2021/12/image-2-768x539.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Add dependency screen</figcaption></figure>



<p>Log in and select your subscription and the Azure Application Insight instance </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-3.png"><img decoding="async" width="800" height="561" src="/wp-content/uploads/2021/12/image-3.png" alt="" class="wp-image-14531" srcset="/wp-content/uploads/2021/12/image-3.png 800w, /wp-content/uploads/2021/12/image-3-300x210.png 300w, /wp-content/uploads/2021/12/image-3-768x539.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Select service dependency </figcaption></figure>



<p>Configure your connection string name and choose how you want to save your connections string locally. I would recommend saving it to a secret.json file. You can get more information about this <a rel="noreferrer noopener" href="https://sibeeshpassion.com/why-not-secure-your-keys-and-secrets-asp-net-core-with-azure-key-vault-integration/" target="_blank">here</a> under the Secret Storage for Development Environment section. </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-4.png"><img decoding="async" width="800" height="561" src="/wp-content/uploads/2021/12/image-4.png" alt="" class="wp-image-14532" srcset="/wp-content/uploads/2021/12/image-4.png 800w, /wp-content/uploads/2021/12/image-4-300x210.png 300w, /wp-content/uploads/2021/12/image-4-768x539.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Provide connection string</figcaption></figure>



<p>Click Finish on the summary screen.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-5.png"><img decoding="async" width="800" height="561" src="/wp-content/uploads/2021/12/image-5.png" alt="" class="wp-image-14533" srcset="/wp-content/uploads/2021/12/image-5.png 800w, /wp-content/uploads/2021/12/image-5-300x210.png 300w, /wp-content/uploads/2021/12/image-5-768x539.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Summary of changes</figcaption></figure>



<p>You will be able to see the progress in the next screen.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-6.png"><img decoding="async" width="800" height="561" src="/wp-content/uploads/2021/12/image-6.png" alt="" class="wp-image-14534" srcset="/wp-content/uploads/2021/12/image-6.png 800w, /wp-content/uploads/2021/12/image-6-300x210.png 300w, /wp-content/uploads/2021/12/image-6-768x539.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Dependency configuration progress</figcaption></figure>



<p>Click on the Git changes window, your changes should look like the image below. </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/12/image-7.png"><img decoding="async" width="749" height="755" src="/wp-content/uploads/2021/12/image-7.png" alt="" class="wp-image-14535" srcset="/wp-content/uploads/2021/12/image-7.png 749w, /wp-content/uploads/2021/12/image-7-298x300.png 298w, /wp-content/uploads/2021/12/image-7-150x150.png 150w" sizes="(max-width: 749px) 100vw, 749px" /></a><figcaption>Git changes</figcaption></figure>



<p>Push your changes and deploy them to your web application.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Congratulations and thanks a lot for being with me this far. Here in this post, we learned how can we enable the Azure App Insights to our application. Happy Analysing!.</p>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/integrate-azure-app-insights-in-1-minute-to-net6-application/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Azure DevOps Service Connection with Multiple Azure Resource Group</title>
		<link>https://sibeeshpassion.com/azure-devops-service-connection-with-multiple-azure-resource-group/</link>
					<comments>https://sibeeshpassion.com/azure-devops-service-connection-with-multiple-azure-resource-group/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 19 Nov 2021 12:51:47 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure DevOps]]></category>
		<category><![CDATA[Azure DevOps Service Connection]]></category>
		<category><![CDATA[Service Connection with Multiple Azure Resource Group]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14511</guid>

					<description><![CDATA[I wanted to use the Azure DevOps same service connection to connect to multiple resource groups, so that I can use the same service connection in a pipeline to connect to those resources when it is necessary by using the "azureSubscription"option in the pipeline tasks. ]]></description>
										<content:encoded><![CDATA[
<p>As you know that we can easily achieve a lot of automation by combining <a rel="noreferrer noopener" href="https://sibeeshpassion.com/tag/azure-devops/" target="_blank">Azure DevOps</a> and <a rel="noreferrer noopener" href="https://sibeeshpassion.com/tag/azure/" target="_blank">Azure Services</a>. I have an Azure Pipeline that will build my application, publish my packages/artefacts generated to an Azure Web App Service and then publish the content to a CDN as well. I am sure that you might have done this several times, and we use the <a rel="noreferrer noopener" href="https://sibeeshpassion.com/azure-function-build-and-release-pipeline-in-azure-devops-ci-cd/" target="_blank">Azure DevOps service connection</a> to connect to the Azure Services.  While we add the Service Connection there is an option to select the Azure Resource Manager using service principal(automatic), and then we set the subscription and the resource group. </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/11/image-3.png"><img decoding="async" width="540" height="800" src="/wp-content/uploads/2021/11/image-3.png" alt="" class="wp-image-14515" srcset="/wp-content/uploads/2021/11/image-3.png 540w, /wp-content/uploads/2021/11/image-3-203x300.png 203w" sizes="(max-width: 540px) 100vw, 540px" /></a><figcaption> Azure Resource Manager using service principal(automatic) </figcaption></figure></div>



<p>This will create a new Azure AD App Registration on your Azure AD and then a new service principal will be created to connect the Azure Resource group you have mentioned. By default, this will work with only one resource group as there is no UI to select multiple resource groups. But, I wanted to use the same service connection to connect to multiple resource groups, so that I can use the same service connection in a pipeline to connect to those resources when it is necessary by using the <code>"azureSubscription"</code>option in the pipeline tasks. I was getting the preceding error when I try with the existing service connection. </p>



<pre class="wp-block-code"><code>1. Starting: Publish app to installer website ============================================================================== Task : Azure App Service deploy Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby Version : 3.184.1 Author : Microsoft Corporation Help : https://aka.ms/azureappservicetroubleshooting ============================================================================== Got connection details for Azure App Service:'weu-aps01' ##&#91;error]Error: Resource 'weu-aps01' doesn't exist. Resource should exist before deployment. Finishing: Publish app to installer website 
</code></pre>



<p>Here in this post, we will see how we can resolve this issue. </p>



<h1 class="wp-block-heading">Azure AD App Registration and Service Prinicipals</h1>



<p>Here are the screenshots of the AD app registered and the service principal created. </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/11/image-4.png"><img decoding="async" width="801" height="515" src="/wp-content/uploads/2021/11/image-4.png" alt="" class="wp-image-14516" srcset="/wp-content/uploads/2021/11/image-4.png 801w, /wp-content/uploads/2021/11/image-4-300x193.png 300w, /wp-content/uploads/2021/11/image-4-768x494.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><figcaption>AD App Registered on the Azure AD</figcaption></figure>



<p>Now, if you just go to your Azure Resource group and then click on the Access Control, under the role assignments you should be able to see the new service principal for the new AD app with contributor access. </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/11/image-5.png"><img decoding="async" width="800" height="423" src="/wp-content/uploads/2021/11/image-5.png" alt="" class="wp-image-14517" srcset="/wp-content/uploads/2021/11/image-5.png 800w, /wp-content/uploads/2021/11/image-5-300x159.png 300w, /wp-content/uploads/2021/11/image-5-768x406.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Service Principal Created for the AD App Registration</figcaption></figure>



<h1 class="wp-block-heading">Azur DevOps Service Connection with Multiple Resource Group</h1>



<p>As you might have guessed already, to connect multiple resource groups to the same azure DevOps service connection, all we have to do is to add a new role assignment with the new AD application registration. Get the name of the service principal created, by clicking on the manage Service Principal option in the Service Connection and then copy the value for the Display name from the next page. </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/11/image-6.png"><img decoding="async" width="801" height="476" src="/wp-content/uploads/2021/11/image-6.png" alt="" class="wp-image-14518" srcset="/wp-content/uploads/2021/11/image-6.png 801w, /wp-content/uploads/2021/11/image-6-300x178.png 300w, /wp-content/uploads/2021/11/image-6-768x456.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><figcaption>Manage Service Principal</figcaption></figure>



<p>Now, go to the resource group that you wish to give access to, click on the Access Control(IAM) and then the +Add button.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/11/image-7.png"><img decoding="async" width="800" height="286" src="/wp-content/uploads/2021/11/image-7.png" alt="" class="wp-image-14519" srcset="/wp-content/uploads/2021/11/image-7.png 800w, /wp-content/uploads/2021/11/image-7-300x107.png 300w, /wp-content/uploads/2021/11/image-7-768x275.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Access Control (IAM)</figcaption></figure>



<p>Select the Add role assignment option and then select the role as a contributor in the role grid, press next. From the next screen, select <strong>user, group, or service principal</strong> as the option for <strong>Assign access to</strong>. Click on the + Select members, search for our AD Registered app name, the display name and then select the same from the result, click on the select button. Finally, click the Review + assign button. </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/11/image-8.png"><img decoding="async" width="513" height="600" src="/wp-content/uploads/2021/11/image-8.png" alt="" class="wp-image-14520" srcset="/wp-content/uploads/2021/11/image-8.png 513w, /wp-content/uploads/2021/11/image-8-257x300.png 257w" sizes="(max-width: 513px) 100vw, 513px" /></a><figcaption>Select the Service Principal</figcaption></figure></div>



<h1 class="wp-block-heading">Testing Azure DevOps Service Connection with Multiple Resource Group</h1>



<p>I had a pipeline that connects Azure Resources from different resource groups, so to test this, all I have to do is to run the pipeline, and see whether I am getting the same error I was getting earlier. If you ever get any error saying that, <code>##[error]Error: Virtual application doesn't exists : resources</code> make sure that you have configured the virtual directory in your Azure Web App, here resources is my virtual application. I know that it is specific to my case, still thought to share this in this post. </p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2021/11/Azure-Web-App-Virtual-Application.png"><img decoding="async" width="799" height="417" src="/wp-content/uploads/2021/11/Azure-Web-App-Virtual-Application.png" alt="" class="wp-image-14522" srcset="/wp-content/uploads/2021/11/Azure-Web-App-Virtual-Application.png 799w, /wp-content/uploads/2021/11/Azure-Web-App-Virtual-Application-300x157.png 300w, /wp-content/uploads/2021/11/Azure-Web-App-Virtual-Application-768x401.png 768w" sizes="(max-width: 799px) 100vw, 799px" /></a><figcaption>Azure Web App Virtual Application</figcaption></figure>



<h1 class="wp-block-heading">Conclusion</h1>



<p>In this post, we learned the preceding things.</p>



<ul class="wp-block-list"><li>What is Azure DevOps service connection</li><li>How to configure an Azure DevOps service connection with multiple azure resource groups</li></ul>



<h1 class="wp-block-heading">About the Author</h1>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h1 class="wp-block-heading">Your turn. What do you think?</h1>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/azure-devops-service-connection-with-multiple-azure-resource-group/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Change MFA Phone/Mobile Number Using PowerShell</title>
		<link>https://sibeeshpassion.com/change-mfa-phone-mobile-number-using-powershell/</link>
					<comments>https://sibeeshpassion.com/change-mfa-phone-mobile-number-using-powershell/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 19 Oct 2021 14:39:18 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure AD]]></category>
		<category><![CDATA[change mfa mobile number using powershell]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14494</guid>

					<description><![CDATA[Did you know that you can change the mobile number of a user from Azure AD, by using PowerShell? Here in this post, we will see how easy it is to change the user properties of an AD user.]]></description>
										<content:encoded><![CDATA[
<p>Did you know that you can change the mobile number of a user from Azure AD, by using PowerShell? Here in this post, we will see how easy it is to change the user properties of an AD user. To get started, we need to install the AzureAD module from the <a rel="noreferrer noopener" href="https://www.powershellgallery.com/packages/AzureAD/2.0.2.140" target="_blank">PowerShell Gallery</a> You can get more details about this module <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/powershell/module/azuread/?view=azureadps-2.0&amp;WT.mc_id=AZ-MVP-5001828" target="_blank">here</a>. </p>



<pre class="wp-block-code"><code>Install-Module -Name AzureAD</code></pre>



<p>You will be prompted to accept the installation, give Yes or A. </p>



<pre class="wp-block-code"><code>Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
&#91;Y] Yes  &#91;A] Yes to All  &#91;N] No  &#91;L] No to All  &#91;S] Suspend  &#91;?] Help (default is "N"): A</code></pre>



<p>You can also check whether this module is installed or not by using the command <code>Get-Module AzureADPreview</code></p>



<p>Once you are done, it is time to connect to your Azure AD by using the command <code>Connect-AzureAD</code>. That will give you an output as in the preceding image. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2021/10/image.png"><img decoding="async" width="1024" height="111" src="/wp-content/uploads/2021/10/image-1024x111.png" alt="" class="wp-image-14495" srcset="/wp-content/uploads/2021/10/image-1024x111.png 1024w, /wp-content/uploads/2021/10/image-300x33.png 300w, /wp-content/uploads/2021/10/image-768x83.png 768w, /wp-content/uploads/2021/10/image-1536x166.png 1536w, /wp-content/uploads/2021/10/image.png 1707w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Connect-AzureAD Output</figcaption></figure>



<p>Now, use the command below to change the properties of your user. </p>



<pre class="wp-block-code"><code>Set-AzureADUser -ObjectId user1@domain.com -OtherMails @("user2@domain.com") -Mobile "+353 000000000" -TelephoneNumber "+353 000000000"</code></pre>



<p>You can also verify the changes by running the commands below. </p>



<pre class="wp-block-code"><code>Get-AzureADUser -ObjectID user@domain.com | select otherMails
Get-AzureADUser -ObjectID user@domain.com | select Mobile
Get-AzureADUser -ObjectID user@domain.com | select TelephoneNumber</code></pre>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2021/10/image-1.png"><img decoding="async" width="1024" height="470" src="/wp-content/uploads/2021/10/image-1-1024x470.png" alt="" class="wp-image-14496" srcset="/wp-content/uploads/2021/10/image-1-1024x470.png 1024w, /wp-content/uploads/2021/10/image-1-300x138.png 300w, /wp-content/uploads/2021/10/image-1-768x353.png 768w, /wp-content/uploads/2021/10/image-1-1536x705.png 1536w, /wp-content/uploads/2021/10/image-1.png 1708w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Get-AzureADUser Output</figcaption></figure>



<p>After you have changed your mobile number, verify the same when it is asked, and you should be able to Enable the Two-Step Verification on the <a href="https://mysignins.microsoft.com/security-info" target="_blank" rel="noreferrer noopener">Security Information page</a>. </p>



<figure class="wp-block-image size-large"><a href="/wp-content/uploads/2021/10/image-2.png"><img decoding="async" width="1024" height="231" src="/wp-content/uploads/2021/10/image-2-1024x231.png" alt="" class="wp-image-14497" srcset="/wp-content/uploads/2021/10/image-2-1024x231.png 1024w, /wp-content/uploads/2021/10/image-2-300x68.png 300w, /wp-content/uploads/2021/10/image-2-768x173.png 768w, /wp-content/uploads/2021/10/image-2-1536x347.png 1536w, /wp-content/uploads/2021/10/image-2-2048x462.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Enable two-step verification</figcaption></figure>



<p></p>



<h1 class="wp-block-heading">References</h1>



<p><a href="https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-sspr-authenticationdata#use-powershell-version-2">https://docs.microsoft.com/en-us/azure/active-directory/authentication/howto-sspr-authenticationdata#use-powershell-version-2</a></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/change-mfa-phone-mobile-number-using-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get Azure DevOps Sprint Capacity Using API and PostMan</title>
		<link>https://sibeeshpassion.com/get-azure-devops-sprint-capacity-using-api-and-postman/</link>
					<comments>https://sibeeshpassion.com/get-azure-devops-sprint-capacity-using-api-and-postman/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 22 Aug 2021 10:54:32 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure DevOps]]></category>
		<category><![CDATA[azure devops analytics]]></category>
		<category><![CDATA[Azure DevOps APIs]]></category>
		<category><![CDATA[azure devops capacity]]></category>
		<category><![CDATA[get average sprint capacity azure devops]]></category>
		<category><![CDATA[get azure devops iteration capacity]]></category>
		<category><![CDATA[get sprint capacity azure devops programatically]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14453</guid>

					<description><![CDATA[ I wanted to know my Sprint capacity programmatically as I need to find the average sprint capacity and the area where my team is spending time, whether it is Development or Testing, etc. Unfortunately, there is no option to see that in the Azure DevOps, but luckily there are APIs we can get this information.]]></description>
										<content:encoded><![CDATA[
<p>Obviously, you can do many things in <a rel="noreferrer noopener" href="https://sibeeshpassion.com/tag/azure-devops/" target="_blank">Azure DevOps</a>, but there may be some cases where you may need to do something special to get what you wanted. Here, I wanted to know my Sprint capacity programmatically as I need to find the average sprint capacity and the area where my team is spending time, whether it is Development or Testing, etc. Unfortunately, there is no option to see that in the Azure DevOps, but luckily there are APIs we can get this information. Here, in this post, we will see how we can get that, let&#8217;s get started. </p>



<h1 class="wp-block-heading">Get the PAT (Personal Access Token)</h1>



<p>To connect to our DevOps using an API, we should authenticate and to do that, we need to create a PAT aka Personal Access Token. Goto your Azure DevOps and click on the User Settings button, and then Personal access tokens.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/08/image-2.png"><img decoding="async" width="400" height="613" src="/wp-content/uploads/2021/08/image-2.png" alt="" class="wp-image-14456" srcset="/wp-content/uploads/2021/08/image-2.png 400w, /wp-content/uploads/2021/08/image-2-196x300.png 196w" sizes="(max-width: 400px) 100vw, 400px" /></a><figcaption>Personal access tokens</figcaption></figure></div>



<p>Click on the +New Token button and fill all the required fields in the next screen. Once it is done, click on Create button, this will generate a token for you. <em>Please remember that you need to copy this token before you leave the page or reload, as this is not saved anywhere</em>. </p>



<h1 class="wp-block-heading">Setup PostMan</h1>



<p>I usually create a collection in PostMan before I do any related calls. You can create a collection by clicking the + icon in the collection section. Once it is created, click on the Authorization tab and change the type to Basic Auth, past the token you copied from Azure DevOps in the password field. Please remember that you should leave the Username field blank. </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/08/image-3.png"><img decoding="async" width="800" height="538" src="/wp-content/uploads/2021/08/image-3.png" alt="" class="wp-image-14457" srcset="/wp-content/uploads/2021/08/image-3.png 800w, /wp-content/uploads/2021/08/image-3-300x202.png 300w, /wp-content/uploads/2021/08/image-3-768x516.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Setup PostMan using Azure DevOps Token</figcaption></figure></div>



<h1 class="wp-block-heading">Call the Azure DevOps APIs</h1>



<p>As we have successfully set up our PostMan, now we are ready to execute the APIs. </p>



<h2 class="wp-block-heading">Get Iterations</h2>



<p>Create a GET request under the collection we have created using <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/rest/api/azure/devops/work/iterations/list?view=azure-devops-rest-6.0&amp;WT.mc_id=AZ-MVP-5001828" target="_blank">this format</a> to get the Iterations as we will use this in our next API call. The example is given below. </p>



<pre class="wp-block-code"><code>GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations?api-version=6.0</code></pre>



<p>The Organization name and project name can be easily found on the Azure DevOps home page or from the URL you access your DevOps, for example, if you access your DevOps by this URL &#8220;<code>https://dev.azure.com/sibeeshpassion/publicrepo</code>&#8220;, sibeeshpassion is your organization name and publicrepo is your project name.  </p>



<p>You can either use your team name or team id as the next parameter. If you want to use the Team id, the easy way to find it is to go to your team by accessing this URL &#8220;<code>https://dev.azure.com/{orgName}/{projectName}/_settings/teams</code>&#8220;, click on the Team you wish, and then click on either Notification or Dashboard.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/08/image-5.png"><img decoding="async" width="850" height="703" src="/wp-content/uploads/2021/08/image-5.png" alt="" class="wp-image-14459" srcset="/wp-content/uploads/2021/08/image-5.png 850w, /wp-content/uploads/2021/08/image-5-300x248.png 300w, /wp-content/uploads/2021/08/image-5-768x635.png 768w" sizes="(max-width: 850px) 100vw, 850px" /></a><figcaption>Azure DevOps Teams</figcaption></figure></div>



<p>A new page will be opened and you can get the Team id from the URL of the new page. For example, &#8220;<code>https://dev.azure.com/{orgName}/{projectName}/_settings/notifications?teamId=989154f4f-32f6-4dab-b7f5-165457afsgd36f</code>&#8220;. One thing to note here is to set the Type as &#8220;Inherit auth from parent&#8221; under the Authorization tab.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/08/image-4.png"><img decoding="async" width="750" height="784" src="/wp-content/uploads/2021/08/image-4.png" alt="" class="wp-image-14458" srcset="/wp-content/uploads/2021/08/image-4.png 750w, /wp-content/uploads/2021/08/image-4-287x300.png 287w" sizes="(max-width: 750px) 100vw, 750px" /></a><figcaption>Get API Authorization Type</figcaption></figure></div>



<p>Click on the Send button now, and you should see the result. You can visualize the data you get <a rel="noreferrer noopener" href="https://learning.postman.com/docs/sending-requests/visualizer/" target="_blank">by using the visualizer if you wish.</a> </p>



<h2 class="wp-block-heading">Get the capacity</h2>



<p>As we now have all the iteration details we can perform the API call to get the capacity of each sprint. Create another GET request, by <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/work/capacities/list?view=azure-devops-rest-6.0&amp;WT.mc_id=AZ-MVP-5001828" target="_blank" rel="noreferrer noopener">using this format</a> and set the Authorization Type as &#8220;Inherit auth from parent&#8221;. The sample API looks like below, </p>



<pre class="wp-block-code"><code>GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations/{iterationId}/capacities?api-version=6.0</code></pre>



<p>Replace the {iterationId} from the result of the previous execution. When you click on the Send button, you should now get a JSON array with all the details as below.</p>



<script src="https://gist.github.com/SibeeshVenu/914a3b9853b9195219ce2993fe7ad815.js"></script>



<p>Please be noted that I have removed all the values from the result. With the result, you can loop through the array and find the analytics data that you are looking for. </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><a href="/wp-content/uploads/2021/08/image-6.png"><img decoding="async" width="800" height="465" src="/wp-content/uploads/2021/08/image-6.png" alt="" class="wp-image-14460" srcset="/wp-content/uploads/2021/08/image-6.png 800w, /wp-content/uploads/2021/08/image-6-300x174.png 300w, /wp-content/uploads/2021/08/image-6-768x446.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></a><figcaption>Get Capacities API Result</figcaption></figure></div>



<p>I am planning to create one front end application to do this, thus keep an eye here. You can also get the capacity of the team member by <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/rest/api/azure/devops/work/capacities/get?view=azure-devops-rest-6.0&amp;WT.mc_id=AZ-MVP-5001828" target="_blank">executing this API</a>. </p>



<h1 class="wp-block-heading">Conclusion</h1>



<p>Thanks for reading this post, and here we learned,</p>



<ol class="wp-block-list"><li>How to get a personal access token from Azure DevOps?</li><li>How to authnticate the Azure DevOps APIs using the Personal Access Tokens and use the same in PostMan?</li><li>How to get the Team Iterations and Sprint Capacities of a Team in Azure DevOps?</li></ol>



<h1 class="wp-block-heading">About the Author</h1>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h1 class="wp-block-heading">Your turn. What do you think?</h1>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/get-azure-devops-sprint-capacity-using-api-and-postman/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Get Users From Different Tenants Using Azure AD Application Permission</title>
		<link>https://sibeeshpassion.com/get-users-from-different-tenants-using-azure-ad-application-permission/</link>
					<comments>https://sibeeshpassion.com/get-users-from-different-tenants-using-azure-ad-application-permission/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 02 Feb 2021 17:37:17 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[azure active directory]]></category>
		<category><![CDATA[Azure AD]]></category>
		<category><![CDATA[azure ad app registration]]></category>
		<category><![CDATA[azure ad application permissions]]></category>
		<category><![CDATA[azure ad graph]]></category>
		<category><![CDATA[azure ad multi tenant users]]></category>
		<category><![CDATA[fetch users from multiple tenants]]></category>
		<category><![CDATA[get users from different tenants using graph]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[load users from different tenants]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=14294</guid>

					<description><![CDATA[In this post, we will see how we can get the users from different tenants using the Azure AD App registration with application permission]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>Working with Microsoft Graph is fun, but it can get way too complex when the requirement is getting complex. Recently, I was working with such a requirement. I wanted to load users from different tenants, usually, this is too easy, and you just need an admin user in the tenant to load all the users using Graph API. But, in our case, there is no guarantee that the logged-in user is actually present in that tenant. And when the user tries to get the users from a different tenant, the Graph API returns an Unauthorized error, which is obvious and well handled.</p>



<p>So, we wanted something that can always perform these actions, no matter the logged-in user is present or not in the tenant given. I started with adding the Delegated permission to the Azure AD app registration, and in the end, the result was the same. Then I came to know about the application permission of Azure AD application registration and that sounded worth a try. </p>



<p>Here in this post, I will be sharing how did I achieve this requirement, it is not that problematic as it sounds. </p>



<h2 class="wp-block-heading">Azure AD Application Set Up</h2>



<p>Go to your Azure AD and select the App registration menu from the left pane. This will open the window where you can create and manage your app registrations.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/App-Registration-in-Azure-AD.jpg"><img decoding="async" width="651" height="495" src="/wp-content/uploads/2021/02/App-Registration-in-Azure-AD.jpg" alt="" class="wp-image-14295" srcset="/wp-content/uploads/2021/02/App-Registration-in-Azure-AD.jpg 651w, /wp-content/uploads/2021/02/App-Registration-in-Azure-AD-300x228.jpg 300w" sizes="(max-width: 651px) 100vw, 651px" /></a><figcaption>App Registration in Azure AD</figcaption></figure></div>



<p>When you are registering a new Azure AD application, make sure to select Multi-Tenant Support and give a redirect URL.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Register-Multi-Tenant-AD-Application.jpg"><img decoding="async" width="650" height="551" src="/wp-content/uploads/2021/02/Register-Multi-Tenant-AD-Application.jpg" alt="" class="wp-image-14309" srcset="/wp-content/uploads/2021/02/Register-Multi-Tenant-AD-Application.jpg 650w, /wp-content/uploads/2021/02/Register-Multi-Tenant-AD-Application-300x254.jpg 300w" sizes="(max-width: 650px) 100vw, 650px" /></a><figcaption>Register Multi Tenant AD Application</figcaption></figure></div>



<p>Now let&#8217;s say that you have created your application and now open the application and click on the permission menu from the left-pane. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Configured-Permission-Azure-AD.jpg"><img decoding="async" width="650" height="283" src="/wp-content/uploads/2021/02/Configured-Permission-Azure-AD.jpg" alt="" class="wp-image-14298" srcset="/wp-content/uploads/2021/02/Configured-Permission-Azure-AD.jpg 650w, /wp-content/uploads/2021/02/Configured-Permission-Azure-AD-300x131.jpg 300w" sizes="(max-width: 650px) 100vw, 650px" /></a><figcaption>Configured Permission Azure AD</figcaption></figure></div>



<p>As you can see that, all the permission types are Application, instead of the delegated ones. This will make sure that our application gets the privilege to act without a user, and will act as a Daemon user in the end. Please be careful in giving the application permissions as those are critical and should only be used when it is needed. So, just select only the permissions needed to complete your requirements. </p>



<p>Now, to make it work, we also need to set up a Client Secret in our application, which will then be used when we create a token. To do that, click on the Certificate &amp; Secrets menu from the left pane. And click on the +New client secret. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Certificate-and-Secrets-in-Azure-AD.jpg"><img decoding="async" width="651" height="362" src="/wp-content/uploads/2021/02/Certificate-and-Secrets-in-Azure-AD.jpg" alt="" class="wp-image-14299" srcset="/wp-content/uploads/2021/02/Certificate-and-Secrets-in-Azure-AD.jpg 651w, /wp-content/uploads/2021/02/Certificate-and-Secrets-in-Azure-AD-300x167.jpg 300w" sizes="(max-width: 651px) 100vw, 651px" /></a><figcaption>Certificate and Secrets in Azure AD</figcaption></figure></div>



<p><strong>Remember to make a note of the secret as you will not be able to see the values later</strong>. Now that our application is ready for action, let us write some code. </p>



<h2 class="wp-block-heading">Code to Get Users from Multiple Tenants</h2>



<p>I do this in my .Net Core API application, and I have a module called Admin which does all the Admin related kinds of stuff. Here I have configured my application using a vertical layered architecture, thus this admin module is independent of any other features in our application. Having said that, let&#8217;s look at the code in AdminController. </p>



<script src="https://gist.github.com/SibeeshVenu/03faa0fc5efeea32d00732192db882bb.js"></script>



<p>As you can see that, nothing fancy there. Here I am just calling the method in the Admin Service and some error handlings. Let&#8217;s look at the code in the Admin Service. </p>



<script src="https://gist.github.com/SibeeshVenu/d0483db658f83d51053b70f4e07a8899.js"></script>



<p>Here I have some custom error handling and also I am doing some logic related to my requirement, but the important part here is&#8221; <em><code>var&nbsp;users&nbsp;=&nbsp;await&nbsp;_graphFacade.GetUsersUsingGraph(selectedTenant);</code></em>&#8221; Let&#8217; see that now. </p>



<script src="https://gist.github.com/SibeeshVenu/9f8ef9786d7ac321e0524b49d04641ab.js"></script>



<p>I am a fan of keeping things separate, and that is the reason why you are seeing a lot of separations here. I promise that there will only be one more. Here we have a GraphAuthService, and that is when I actually create the graph client and return the provider. Shall we see that now?</p>



<script src="https://gist.github.com/SibeeshVenu/821028ee794b70f893c7e3cab379a0fa.js"></script>



<p>Here we are creating a client credential provider with our tenant given and then create a graph client using that provider. Sounds good? We are getting all the other values from our configuration. In the non-development environment, I am loading the secret from a Key Vault, and for the development environment I load them using the secret.json file, I have already written a blog post about this, you can read it <a rel="noreferrer noopener" href="https://sibeeshpassion.com/why-not-secure-your-keys-and-secrets-asp-net-core-with-azure-key-vault-integration/" target="_blank">here</a>. </p>



<p>As per your need, you should select the authentication provider, <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/graph/sdks/choose-authentication-providers?WT.mc_id=AZ-MVP-5001828&amp;tabs=CS" target="_blank">this post</a> will help you choose one. And we use this client in our façade service to get all the users. You have already seen that. Follow <a rel="noreferrer noopener" href="https://docs.microsoft.com/en-us/graph/sdks/sdk-installation?WT.mc_id=AZ-MVP-5001828" target="_blank">this link</a> to install all the dependencies, in short, install both &#8220;Microsoft. Graph&#8221; and &#8220;Microsoft.Graph.Auth&#8221; Nuget packages at least. </p>



<h2 class="wp-block-heading">Execution</h2>



<p>It is mandatory that you should have a UI application where an admin can grant access to our application, you can also prepare a URLS and sent it to your admin to give the consent, but the UI approach is more feasible. I have an application already that does this. Let&#8217;s run it now and see whether we are able to fetch the users from the different tenants or not. </p>



<p>In short, when the consent is given a new service principal of our application will be created in the tenant to which the admin is granted the consent. You can see this in the Enterprise application section in your Azure AD, check the left-side-pane. This is how the consent screen will look like.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Azure-AD-Consent-Screen.jpg"><img decoding="async" width="500" height="919" src="/wp-content/uploads/2021/02/Azure-AD-Consent-Screen.jpg" alt="" class="wp-image-14303" srcset="/wp-content/uploads/2021/02/Azure-AD-Consent-Screen.jpg 500w, /wp-content/uploads/2021/02/Azure-AD-Consent-Screen-163x300.jpg 163w" sizes="(max-width: 500px) 100vw, 500px" /></a><figcaption>Azure AD Consent Screen</figcaption></figure></div>



<p>Now, as you can see that in the above image, whatever permission our application is requesting, is showing in the consent screen, and some admins will not give the consent if they see a lot of permissions there. This is the reason why it is important to choose the permissions that are needed. In my case, I have one Azure app for the front end and one for the backend, that is the reason why my backend application name is mentioned in the consent screen.</p>



<p>You can update the permissions of your application anytime you wish, and delete the consent given by going to the Enterprise application section in the Azure AD (remember that this is something that you do in the tenant where the application consent is given) and click on the Delete button in the Properties window. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Deleting-Service-Principal-Created.jpg"><img decoding="async" width="1024" height="440" src="/wp-content/uploads/2021/02/Deleting-Service-Principal-Created-1024x440.jpg" alt="" class="wp-image-14312" srcset="/wp-content/uploads/2021/02/Deleting-Service-Principal-Created-1024x440.jpg 1024w, /wp-content/uploads/2021/02/Deleting-Service-Principal-Created-300x129.jpg 300w, /wp-content/uploads/2021/02/Deleting-Service-Principal-Created-768x330.jpg 768w, /wp-content/uploads/2021/02/Deleting-Service-Principal-Created-1536x659.jpg 1536w, /wp-content/uploads/2021/02/Deleting-Service-Principal-Created.jpg 1647w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><figcaption>Deleting the Service Principal Created</figcaption></figure></div>



<p> Now I have updated my application API permission to use only &#8220;User.Read.All&#8221; permission and let&#8217;s see the consent screen now. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/App-Permissions-Consent-Screen-After-Update.jpg"><img decoding="async" width="500" height="869" src="/wp-content/uploads/2021/02/App-Permissions-Consent-Screen-After-Update.jpg" alt="" class="wp-image-14313" srcset="/wp-content/uploads/2021/02/App-Permissions-Consent-Screen-After-Update.jpg 500w, /wp-content/uploads/2021/02/App-Permissions-Consent-Screen-After-Update-173x300.jpg 173w" sizes="(max-width: 500px) 100vw, 500px" /></a><figcaption>App Permissions Consent Screen After Update</figcaption></figure></div>



<p>As my requirement is to fetch only the users, this would still work as it is and here are the debug screenshots to show you that this is actually working. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Users-from-Tenant-1.jpg"><img decoding="async" width="801" height="209" src="/wp-content/uploads/2021/02/Users-from-Tenant-1.jpg" alt="" class="wp-image-14301" srcset="/wp-content/uploads/2021/02/Users-from-Tenant-1.jpg 801w, /wp-content/uploads/2021/02/Users-from-Tenant-1-300x78.jpg 300w, /wp-content/uploads/2021/02/Users-from-Tenant-1-768x200.jpg 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><figcaption>Users from Tenant 1</figcaption></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="/wp-content/uploads/2021/02/Users-from-Tenant-2.jpg"><img decoding="async" width="799" height="209" src="/wp-content/uploads/2021/02/Users-from-Tenant-2.jpg" alt="" class="wp-image-14302" srcset="/wp-content/uploads/2021/02/Users-from-Tenant-2.jpg 799w, /wp-content/uploads/2021/02/Users-from-Tenant-2-300x78.jpg 300w, /wp-content/uploads/2021/02/Users-from-Tenant-2-768x201.jpg 768w" sizes="(max-width: 799px) 100vw, 799px" /></a><figcaption>Users from Tenant 2</figcaption></figure></div>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Congratulations and thanks a lot for being with me this far. In this post, we have seen that how we can get the users from different tenants using the Azure AD App registration with application permission. Happy Coding!.</p>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards</p>



<p>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/get-users-from-different-tenants-using-azure-ad-application-permission/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
