Azure Service Connection
How Walkerscott connects Azure DevOps to the deployment App Registration with workload identity federation, and the federated credential that you add.
The deployment pipeline in Azure DevOps signs in to Azure through an Azure DevOps service connection, as the deployment App Registration that you created in phase 1.
The service connection uses workload identity federation. There is no password or client secret to store, send or renew. Instead, the App Registration trusts the one Azure DevOps service connection that you tell it about.
How It Works
| Step | Task | Who |
|---|---|---|
| 1 | Create the service connection in Azure DevOps, and send you two values. | Walkerscott. |
| 2 | Add the federated credential to the App Registration. | You, or Walkerscott if we created the App Registration. |
| 3 | Verify the service connection. | Walkerscott. |
To add the federated credential, you must be an owner of the App Registration, or have the Application Administrator Microsoft Entra role. If you created the App Registration, you are already an owner.
Create the Service Connection
Walkerscott does this step, in the Walkerscott Azure DevOps project or in your Azure DevOps project. When it is done, we send you two values: the Issuer and the Subject identifier.
For reference, we create the service connection like this:
- In the Azure DevOps project, go to Project settings > Service connections > New service connection > Azure Resource Manager.
- Select App registration or Managed identity (manual) and the Workload identity federation credential.
- Enter the service connection name and your Directory (tenant) ID.
- Select the Subscription scope level, and enter your subscription ID and name, and the App Registration's Application (client) ID.
- Copy the Issuer and Subject identifier, and click Keep as draft.
See Manually set an Azure Resource Manager workload identity service connection for more details.
Add the Federated Credential
The federated credential tells the App Registration to trust the service connection. If Walkerscott created the App Registration, we do this step.
- In the Azure portal, open App registrations, and click the App Registration.
- Click Manage > Certificates & secrets.
- Click the Federated credentials tab, then + Add credential.
- For Federated credential scenario, select Other issuer.
- Paste the Issuer that we sent you into Issuer.
- For Type, select Explicit subject identifier, and paste the Subject identifier that we sent you into Value.
- Enter a Name, for example
klevr-integration-hub-production. - Leave Audience as
api://AzureADTokenExchange. - Click Add.
When it is done, the Federated credentials tab shows the new credential. Tell us, so that we can do step 3.
The Issuer and Subject identifier must match exactly, with no extra spaces at the start or end. One different character stops the service connection from signing in.
Each service connection needs its own federated credential. If you have more than one environment, for example staging and production, we send you a Subject identifier for each one, and you add a federated credential for each.
Verify the Service Connection
Walkerscott opens the draft service connection in Azure DevOps, and clicks Finish setup > Verify and save. When the verification succeeds, the service connection is ready, and we can deploy Integration Hub.
Troubleshooting
If the verification in step 3 fails, we tell you the error. These are the most common errors:
| Error | Cause | Fix |
|---|---|---|
| The subscription is not found, or the service connection cannot list the subscription. | The App Registration has no role on the subscription. | Give the App Registration Reader on the subscription (Option B), or Owner on the subscription (Option A). See Assign the Azure Roles. |
AADSTS700213: No matching federated identity record found | The Issuer or Subject identifier in the federated credential does not match the service connection. | Open the federated credential, and compare both values with the values that we sent you. Remove any extra spaces. |
AADSTS700016: Application not found in the directory | The Application (client) ID or the Directory (tenant) ID is wrong. | Check both values on the Overview page of the App Registration, and send them to us again. |
The deployment fails with AuthorizationFailed on a role assignment. | The App Registration does not have Owner, or the Owner role has a condition that blocks the assignment. | Check the role assignment and its condition. See Assign the Azure Roles. |
Last updated on