Skip to content

Commit cd14866

Browse files
authored
Async call in library should add ConfigureAwait(false) (#257)
1 parent c167bbc commit cd14866

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Authentication.Abstractions/AzureEnvironment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private static async Task<List<ArmMetadata>> InitializeEnvironmentsFromArm(strin
212212
{
213213
httpOperations = HttpClientOperationsFactory.Create().GetHttpOperations();
214214
}
215-
var armResponseMessage = await httpOperations.GetAsync(armMetadataRequestUri);
215+
var armResponseMessage = await httpOperations.GetAsync(armMetadataRequestUri).ConfigureAwait(false);
216216
if (armResponseMessage?.StatusCode != HttpStatusCode.OK)
217217
{
218218
throw new Exception($"Failed to load cloud metadata from the url {armMetadataRequestUri}.");
@@ -222,7 +222,7 @@ private static async Task<List<ArmMetadata>> InitializeEnvironmentsFromArm(strin
222222

223223
if (armResponseMessage.Content != null)
224224
{
225-
armMetadataContent = await armResponseMessage.Content.ReadAsStringAsync();
225+
armMetadataContent = await armResponseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
226226
}
227227
if (string.IsNullOrEmpty(armMetadataContent))
228228
{

src/Authentication.Abstractions/HttpClientOperationsFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public HttpClientOperations(HttpClient client)
4747

4848
public async Task<HttpResponseMessage> GetAsync(string requestUri)
4949
{
50-
return await _client.GetAsync(requestUri);
50+
return await _client.GetAsync(requestUri).ConfigureAwait(false);
5151
}
5252
}
5353
}

0 commit comments

Comments
 (0)