You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pipelines/library/connect-to-azure.md
+19-17
Original file line number
Diff line number
Diff line change
@@ -25,15 +25,15 @@ You have multiple options for connecting to Azure by using Azure Resource Manage
25
25
* Service principal with secret
26
26
* Agent-assigned managed identity
27
27
28
-
> To learn about other types of connections and for general information about creating and using connections, see [Service connections for builds and releases](service-endpoints.md).
28
+
To learn about other types of connections and for general information about creating and using connections, see [Service connections for builds and releases](service-endpoints.md).
## Create an Azure Resource Manager service connection that uses workload identity federation
35
35
36
-
[Workload identity federation](/azure/active-directory/workload-identities/workload-identity-federation) uses OpenID Connect to authenticate with Microsoft Entra protected resources without needing to manage secrets.
36
+
[Workload identity federation](/azure/active-directory/workload-identities/workload-identity-federation) uses OpenID Connect (OIDC) to authenticate with Microsoft Entra protected resources without using secrets.
37
37
38
38
We recommend that you use this approach if all the following items are true for your scenario:
39
39
@@ -44,15 +44,17 @@ We recommend that you use this approach if all the following items are true for
44
44
45
45
### Create a new workload identity federation service connection
46
46
47
-
1. In the Azure DevOps project, go to **Project settings** > **Service connections**[project settings page](../../project/navigation/go-to-service-page.md#open-project-settings).
47
+
1. In the Azure DevOps project, go to **Project settings** > **Service connections**.
48
+
49
+
For more information, see [Open project settings](../../project/navigation/go-to-service-page.md#open-project-settings).
48
50
49
51
1. Select **New service connection**, and then select **Azure Resource Manager**.
50
52
51
-

53
+
:::image type="content" source="media/new-service-connection-azure-resource-manager.png" alt-text="Screenshot that shows choosing a workload identity service connection type.":::

57
+
:::image type="content" source="media/select-workload-identity-service.png" alt-text="Screenshot that shows selecting a workload identity service connection type.":::
56
58
57
59
1. Specify the following parameters:
58
60
@@ -103,7 +105,7 @@ To revert a service connection:
103
105
104
106
1. Select **Revert conversion to the original scheme**.
105
107
106
-
:::image type="content" source="media/federated-revert-credential.png" alt-text="Screenshot that shows selecting revert for a federated credential.":::
108
+
:::image type="content" source="media/federated-revert-credential.png" alt-text="Screenshot that shows selecting revert for a federated credential.":::
107
109
108
110
1. Select **Revert** again to confirm your choice.
109
111
@@ -130,7 +132,7 @@ To create the service connection:
130
132
131
133
1. Select **New service connection**, and then select **Azure Resource Manager**.
132
134
133
-

135
+
:::image type="content" source="media/new-service-endpoint-2.png" alt-text="Screenshot that shows choosing a service connection type.":::
134
136
135
137
1. Enter or select the following parameters:
136
138
@@ -156,7 +158,7 @@ To create the service connection:
156
158
>
157
159
> When you follow this approach, Azure DevOps *connects with Microsoft Entra ID and creates an app registration with a secret that's valid for three months*. When the service connection is about to expire, Microsoft Entra ID displays this prompt: **A certificate or secret is expiring soon. Create a new one**. In this scenario, you must refresh the service connection.
158
160
>
159
-
> To refresh a service connection, in the Azure DevOps portal, edit the connection and then select **Verify**. After you save the edit, the service connection is valid for another three months.
161
+
> To refresh a service connection, in the Azure DevOps portal, edit the connection, and then select **Verify**. After you save the edit, the service connection is valid for another three months.
160
162
>
161
163
> We recommend that you use workload identity federation instead of creating a secret. If you use workload identity federation, you don't need to rotate secrets, and app registration maintains its intended purpose. To start using workload identity federation, go to the service connection details page and select **Convert**. The service connection is converted to use workload identity federation instead of a secret. For more information, see [Convert an existing Azure Resource Manager service connection to use workload identity federation](#convert-an-existing-azure-resource-manager-service-connection-to-use-workload-identity-federation).
162
164
>
@@ -184,11 +186,11 @@ If you have problems using this approach (such as no subscriptions shown in the
184
186
185
187
1. Select **New service connection**, and then select **Azure Resource Manager**.
186
188
187
-

189
+
:::image type="content" source="media/new-service-endpoint-2.png" alt-text="Screenshot that shows choosing a service connection type.":::
188
190
189
191
1. Select the **Service Principal (manual)** option, and then enter the service principal details.
190
192
191
-

193
+
:::image type="content" source="media/rm-endpoint-link.png" alt-text="Screenshot that shows opening the full version of the service dialog.":::
192
194
193
195
1. For **Connection name**, enter a display name to use to refer to this service connection.
194
196
@@ -226,7 +228,7 @@ For more information, see [Troubleshoot Azure Resource Manager service connectio
226
228
227
229
<aname="use-msi"></a>
228
230
229
-
## Create an Azure Resource Manager service connection to a virtual machine that uses a managed service identity
231
+
## Create an Azure Resource Manager service connection to a VM that uses a managed service identity
230
232
231
233
> [!NOTE]
232
234
>
@@ -242,11 +244,11 @@ You can configure Azure VM-based agents to use an [Azure Managed Service Identit
242
244
243
245
1. Select **New service connection**, and then select **Azure Resource Manager**.
244
246
245
-

247
+
:::image type="content" source="media/new-service-endpoint-2.png" alt-text="Screenshot that shows choosing a service connection type.":::
246
248
247
249
1. Select the **Managed Identity Authentication** option.
248
250
249
-

251
+
:::image type="content" source="media/rm-endpoint-msi.png" alt-text="Screenshot that shows going to the managed service identity settings.":::
250
252
251
253
1. For **Connection name**, enter a display name to use when you refer to this service connection.
252
254
@@ -270,13 +272,13 @@ You can configure Azure VM-based agents to use an [Azure Managed Service Identit
270
272
For more information, see [How can I use managed identities for Azure resources?](/azure/active-directory/managed-identities-azure-resources/overview#how-can-i-use-managed-identities-for-azure-resources) and
271
273
[Use role-based access control to manage access to your Azure subscription resources](/azure/role-based-access-control/role-assignments-portal).
272
274
273
-
For more information, see [Troubleshoot Azure Resource Manager service connections](../release/azure-rm-endpoint.md).
275
+
For more information about the process, see [Troubleshoot Azure Resource Manager service connections](../release/azure-rm-endpoint.md).
274
276
275
277
<aname="connect-govt"></a>
276
278
277
279
## Connect to an Azure Government Cloud
278
280
279
-
For information about connecting to an Azure Government Cloud, see [Connecting from Azure Pipelines (Azure Government Cloud)](/azure/azure-government/documentation-government-get-started-connect-with-vsts).
281
+
For information about connecting to an Azure Government Cloud, see [Connect from Azure Pipelines (Azure Government Cloud)](/azure/azure-government/documentation-government-get-started-connect-with-vsts).
280
282
281
283
<aname="connect-stack"></a>
282
284
@@ -285,7 +287,7 @@ For information about connecting to an Azure Government Cloud, see [Connecting f
285
287
For information about connecting to Azure Stack, see these articles:
286
288
287
289
*[Connect to Azure Stack](/azure/azure-stack/azure-stack-connect-azure-stack)
288
-
*[Connect Azure Stack to Azure by using VPN](/azure/azure-stack/azure-stack-connect-vpn)
289
-
*[Connect Azure Stack to Azure by using ExpressRoute](/azure/azure-stack/azure-stack-connect-expressroute)
290
+
*[Connect Azure Stack to Azure by using a VPN](/azure/azure-stack/azure-stack-connect-vpn)
291
+
*[Connect Azure Stack to Azure by using Azure ExpressRoute](/azure/azure-stack/azure-stack-connect-expressroute)
# Manually set an Azure Resource Manager workload identity service connection
14
14
15
-
When you [troubleshoot an Azure Resource Manager workload identity service connection](troubleshoot-workload-identity.md#i-dont-have-permissions-to-create-a-service-principal-in-the-micrososft-entra-tenant), you might need to manually configure the connection instead of using the automated tool.
15
+
When you [troubleshoot an Azure Resource Manager workload identity service connection](troubleshoot-workload-identity.md#i-dont-have-permissions-to-create-a-service-principal-in-the-micrososft-entra-tenant), you might need to manually configure the connection instead of using the automated tool that's available in Azure DevOps.
16
16
17
17
We recommend that you [try the automated approach](../library/connect-to-azure.md#create-an-azure-resource-manager-service-connection-that-uses-workload-identity-federation) before you begin a manual configuration.
18
18
19
19
There are two options for authentication: use a managed identity or use a service principal. The advantage of the managed identity option is that you can use it if you don't have permissions to create service principals or if you're using a different Microsoft Entra tenant than your Azure DevOps user.
20
20
21
-
## Workload identity by using managed identity authentication
21
+
## Set a workload identity service connection to use managed identity authentication
22
22
23
23
You might need to manually create a managed identity that uses federated credentials, and then grant the required permissions. You can also use the REST API for this process.
24
24
@@ -111,7 +111,7 @@ You might need to manually create a managed identity that uses federated credent
111
111
112
112
1. In Azure DevOps, select **Verify and save**.
113
113
114
-
## Workload identity by using service principal authentication
114
+
## Set a workload identity service connection to use service principal authentication
115
115
116
116
You might need to manually create a service principal that has federated credentials, and then grant the required permissions. You can also use the REST API for this process.
117
117
@@ -192,7 +192,7 @@ You might need to manually create a service principal that has federated credent
192
192
193
193
:::image type="content" source="approvals/media/federated-credentials-devops.png" alt-text="Screenshot that shows DevOps credentials for federated authentication.":::
194
194
195
-
1. In the Azure portal, return to your app registration federated credential.
195
+
1. In the Azure portal, return to your app registration federated credentials.
196
196
197
197
1. Paste the values for **Issuer** and **Subject identifier** that you copied from your Azure DevOps project into your federated credentials in the Azure portal.
Copy file name to clipboardExpand all lines: docs/pipelines/release/troubleshoot-workload-identity.md
+17-9
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,19 @@ Get help debugging common issues with workload identity service connections. You
17
17
18
18
## Troubleshooting checklist
19
19
20
-
Use the following checklist to troubleshoot issues with workload identity service connections.
20
+
Use the following checklist to troubleshoot issues with workload identity service connections:
21
+
22
+
- Review pipeline tasks to ensure that they support workload identity.
23
+
- Verify that workload identity federation is active for the tenant.
24
+
- Check the issuer URL and federation subject for accuracy.
25
+
26
+
The following sections describe the issues and how to resolve them.
21
27
22
28
### Review pipeline tasks
23
29
24
-
Not all pipelines tasks support workload identity. During the preview, no Azure Marketplace tasks support workload identity service connections. The following tasks don't currently support workload identity federation:
30
+
Not all pipelines tasks support workload identity. During the preview, no Azure Marketplace tasks support workload identity service connections.
31
+
32
+
The following tasks currently don't support workload identity federation:
@@ -39,9 +47,9 @@ Verify that there are no Microsoft Entra policies in place that block federated
39
47
40
48
### Check the issuer URL for accuracy
41
49
42
-
If you see a message that indicates `no matching federated identity record found`, either the issuer URL or the federation subject doesn't match. The correct issuer URL starts with `https://vstoken.dev.azure.com`.
50
+
If you see a message that indicates **no matching federated identity record found**, either the issuer URL or the federation subject don't match. The correct issuer URL starts with `https://vstoken.dev.azure.com`.
43
51
44
-
You can fix the issuer URL by editing and saving the service connection to update the issuer URL. If Azure DevOps didn't create the identity, the issuer must be updated manually. For Azure identities, the issuer URL automatically updates.
52
+
You can fix the issuer URL by editing and saving the service connection to update the issuer URL. If Azure DevOps didn't create the identity, the issuer URL must be updated manually. For Azure identities, the issuer URL automatically updates.
45
53
46
54
## Common issues
47
55
@@ -57,23 +65,23 @@ You must either have permissions in Microsoft Entra ID to create app registratio
57
65
58
66
You have two options to resolve the issue:
59
67
60
-
-[Solution 1: Manually configure workload identity by using managed identity authentication](configure-workload-identity.md#workload-identity-by-using-managed-identity-authentication)
61
-
-[Solution 2: Manually configure workload identity by using service principal authentication](configure-workload-identity.md#workload-identity-by-using-service-principal-authentication)
68
+
-[Solution 1: Manually configure workload identity by using managed identity authentication](configure-workload-identity.md#set-a-workload-identity-service-connection-to-use-managed-identity-authentication)
69
+
-[Solution 2: Manually configure workload identity by using service principal authentication](configure-workload-identity.md#set-a-workload-identity-service-connection-to-use-service-principal-authentication)
62
70
63
71
### I use a container resource that specifies an instance of Azure Container Registry
64
72
65
73
[Container resources](/azure/devops/pipelines/process/resources?view#define-a-containers-resource) that are pulled from Azure Container Registry don't support a workload identity federation service connection that's specified in `azureSubscription`.
66
74
67
75
## Error messages
68
76
69
-
The following table identifies common error messages and an issue that might generate each message:
77
+
The following table identifies common error messages and issues that might generate them:
70
78
71
-
| Message |Plausible issue |
79
+
| Message |Possible issue |
72
80
|---------|-----------------|
73
81
|**cannot request token: Get `?audience=api://AzureADTokenExchange: unsupported protocol scheme`**| The task doesn't support workload identity federation. |
74
82
|**Identity not found**| The task doesn't support workload identity federation. |
75
83
|**Could not fetch access token for Azure**| The task doesn't support workload identity federation. |
76
-
|**AADSTS700016: Application with identifier '****' wasn't found**| The identity that is used for the service connection no longer exists or it might have been removed independently from the service connection. Create a new service connection. |
84
+
|**AADSTS700016: Application with identifier '****' wasn't found**| The identity that is used for the service connection no longer exists or it might have been removed from the service connection. In this scenario, create a new service connection. |
77
85
|**AADSTS7000215: Invalid client secret provided.**| You're using a service connection that has an expired secret. [Convert the service connection to workload identity federation](https://aka.ms/azdo-rm-workload-identity-conversion) and replace the expired secret with federated credentials. |
78
86
| **AADSTS700024: Client assertion is not within its valid time range** | This error might occur in the following cases:<br />- You're using an AzureCLI task with `addSpnToEnvironment` set to `true` to consume the `idToken` environment variable. The `idToken` environment variable expires after 10 minutes.<br />- Some Azure data plane (non-Azure Resource Manager) operations require a separate bearer token to authenticate. You request a bearer token in the Azure CLI by using `az account get-access-token` or in Azure PowerShell by using Get-AzAccessToken. These tokens have a lifetime of one hour. Using the token after one hour results in an `AADSTS700024` error. Some tools and SDKs (for example, [Azure GO SDK](https://github.com/Azure/azure-sdk-for-go) and [Azure Python SDK](/azure/developer/python/sdk/azure-sdk-overview)) use the Azure CLI and `az account get-access-token` indirectly to obtain a bearer token. If you have tasks that (directly or indirectly) obtain a bearer token and run longer than one hour, use a service connection with a secret instead. |
79
87
|**AADSTS70021: No matching federated identity record found for presented assertion. Assertion Issuer: `https://app.vstoken.visualstudio.com`.**| The issuer URL isn't correct. The correct issuer URL has the format `https://vstoken.dev.azure.com/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX`. You can fix the issuer URL by editing and then saving a service connection. If Azure DevOps didn't create your identity, you must manually update the issuer. You can find the correct issuer in the edit dialog of the service connection or in the response (under authorization parameters) if you use the REST API. |
0 commit comments