Skip to content

Commit 2be5950

Browse files
committed
fix examples
1 parent 1b67687 commit 2be5950

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/azure/sdk/authentication/credential-chains.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ In its simplest form, you can use the parameterless version of `DefaultAzureCred
7272

7373
To remove a credential from `DefaultAzureCredential`, use the corresponding `Exclude`-prefixed property in [DefaultAzureCredentialOptions](/dotnet/api/azure.identity.defaultazurecredentialoptions?view=azure-dotnet&preserve-view=true#properties). For example:
7474

75-
:::code language="csharp" source="../snippets/authentication/credential-chains/Program.cs" id="snippet_DacExcludes" highlight="6-7":::
75+
:::code language="csharp" source="../snippets/authentication/credential-chains/Program.cs" id="snippet_DacExcludes" highlight="9-10":::
7676

7777
In the preceding code sample, `EnvironmentCredential` and `WorkloadIdentityCredential` are removed from the credential chain. As a result, the first credential to be attempted is `ManagedIdentityCredential`. The modified chain looks like this:
7878

docs/azure/sdk/snippets/authentication/credential-chains/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#region snippet_DacExcludes
3232
builder.Services.AddAzureClients(clientBuilder =>
3333
{
34+
clientBuilder.AddBlobServiceClient(
35+
new Uri("https://<account-name>.blob.core.windows.net"));
36+
3437
clientBuilder.UseCredential(new DefaultAzureCredential(
3538
new DefaultAzureCredentialOptions
3639
{
@@ -44,6 +47,9 @@
4447
#region snippet_Ctc
4548
builder.Services.AddAzureClients(clientBuilder =>
4649
{
50+
clientBuilder.AddBlobServiceClient(
51+
new Uri("https://<account-name>.blob.core.windows.net"));
52+
4753
clientBuilder.UseCredential(new ChainedTokenCredential(
4854
new ManagedIdentityCredential(clientId: userAssignedClientId),
4955
new VisualStudioCredential()));

0 commit comments

Comments
 (0)