2017-04-26 1 views
2

を使用した後にこれは私が、私はエラーターゲット保管場所のURIが指定されていないを取得していますbackgroundRequestOptionを指定するとAzureストレージは エラーリトライポリシー

public CloudTableClient ConfigureStorageAccount() { var storageCred = new StorageCredentials(ConfigurationManager.AppSettings["SASToken"]); CloudTableClient = new CloudTableClient( new StorageUri(new Uri(ConfigurationManager.AppSettings["StorageAccountUri"])), storageCred); var backgroundRequestOption = new TableRequestOptions() { // Client has a default exponential retry policy with 4 sec delay and 3 retry attempts // Retry delays will be approximately 3 sec, 7 sec, and 15 sec MaximumExecutionTime = TimeSpan.FromSeconds(30), // PrimaryThenSecondary in case of Read-access geo-redundant storage, else set this to PrimaryOnly LocationMode = LocationMode.PrimaryThenSecondary, }; CloudTableClient.DefaultRequestOptions = backgroundRequestOption; return CloudTableClient; } 

アカウントの設定に私のコードです。リクエストのロケーションモードを変更することを検討してください。

backgroundRequestOptionを指定しない場合は、エラーは発生しません。このURIはどこで指定する必要がありますか?

答えて

4

LocationMode.PrimaryThenSecondaryが選択されている場合は、PrimaryUriとSecondaryUriの両方を指定する必要があります。

+0

しかし、どこで指定する必要がありますか? – Sameer

+1

新しいStorageUri(primaryUri、secondryUri) –