Skip to content

Commit 8de2249

Browse files
Document new MI as FIC feature in Microsoft.Extensions.Azure (#46811)
* Document new MI as FIC feature in Microsoft.Extensions.Azure * Add missing word * Update docs/azure/sdk/authentication/create-token-credentials-from-configuration.md Co-authored-by: Christopher Scott <[email protected]> * Update docs/azure/sdk/authentication/create-token-credentials-from-configuration.md Co-authored-by: Christopher Scott <[email protected]> --------- Co-authored-by: Christopher Scott <[email protected]>
1 parent 6d16a5b commit 8de2249

File tree

1 file changed

+64
-7
lines changed

1 file changed

+64
-7
lines changed

docs/azure/sdk/authentication/create-token-credentials-from-configuration.md

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create Azure Identity library credentials via configuration files
33
description: Learn how to create token credentials from configuration files.
44
ms.topic: how-to
55
ms.custom: devx-track-dotnet, engagement-fy23
6-
ms.date: 03/14/2025
6+
ms.date: 06/13/2025
77
---
88

99
# Create Azure Identity library credentials via configuration files
@@ -67,9 +67,23 @@ Add the wildcard value `*` to allow the credential to acquire tokens for any Mic
6767

6868
### Create an instance of `ManagedIdentityCredential`
6969

70-
You can create both user-assigned and system-assigned managed identities using configuration values. To create an instance of <xref:Azure.Identity.ManagedIdentityCredential?displayProperty=fullName>, add the following key-value pairs to your _appsettings.json_ file.
70+
You can configure a credential to utilize a managed identity in the following ways using configuration values:
7171

72-
#### User-assigned managed identities
72+
- System-assigned managed identity
73+
- User-assigned managed identity
74+
- Managed identity as a federated identity credential
75+
76+
To create an instance of <xref:Azure.Identity.ManagedIdentityCredential?displayProperty=fullName>, add the following key-value pairs to your _appsettings.json_ file.
77+
78+
#### System-assigned managed identity
79+
80+
```json
81+
{
82+
"credential": "managedidentity"
83+
}
84+
```
85+
86+
#### User-assigned managed identity
7387

7488
A user-assigned managed identity can be used by providing a client ID, resource ID, or object ID.
7589

@@ -78,7 +92,7 @@ A user-assigned managed identity can be used by providing a client ID, resource
7892
```json
7993
{
8094
"credential": "managedidentity",
81-
"clientId": "<client_id>"
95+
"managedIdentityClientId": "<managed_identity_client_id>"
8296
}
8397
```
8498

@@ -91,7 +105,7 @@ A user-assigned managed identity can be used by providing a client ID, resource
91105
}
92106
```
93107

94-
The resource ID takes the form:
108+
The resource ID takes the form
95109
`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}`
96110

97111
## [Object ID](#tab/object-id)
@@ -108,14 +122,57 @@ The resource ID takes the form:
108122
109123
---
110124

111-
#### System-assigned managed identities
125+
#### Managed identity as a federated identity credential
126+
127+
The [managed identity as a federated identity credential](/entra/workload-id/workload-identity-federation-config-app-trust-managed-identity?tabs=microsoft-entra-admin-center%2Cdotnet) feature is supported in `Microsoft.Extensions.Azure` versions 1.12.0 and later. The feature doesn't work with system-assigned managed identity. The credential can be configured with a user-assigned managed identity by providing a client ID, resource ID, or object ID.
128+
129+
## [Client ID](#tab/client-id)
112130

113131
```json
114132
{
115-
"credential": "managedidentity"
133+
"credential": "managedidentityasfederatedidentity",
134+
"azureCloud": "<azure_cloud>",
135+
"tenantId": "<tenant_id>",
136+
"clientId": "<client_id>",
137+
"managedIdentityClientId": "<managed_identity_client_id>"
138+
}
139+
```
140+
141+
## [Resource ID](#tab/resource-id)
142+
143+
```json
144+
{
145+
"credential": "managedidentityasfederatedidentity",
146+
"azureCloud": "<azure_cloud>",
147+
"tenantId": "<tenant_id>",
148+
"clientId": "<client_id>",
149+
"managedIdentityResourceId": "<managed_identity_resource_id>"
116150
}
117151
```
118152

153+
The resource ID takes the form
154+
`/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}`
155+
156+
## [Object ID](#tab/object-id)
157+
158+
```json
159+
{
160+
"credential": "managedidentityasfederatedidentity",
161+
"azureCloud": "<azure_cloud>",
162+
"tenantId": "<tenant_id>",
163+
"clientId": "<client_id>",
164+
"managedIdentityObjectId": "<managed_identity_object_id>"
165+
}
166+
```
167+
168+
---
169+
170+
The `azureCloud` key value is used to set the Microsoft Entra access token scope. It can be one of the following values:
171+
172+
- `public` for Azure Public Cloud
173+
- `usgov` for Azure US Government Cloud
174+
- `china` for Azure operated by 21Vianet
175+
119176
### Create an instance of `AzurePipelinesCredential`
120177

121178
To create an instance of <xref:Azure.Identity.AzurePipelinesCredential?displayProperty=fullName>, add the following key-value pairs to your _appsettings.json_ file:

0 commit comments

Comments
 (0)