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

then click on Project settings and find Service connections under Pipelines

and click New service connection

Choose Azure Resource Manager

For free Azure accounts you can just use Service Principal Authentication
Provide Connection Name and click OK then login


Wait for a while and that's it, you have created behind the scenes a new service principle. You have a connection you can use.
If you get error message like this or you don't want to create a new service principle

Follow along

Click on use the full version of the service connection dialog

As you can see
- Connection name - just choose one
- Environment is AzureCloud
- Subscription ID is predefined, if it is not predefined 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

Here you have your Subscription ID, Subscription name and Tenant ID
To find out Service principal client ID and Service principal key read my blog Create Service Principle
Verify connection

Here is our connection, we can use
