I need to create a connection from many projects in Azure DevOps to my subscription in Azure. I also need him will be from type azure resource manager and that their service principal will be create automatily.
I try to use Azure CLI but the only solution that I found to create azureRM (as written in this link: create azurerm service endpoint) but you need to give him a service principal that already exists.
How I can create a service connection that will be created automatically service principal? like in the UI options: azurerm - service principal (aoutomatic)
Unfortunately, There's no other command to create Azure Service connection automatically. Refer here And for service principal and managed identity you need to create it manually. Refer here.
As this option is still in Public Preview not all features are available.
You need to create it with the
CLI commandbelow, by mentioning your Service Principal details:-CLI Command:-
Output:-
You can achieve same result with Azure CLI Task in Azure DevOps:-
YAML pipeline:-
You can also call the Rest API to achieve the same task, Refer this SO Answer