Skip to main content
Version: Next

Azure DevOps connections

The azure connection type represents an Azure DevOps host. It has multiton cardinality and uses the host lookup strategy.

Configure Azure DevOps​

app-config.yaml
connections:
- type: azure
host: dev.azure.com
auth:
- method: pat
personalAccessToken: ${AZURE_DEVOPS_TOKEN}
orgs:
- acme

Connection fields​

FieldTypeRequiredDescription
hoststringYesAzure DevOps host matched against the consumer's resource URL.

Authentication methods​

MethodFieldTypeRequiredDescription
noneNone——Does not accept authentication fields.
patpersonalAccessTokenstringYesAzure DevOps personal access token.
patorgsstring[]NoAzure DevOps organizations using the token.
clientCredentialsclientIdstringYesMicrosoft Entra ID client ID.
clientCredentialsclientSecretstringYesMicrosoft Entra ID client secret.
clientCredentialstenantIdstringYesMicrosoft Entra ID tenant ID.
clientCredentialsorgsstring[]NoAzure DevOps organizations using the credentials.
managedIdentityclientIdstringYesClient ID of the managed identity or app registration to authenticate as.
managedIdentitytenantIdstringNoMicrosoft Entra ID tenant ID used with a managed identity client assertion.
managedIdentitymanagedIdentityClientIdstringNoClient ID of the identity generating the assertion, or system-assigned.
managedIdentityorgsstring[]NoAzure DevOps organizations using the identity.

orgs is returned to consumers as static configuration. The connection service does not use it when selecting an Azure authentication entry. A credential provider can use it to select or constrain Azure DevOps organizations.

Use none explicitly when the consumer can access the target without authentication.

Lookup and selection​

The consumer supplies a lookup query containing an Azure DevOps URL. The service selects the connection whose host matches the parsed URL host exactly.

When more than one authentication entry is visible to the calling plugin, the first visible entry is selected. Use plugin scoping to supply different credentials to a specific plugin; otherwise, configuration order determines which entry is selected.

Consume an Azure DevOps connection​

const connection = await connections.find({
type: 'azure',
query: { url: 'https://dev.azure.com/acme/project/_git/repository' },
authMethods: ['pat', 'clientCredentials', 'managedIdentity', 'none'],
});

if (connection.auth.method === 'pat') {
connection.auth.personalAccessToken; // string
connection.auth.orgs; // string[] | undefined
}

Return to the built-in connection type index.