I need to create Azure Service Connection, I can create the same using UI in Azure DevOps portal. But I need to know if I can create the same using some Az command or ARM Template or any Powershell script ?
Asked
Active
Viewed 473 times
0
-
Have you checked my reply? If it helps you, you could [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), this can be beneficial to other community members reading this thread. – Cece Dong - MSFT Jul 29 '20 at 09:48
-
can I use my existing Service Principal details to create new service connection using "az devops service-endpoint create" ? – KRM Jul 30 '20 at 07:13
2 Answers
1
Did you take a look at https://learn.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints/create?view=azure-devops-rest-6.0 ? Here, You can manage Azure services using Azure REST API.

Vikram Barche
- 11
- 2
1
You can create service endpoint via REST API or Azure DevOps CLI.
REST API:
POST https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints?api-version=5.1-preview.2
Azure DevOps CLI:
az devops service-endpoint create

Cece Dong - MSFT
- 29,631
- 1
- 24
- 39
-
can I use my existing Service Principal details to create new service connection using "az devops service-endpoint create" ? – KRM Jul 30 '20 at 07:12
-
You can create service endpoint using configuration file, and capture network trace (using tool of your preference like Fiddler, Chrome Developer tool) of existing Service Principal details: https://learn.microsoft.com/en-us/azure/devops/cli/service_endpoint?view=azure-devops#create-service-endpoint-using-configuration-file. – Cece Dong - MSFT Jul 30 '20 at 09:40
-