Exemple #1
0
        protected virtual BatchRestClient CreateBatchRestClient(string url, string accountName, string key)
        {
            Microsoft.Azure.Batch.Protocol.BatchSharedKeyCredential credentials = new Microsoft.Azure.Batch.Protocol.BatchSharedKeyCredential(accountName, key);
            BatchRestClient restClient = new BatchRestClient(credentials, new Uri(url));

            restClient.HttpClient.DefaultRequestHeaders.UserAgent.Add(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.UserAgentValue);

            restClient.SetRetryPolicy(Hyak.Common.TransientFaultHandling.RetryPolicy.NoRetry); //Force there to be no retries
            restClient.HttpClient.Timeout = Timeout.InfiniteTimeSpan;                          //Client side timeout will be set per-request

            return(restClient);
        }
        protected virtual BatchRestClient CreateBatchRestClient(string url, string accountName, string key)
        {
            Microsoft.Azure.Batch.Protocol.BatchSharedKeyCredential credentials = new Microsoft.Azure.Batch.Protocol.BatchSharedKeyCredential(accountName, key);
            BatchRestClient restClient = new BatchRestClient(credentials, new Uri(url));
            restClient.HttpClient.DefaultRequestHeaders.UserAgent.Add(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.UserAgentValue);

            restClient.SetRetryPolicy(Hyak.Common.TransientFaultHandling.RetryPolicy.NoRetry); //Force there to be no retries
            restClient.HttpClient.Timeout = Timeout.InfiniteTimeSpan; //Client side timeout will be set per-request

            return restClient;
        }