File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed
Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 66using Azure . Identity ;
77using Grpc . Core ;
88using Grpc . Net . Client ;
9+ using Grpc . Net . Client . Configuration ;
910
1011namespace Microsoft . DurableTask ;
1112
@@ -112,6 +113,24 @@ this.Credential is not null
112113 {
113114 Credentials = ChannelCredentials . Create ( channelCreds , managedBackendCreds ) ,
114115 UnsafeUseInsecureChannelCallCredentials = this . AllowInsecureCredentials ,
116+ ServiceConfig = new ServiceConfig
117+ {
118+ MethodConfigs =
119+ {
120+ new MethodConfig
121+ {
122+ Names = { MethodName . Default } ,
123+ RetryPolicy = new Grpc . Net . Client . Configuration . RetryPolicy ( )
124+ {
125+ MaxAttempts = 10 ,
126+ InitialBackoff = TimeSpan . FromMilliseconds ( 50 ) ,
127+ MaxBackoff = TimeSpan . FromMilliseconds ( 250 ) ,
128+ BackoffMultiplier = 2 ,
129+ RetryableStatusCodes = { StatusCode . Unavailable } ,
130+ } ,
131+ } ,
132+ } ,
133+ } ,
115134 } ) ;
116135 }
117136
@@ -127,7 +146,7 @@ this.Credential is not null
127146 case "managedidentity" :
128147 return new ManagedIdentityCredential ( connectionString . ClientId ) ;
129148 case "workloadidentity" :
130- var opts = new WorkloadIdentityCredentialOptions ( ) ;
149+ WorkloadIdentityCredentialOptions opts = new WorkloadIdentityCredentialOptions ( ) ;
131150 if ( ! string . IsNullOrEmpty ( connectionString . ClientId ) )
132151 {
133152 opts . ClientId = connectionString . ClientId ;
Original file line number Diff line number Diff line change 66using Azure . Identity ;
77using Grpc . Core ;
88using Grpc . Net . Client ;
9+ using Grpc . Net . Client . Configuration ;
910
1011namespace Microsoft . DurableTask ;
1112
@@ -119,6 +120,24 @@ this.Credential is not null
119120 {
120121 Credentials = ChannelCredentials . Create ( channelCreds , managedBackendCreds ) ,
121122 UnsafeUseInsecureChannelCallCredentials = this . AllowInsecureCredentials ,
123+ ServiceConfig = new ServiceConfig
124+ {
125+ MethodConfigs =
126+ {
127+ new MethodConfig
128+ {
129+ Names = { MethodName . Default } ,
130+ RetryPolicy = new Grpc . Net . Client . Configuration . RetryPolicy ( )
131+ {
132+ MaxAttempts = 10 ,
133+ InitialBackoff = TimeSpan . FromMilliseconds ( 50 ) ,
134+ MaxBackoff = TimeSpan . FromMilliseconds ( 250 ) ,
135+ BackoffMultiplier = 2 ,
136+ RetryableStatusCodes = { StatusCode . Unavailable } ,
137+ } ,
138+ } ,
139+ } ,
140+ } ,
122141 } ) ;
123142 }
124143
@@ -134,7 +153,7 @@ this.Credential is not null
134153 case "managedidentity" :
135154 return new ManagedIdentityCredential ( connectionString . ClientId ) ;
136155 case "workloadidentity" :
137- var opts = new WorkloadIdentityCredentialOptions ( ) ;
156+ WorkloadIdentityCredentialOptions opts = new WorkloadIdentityCredentialOptions ( ) ;
138157 if ( ! string . IsNullOrEmpty ( connectionString . ClientId ) )
139158 {
140159 opts . ClientId = connectionString . ClientId ;
You can’t perform that action at this time.
0 commit comments