File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
snippets/authentication/best-practices/CCA Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ The Azure Identity library for .NET allows you to authenticate via managed ident
94
94
95
95
# [ DefaultAzureCredential] ( #tab/dac )
96
96
97
- :::code language="csharp" source="../snippets/authentication/best-practices/CCA/Program.cs" id="snippet_retries_dac" highlight="5-9 ":::
97
+ :::code language="csharp" source="../snippets/authentication/best-practices/CCA/Program.cs" id="snippet_retries_dac" highlight="4-8 ":::
98
98
99
99
# [ ManagedIdentityCredential] ( #tab/mic )
100
100
Original file line number Diff line number Diff line change 52
52
#endregion
53
53
54
54
#region snippet_retries_dac
55
- DefaultAzureCredential credential = new (
56
- new DefaultAzureCredentialOptions
55
+ DefaultAzureCredentialOptions dacOptions = new ( )
56
+ {
57
+ ManagedIdentityClientId = clientId ,
58
+ Retry =
57
59
{
58
- ManagedIdentityClientId = clientId ,
59
- Retry =
60
- {
61
- MaxRetries = 3 ,
62
- Delay = TimeSpan . FromSeconds ( 0.5 ) ,
63
- }
60
+ MaxRetries = 3 ,
61
+ Delay = TimeSpan . FromSeconds ( 0.5 ) ,
64
62
}
65
- ) ;
63
+ } ;
64
+
65
+ DefaultAzureCredential credential = new ( dacOptions ) ;
66
66
#endregion
67
67
68
68
builder . Services . AddEndpointsApiExplorer ( ) ;
You can’t perform that action at this time.
0 commit comments