在最新发布时,这是最初的错误:

System.ApplicationException: The trace listener AzureBlobTraceListener is disabled. ---> System.InvalidOperationException: The SAS URL for the cloud storage account is not specified. Use the environment variable 'DIAGNOSTICS_AZUREBLOBCONTAINERSASURL' to define it.at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceLi‌​stener.RefreshConfig‌​()

然后,我将 DIAGNOSTICS_AZUREBLOBCONTAINERSASURL 添加到应用程序设置中,并将其值设置为 生成的 Blob 服务 SAS URL。此时我收到一个新错误:

System.ApplicationException: The trace listener AzureBlobTraceListener is disabled. ---> System.ArgumentException: Missing mandatory parameters for valid Shared Access Signature at Microsoft.WindowsAzure.Storage.Core.Auth.SharedAccessSignatureHelper.ParseQuery(IDictionary2 queryParameters, Boolean mandatorySignedResource) at Microsoft.WindowsAzure.Storage.Core.Util.NavigationHelper.ParseBlobQueryAndVerify(Uri address, StorageCredentials& parsedCredentials, Nullable1& parsedSnapshot) at Microsoft.WindowsAzure.Storage.Core.Util.NavigationHelper.ParseBlobQueryAndVerify(StorageUri address, StorageCredentials& parsedCredentials, Nullable`1& parsedSnapshot) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.ParseQueryAndVerify(StorageUri address, StorageCredentials credentials) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer..ctor(StorageUri containerAddress, StorageCredentials credentials) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.RefreshConfig()

然后,我将 sr=b 添加到“DIAGNOSTICS_AZUREBLOBCONTAINERSASURL”,这会导致以下错误:

Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (403) Forbidden. ---> System.Net.WebException: The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.GetResponse() at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadBlockList(BlockListingFilter blockListingFilter, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream) at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer() Request Information RequestID:5225782d-0001-0175-6d94-fc82dd000000 RequestDate:Fri, 14 Jul 2017 11:33:16 GMT StatusMessage:Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. ErrorCode:AuthenticationFailed

用于在应用设置中声明 AzureWebJobsDashboard 和 AzureWebJobsStorage 的连接字符串: enter image description here

请您参考如下方法:

根据您的描述,我猜您遇到错误的原因是您的 SAS token 没有足够的权限来 CRUD 该 blob。

SAS token 必须是 Blob 容器 SAS token ,而不是 Blob SAS token 。

此外,如果您设置了 Azure Web 应用程序的诊断日志应用程序日志记录功能,它将在您的 Web 应用程序的应用程序设置中自动生成 SAS token 。

更多详情,您可以引用下图:

在诊断日志中设置存储帐户。

然后它将自动设置应用程序设置:

<小时 />

更新:

Failed to validate Microsoft Azure WebJobs SDK Dashboard connection string. The Microsoft Azure Storage account connection string is not formatted correctly.

如果您将网络作业上传到网络应用程序,则网络作业需要两个应用程序设置。一个是仪表板连接字符串,另一个是 AzureWebJobsStorage。

这两个设置都需要存储连接字符串而不是存储 SAS。

您可以找到如下图所示的存储连接字符串:

1.开启存储访问 key 功能。

2.复制连接字符串:

3.替换Web应用程序设置中的连接字符串。


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!