Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the timeout in the Azure libraries #7719

Merged
merged 6 commits into from
Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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