Azure + Azure DevOps = Magic
Azure DevOps Service Connection with Multiple Azure Resource Group
--
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.
As you know that we can easily achieve a lot of automation by combining Azure DevOps and Azure Services. 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 Azure DevOps service connection 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.
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 "azureSubscription"
option in the pipeline tasks. I was getting the preceding error when I try with the existing service connection.
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'
##[error]Error: Resource…