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
Improve Azure Identity credential env var docs (Azure#47889)
* Improve DAC env var docs
* Edit pass
* Revert changes to EBN properties
* Update DAC options XML docs
* Improve XML docs for options classes
* Update sdk/identity/Azure.Identity/src/Credentials/EnvironmentCredentialOptions.cs
Co-authored-by: Christopher Scott <[email protected]>
---------
Co-authored-by: Christopher Scott <[email protected]>
Copy file name to clipboardExpand all lines: sdk/identity/Azure.Identity/README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,7 +270,7 @@ Not all credentials require this configuration. Credentials that authenticate th
270
270
271
271
## Environment variables
272
272
273
-
[`DefaultAzureCredential`][ref_DefaultAzureCredential] and [`EnvironmentCredential`][ref_EnvironmentCredential] can be configured with environment variables. Each type of authentication requires values for specific variables.
273
+
[`DefaultAzureCredential`][ref_DefaultAzureCredential] and [`EnvironmentCredential`][ref_EnvironmentCredential] can be configured with environment variables. Each type of authentication requires values for specific variables. Configuration is attempted in the order in which these environment variables are listed. For example, if values for a client secret and certificate are both present, the client secret is used by `EnvironmentCredential`.
274
274
275
275
### Service principal with secret
276
276
@@ -299,13 +299,17 @@ Not all credentials require this configuration. Credentials that authenticate th
299
299
|`AZURE_USERNAME`|a username (usually an email address)
300
300
|`AZURE_PASSWORD`|that user's password
301
301
302
-
### Managed identity (`DefaultAzureCredential`)
302
+
### Workload identity (`DefaultAzureCredential`)
303
303
304
304
|Variable name|Value
305
305
|-|-
306
-
|`AZURE_CLIENT_ID`|The client ID for the user-assigned managed identity. If defined, used as the default value for `ManagedIdentityClientId` in `DefaultAzureCredentialOptions`
306
+
|`AZURE_CLIENT_ID`|The client ID of the application the workload identity will authenticate. If defined, used as the default value for `WorkloadIdentityClientId` in `DefaultAzureCredentialOptions`.
307
+
308
+
### Managed identity (`DefaultAzureCredential`)
307
309
308
-
Configuration is attempted in the order in which these environment variables are listed. For example, if values for a client secret and certificate are both present, the client secret is used.
310
+
|Variable name|Value
311
+
|-|-
312
+
|`AZURE_CLIENT_ID`|The client ID for the user-assigned managed identity. If defined, used as the default value for `ManagedIdentityClientId` in `DefaultAzureCredentialOptions`.
Copy file name to clipboardExpand all lines: sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs
+20-10Lines changed: 20 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,9 @@ public T Value
48
48
/// <summary>
49
49
/// The ID of the tenant to which the credential will authenticate by default. If not specified, the credential will authenticate to any requested tenant, and will default to the tenant to which the chosen authentication method was originally authenticated.
50
50
/// </summary>
51
+
/// <remarks>
52
+
/// Defaults to the value of environment variable <c>AZURE_TENANT_ID</c>.
53
+
/// </remarks>
51
54
publicstringTenantId
52
55
{
53
56
get=>_tenantId.Value;
@@ -101,7 +104,7 @@ public string InteractiveBrowserTenantId
101
104
}
102
105
103
106
/// <summary>
104
-
/// Specifies the tenant id of the preferred authentication account, to be retrieved from the shared token cache for single sign on authentication with
107
+
/// Specifies the tenant ID of the preferred authentication account, to be retrieved from the shared token cache for single sign on authentication with
105
108
/// development tools, in the case multiple accounts are found in the shared token.
106
109
/// </summary>
107
110
/// <remarks>
@@ -167,8 +170,10 @@ public string VisualStudioCodeTenantId
167
170
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
168
171
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
169
172
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect on that authentication method, and the credential will acquire tokens for any requested tenant when using that method.
170
-
/// This value can also be set by setting the environment variable AZURE_ADDITIONALLY_ALLOWED_TENANTS.
171
173
/// </summary>
174
+
/// <remarks>
175
+
/// Defaults to the value of environment variable <c>AZURE_ADDITIONALLY_ALLOWED_TENANTS</c>.
/// Specifies the client ID of a user-assigned managed identity. If this value is configured, then <see cref="ManagedIdentityResourceId"/> should not be configured.
196
205
/// </summary>
197
206
/// <remarks>
198
207
/// If neither the <see cref="ManagedIdentityClientId"/> nor the <see cref="ManagedIdentityResourceId"/> property is set, then a system-assigned managed identity is used.
208
+
/// Defaults to the value of environment variable <c>AZURE_CLIENT_ID</c>.
/// Specifies whether the <see cref="EnvironmentCredential"/> will be excluded from the authentication flow. Setting to true disables reading
226
+
/// Specifies whether the <see cref="EnvironmentCredential"/> will be excluded from the authentication flow. Setting to <c>true</c> disables reading
217
227
/// authentication details from the process' environment variables.
218
228
/// </summary>
219
229
publicboolExcludeEnvironmentCredential{get;set;}
220
230
221
231
/// <summary>
222
-
/// Specifies whether the <see cref="WorkloadIdentityCredential"/> will be excluded from the authentication flow. Setting to true disables reading
232
+
/// Specifies whether the <see cref="WorkloadIdentityCredential"/> will be excluded from the authentication flow. Setting to <c>true</c> disables reading
223
233
/// authentication details from the process' environment variables.
/// Specifies whether the <see cref="InteractiveBrowserCredential"/> will be excluded from the <see cref="DefaultAzureCredential"/> authentication flow.
247
-
/// Setting to true disables launching the default system browser to authenticate in development environments.
257
+
/// Setting to <c>true</c> disables launching the default system browser to authenticate in development environments.
@@ -67,8 +67,10 @@ public class EnvironmentCredentialOptions : TokenCredentialOptions, ISupportsDis
67
67
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
68
68
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
69
69
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect on that authentication method, and the credential will acquire tokens for any requested tenant when using that method.
70
-
/// This value defaults to the value of the environment variable AZURE_ADDITIONALLY_ALLOWED_TENANTS.
71
70
/// </summary>
71
+
/// <remarks>
72
+
/// Defaults to the value of environment variable <c>AZURE_ADDITIONALLY_ALLOWED_TENANTS</c>. Values can be a semi-colon delimited list of tenant IDs , or '*' to denote any tenant ID.
/// Specifies the <see cref="TokenCachePersistenceOptions"/> to be used by the credential. If not options are specified, the token cache will not be persisted to disk.
14
+
/// Specifies the <see cref="TokenCachePersistenceOptions"/> to be used by the credential. If no options are specified, the token cache will not be persisted to disk.
@@ -34,8 +43,10 @@ public class WorkloadIdentityCredentialOptions : TokenCredentialOptions, ISuppor
34
43
/// Specifies tenants in addition to the specified <see cref="TenantId"/> for which the credential may acquire tokens.
35
44
/// Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
36
45
/// If no value is specified for <see cref="TenantId"/>, this option will have no effect, and the credential will acquire tokens for any requested tenant.
37
-
/// Defaults to the value of the environment variable AZURE_ADDITIONALLY_ALLOWED_TENANTS.
38
46
/// </summary>
47
+
/// <remarks>
48
+
/// Defaults to the value of environment variable <c>AZURE_ADDITIONALLY_ALLOWED_TENANTS</c>.
0 commit comments