我正在使用.NET SDK
Microsoft.Azure.DocumentDB
在Azure上与cosmos db合作。
我的网络无法连接到cosmos db(代理、网络…)时遇到问题
例子:
this.client = new DocumentClient(new Uri(EndpointUrl), PrimaryKey, new ConnectionPolicy {
ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp,
RetryOptions = new RetryOptions {MaxRetryAttemptsOnThrottledRequests = 5,
MaxRetryWaitTimeInSeconds= 5 },
RequestTimeout = new TimeSpan(1000)});
var a = await this.client.CreateDatabaseIfNotExistsAsync(new Database { Id = "FamilyDB" });
我的应用程序循环永远保持一致
CreateDatabaseIfNotExistsAsync
以及消息:
Endpoint not reachable. Refresh cache and retry
Failover happening. retryCount 6
RefreshLocationAsync() refreshing locations
An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
Endpoint not reachable. Refresh cache and retry
Failover happening. retryCount 7
RefreshLocationAsync() refreshing locations
An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
....
我不能停下来或试着抓住它,我试着
requestoption
requestTimeout
但它不起作用。