How to create a service endpoint using az devops cli?

Karnati, Manideep 0 Reputation points
2025-03-14T14:03:19.1433333+00:00

Hi, Is there an approach to create a azure rm service connection with user assigned managed identity?
I have used copilot and ended up with below , however it does not work.
{

"name": "AzureRM-ServiceConnection",

"type": "azurerm",

"authorization": {

"scheme": "ManagedServiceIdentity",

"parameters": {

  "clientId": "your-user-assigned-managed-identity-client-id"

}

},

"data": {

"subscriptionId": "your-subscription-id",

"subscriptionName": "your-subscription-name",

"environment": "AzureCloud",

"tenantId": "your-tenant-id"

},

"isShared": false,

"owner": "library"

}

az devops service-endpoint create \
  --service-endpoint-configuration service-connection.json \
  --organization https://dev.azure.com/my-org \
  --project my-project

Azure DevOps
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Damilola Onadeinde 475 Reputation points
    2025-03-16T17:54:48.29+00:00

    You can use this command. I have just tried it and it worked for me

    az devops service-endpoint azurerm create \

    --name "AzureRM-ServiceConnection" \

    --azure-rm-tenant-id "" \

    --azure-rm-subscription-id "" \

    --azure-rm-subscription-name "" \

    --azure-rm-service-principal-id "" \

    --organization https://dev.azure.com/<ado-organization> \

    --project ado-project
    User's image

    when you run the command, it would ask you to enter principal key. Just enter any value (as password). then repeat the same value then finally hit enter button.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.