Skip to content

Commit 5d9f181

Browse files
authored
Update readme to explain that setting ManagedIdentityClientId and … (Azure#18344)
1 parent 0ea9e6c commit 5d9f181

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sdk/identity/Azure.Identity/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ var credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions {
107107
var blobClient = new BlobClient(new Uri("https://myaccount.blob.core.windows.net/mycontainer/myblob"), credential);
108108
```
109109

110+
In addition to configuring the `ManagedIdentityClientId` via code, it can also be set using the `AZURE_CLIENT_ID` environment variable. These two approaches are equivalent when using the `DefaultAzureCredential`.
111+
110112
### Define a custom authentication flow with the `ChainedTokenCredential`
111113
While the `DefaultAzureCredential` is generally the quickest way to get started developing applications for Azure, more advanced users may want to customize the credentials considered when authenticating. The `ChainedTokenCredential` enables users to combine multiple credential instances to define a customized chain of credentials. This example demonstrates creating a `ChainedTokenCredential` which will attempt to authenticate using managed identity, and fall back to authenticating via the Azure CLI if managed identity is unavailable in the current environment. The credential is then used to authenticate an `EventHubProducerClient` from the [Azure.Messaging.EventHubs][eventhubs_client_library] client library.
112114

0 commit comments

Comments
 (0)