You need Azure Service Connection to connect Azure DevOps with your Service Principal to be able to deploy applications to your Azure subscription. This is in a way your connection between Azure DevOps and your Azure Portal.

Go to your Azure DevOps project. How to create an Azure DevOps account, read my blog here.

Azure DevOps

then click on Project settings and find Service connections under Pipelines

and click on Create service connection

Choose Azure Resource Manager and click Next

Choose Service principal (manual), I prefer to use manual, feeling like you have full control what you are doing.

Click Next.

Fill out the form

  • Environment: AzureCloud
  • Scope Level: Subscription
  • Subscription Id, to get Subscription Id you can use Azure CLI and run command
az login

If you don't have Azure CLI installed, do it from here! You are going to love it, I promise :-)

The response is like this

az login

Here you have your Subscription Id, Subscription name and Tenant ID

To find values for Service principal Id and Service principal key read my blog Create Service Principal

Verify connection.

Provide meaningful name and description and Verify and save.

Now we can use this connection to deploy our applications.


Create Azure DevOps account

Create Service Principal

Azure CLI