问题描述
在重新发布后,这是最初的错误:
upon fresh publish this is the initial error:
然后我将DIAGNOSTICS_AZUREBLOBCONTAINERSASURL
添加到应用程序设置中,其值设置为生成的Blob服务SAS URL.在此我得到一个新的错误:
I then added DIAGNOSTICS_AZUREBLOBCONTAINERSASURL
to the application settings having its value set tothe Blob service SAS URL generated. At this I get a new error:
然后我将sr=b
添加到'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL
',这导致以下错误:
I then added sr=b
to the 'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL
' which result in the below error:
用于在应用程序设置中声明AzureWebJobsDashboard和AzureWebJobsStorage的连接字符串:在此处输入图片描述
Connection string used to declare AzureWebJobsDashboard and AzureWebJobsStorage in app settings:enter image description here
推荐答案
根据您的描述,我想您遇到该错误的原因是您的SAS令牌没有足够的权限来对blob进行CRUD.
According to your description, I guess the reason why you faced the error is your SAS token doesn't have enough permission to CRUD the blob.
SAS令牌必须是Blob容器SAS令牌,而不是Blob SAS令牌.
The SAS token must be the blob container SAS token not the blob SAS token.
此外,如果您设置了Azure Web应用程序的诊断日志应用程序日志记录"功能,它将在您的Web应用程序的应用程序设置中自动生成SAS令牌.
Besides, if you set the the azure web app's diagnostics logs Application Logging feature, it will auto generate a SAS token in your web app's appsetting.
更多细节,您可以参考下图:
More details, you could refer to below image:
在诊断日志中设置存储帐户.
Set the storage account in the diagnostics logs.
然后它将自动设置应用设置:
Then it will auto set the appsetting:
更新:
如果将Web作业上载到Web应用程序,则Web作业需要两个appsetting.一个是仪表板连接字符串,另一个是AzureWebJobsStorage.
If you upload a webjobs to your web app, the web jobs need two appsetting. One is the Dashboard connection string, another one is the AzureWebJobsStorage.
这两个设置都需要存储连接字符串而不是存储SAS.
Both of these two setting need the storage connection string not the storage SAS.
您可以找到存储连接字符串,如下图所示:
You could find the storage connection string as below image shows:
1.打开存储访问密钥功能.
1.Open the storage access key feature.
2.复制连接字符串:
2.Copy the connection string:
3.在Web应用程序的appsetting中替换连接字符串.
3.Replace the connection string in the web app appsetting.
这篇关于Microsoft.WindowsAzure.Storage.StorageException:远程服务器返回错误:(403)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!