diff --git a/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs b/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs index 40f5b28cc45..9a4c4033291 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Feed/src/common/AzureStorageUtils.cs @@ -14,6 +14,8 @@ using System.Linq; using System.Security.Cryptography; using System.Threading.Tasks; +using Azure.Core.Pipeline; +using System.Net.Http; namespace Microsoft.DotNet.Build.CloudTestTasks { @@ -35,11 +37,17 @@ public class AzureStorageUtils public BlobContainerClient Container { get; set; } + private static readonly HttpClient s_httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(300) }; + private static readonly BlobClientOptions s_clientOptions = new BlobClientOptions() + { + Transport = new HttpClientTransport(s_httpClient) + }; + public AzureStorageUtils(string AccountName, string AccountKey, string ContainerName) { _credential = new StorageSharedKeyCredential(AccountName, AccountKey); Uri endpoint = new Uri($"https://{AccountName}.blob.core.windows.net"); - BlobServiceClient service = new BlobServiceClient(endpoint, _credential); + BlobServiceClient service = new BlobServiceClient(endpoint, _credential, s_clientOptions); Container = service.GetBlobContainerClient(ContainerName); }