Skip to content

Commit

Permalink
Increase the timeout in the Azure libraries (#7719)
Browse files Browse the repository at this point in the history
* increase timeout to 300seconds

* white spaces change

* feedback

* rename
  • Loading branch information
AlitzelMendez authored Aug 5, 2021
1 parent a14c239 commit 6827710
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}

Expand Down

0 comments on commit 6827710

Please sign in to comment.