6

I have created a new service connection in Azure devops I want to fetch it's id unable to find it anywhere in Azure devops portal

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

6

You can use the following endpoint to get the id,

https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints?api-version=5.0-preview.2

According to docs, it will return a json as

{ "count": 1, "value": [ { "data": { "SubscriptionId": "12345678-1234-1234-1234-123456789012", "SubscriptionName": "TestSubscriptionName", "environment": "AzureCloud" }, "id": "4b16dc87-22a0-45f9-82d8-2e295c4597c6", "name": "TestEndpoint", "type": "Azure", "url": "https://management.core.windows.net/", "createdBy": { "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227", "uniqueName": "fabfiber@outlook.com", "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227", "displayName": "Chuck Reinhart", "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227" }, "authorization": { "scheme": "Certificate" }, "isReady": true } ] }

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396