当我使用"RA-GRS"时,出现错误(500) Azure Stroage的介绍 [英] i get error (500), when i use "RA-GRS" of Azure Stroage

查看:139
本文介绍了当我使用"RA-GRS"时,出现错误(500) Azure Stroage的介绍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果将Azure存储设置为RA-GRS并将LocationMode设置为"SecondaryOnly",则将发生错误(500).如果将其设置为"PrimaryOnly",则没有问题.

错误代码.

If Azure Storage is set to RA-GRS and LocationMode is set to "SecondaryOnly", an error (500) will occur. There is no problem if it is set to "PrimaryOnly".

Error Code.

Dim credential As StorageCredentials = New StorageCredentials(ACCOUNT, ACCKEY)
Dim account As CloudStorageAccount = New CloudStorageAccount(credential, True)
Dim client As CloudBlobClient = account.CreateCloudBlobClient()

client.DefaultRequestOptions.LocationMode = LocationMode.SecondaryOnly
client.DefaultRequestOptions.RetryPolicy = New ExponentialRetry(TimeSpan.FromSeconds(3), 2)

Dim container As CloudBlobContainer = client.GetContainerReference("backup")
Dim blob As CloudBlockBlob = container.GetBlockBlobReference("20180825.bak")

Try
    blob.FetchAttributes()    '' Error!
    MessageBox.Show(blob.Properties.Length.ToString())
Catch ex As Exception
    MessageBox.Show(ex.Message)
End Try

但是,创建一个新的存储帐户并将其设置为"SecondaryOnly"没问题.
发生错误存储是我很久以前创建的帐户,并且从"Classic"更改为来"ARM"之前.

这个问题有什么解决办法吗?

However, creating a new Storage account and setting it to "SecondaryOnly" did not have any problem.
Errors occur Storage is an account that I created long ago and changed from "Classic" to "ARM" before.

Is there any solution for this problem?

推荐答案

500错误是可重试的,因为它是服务器错误,可能只是短暂的问题.

参考: https ://docs.microsoft.com/zh-CN/azure/storage/common/storage-designing-ha-apps-with-ragrs#handling-retries

Refer : https://docs.microsoft.com/en-us/azure/storage/common/storage-designing-ha-apps-with-ragrs#handling-retries

-------------- -------------------------------------------------- ----------------------------------

如果此答案有帮助,点击"标记为答案"或 投票.要提供有关您的论坛体验的其他反馈,请单击 此处

If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, click here



这篇关于当我使用"RA-GRS"时,出现错误(500) Azure Stroage的介绍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆