@@ -145,7 +145,7 @@ public async Task<RestRequest> CreateRequestAsync(string resource, Method method
145145 var request = new RestRequest ( resource , method ) ;
146146
147147 // Apply authentication based on the configured authentication type
148- await ApplyAuthenticationAsync ( request , cancellationToken ) ;
148+ await ApplyAuthenticationAsync ( request , cancellationToken ) . ConfigureAwait ( false ) ;
149149
150150 return request ;
151151 }
@@ -174,7 +174,7 @@ private async Task ApplyAuthenticationAsync(RestRequest request, CancellationTok
174174 break ;
175175
176176 case EntraIdAuthenticationOptions entraIdOptions :
177- await ApplyEntraIdAuthenticationAsync ( request , entraIdOptions , cancellationToken ) ;
177+ await ApplyEntraIdAuthenticationAsync ( request , entraIdOptions , cancellationToken ) . ConfigureAwait ( false ) ;
178178 break ;
179179
180180 default :
@@ -223,7 +223,7 @@ private async Task ApplyEntraIdAuthenticationAsync(
223223 throw new InvalidOperationException ( "IApiTokenProvider not available for Entra ID authentication" ) ;
224224 }
225225
226- string accessToken = await apiTokenProvider . GetAccessTokenAsync ( options . ApiAudience , cancellationToken ) ;
226+ string accessToken = await apiTokenProvider . GetAccessTokenAsync ( options . ApiAudience , cancellationToken ) . ConfigureAwait ( false ) ;
227227 request . AddHeader ( AuthorizationHeaderName , $ "{ BearerTokenPrefix } { accessToken } ") ;
228228 logger . LogDebug ( "Added Entra ID token authentication for audience '{Audience}'" , options . ApiAudience ) ;
229229 }
@@ -253,8 +253,8 @@ public async Task<RestResponse> ExecuteAsync(RestRequest request, CancellationTo
253253 {
254254 // Execute the request with retry policy
255255 var response = await retryPolicy . ExecuteAsync (
256- async ( token ) => await restClientService . ExecuteAsync ( options . BaseUrl , request , token ) ,
257- cancellationToken ) ;
256+ async ( token ) => await restClientService . ExecuteAsync ( options . BaseUrl , request , token ) . ConfigureAwait ( false ) ,
257+ cancellationToken ) . ConfigureAwait ( false ) ;
258258
259259 // Ensure response is not null to prevent NullReferenceException
260260 if ( response is null )
0 commit comments