To create a federated service connection manually, the schema must include:
"authorization": {
"scheme": "WorkloadIdentityFederation",
"parameters": {
"clientId": "<your-app-registration-or-managed-identity-client-id>",
"tenantId": "<your-tenant-id>"
}
Here the "scheme": "WorkloadIdentityFederation" and the clientId must match the federated identity credential in Entra.
You’ll need to manually set up the federated credential using issuer and subject.
Issuer - https://vstoken.dev.azure.com/<your-org-id>/ - You will get the organization id from your Azure DevOps URL.
Subject - sc://<organization-name>/<project-name>/<service-connection-name> - You will get your actual DevOps org, project, and connection names.
Once you have these, go to Microsoft Entra -> App registrations -> Your App > Federated credentials, and create a new credential using:
- Issuer: as above
- Subject: as above
- Audience: api://AzureADTokenExchange
Example:
az ad app federated-credential create \
--id <service-principal-object-id> \
--parameters '{
"name": "ado-acr-federation",
"issuer": "https://vstoken.dev.azure.com/<org-id>/",
"subject": "repo:<org>/<project>/<repo>:ref:refs/heads/main",
"audiences": ["api://AzureADTokenExchange"]
}'
Hope this helps!
Please Let me know if you have any queries.