【问题标题】:DurableTaskStorageException when debugging Durable Functions: Make sure the value of Authorization header is formed correctly including the signature调试 Durable Functions 时出现 DurableTaskStorageException:确保 Authorization 标头的值正确形成,包括签名
【发布时间】:2022-01-27 11:32:21
【问题描述】:

我想针对 Durable Functions 项目的数据测试一些更改。因此,我已将生产环境中的数据复制到不同的(新创建的)存储帐户中。我将TaskHubName 与我的生产环境保持一致。

但是,在将AzureWebJobsStorage 连接字符串更改为新的存储帐户后,我在输出中看到了几个DurableTaskStorageExceptions。

这是完整的异常消息:

DurableTask.AzureStorage.Storage.DurableTaskStorageException:服务器无法对请求进行身份验证。确保 Authorization 标头的值格式正确,包括签名。

我已将以下项目复制到我的新存储帐户:

  • hubname历史
  • hubname实例
  • 容器hubname-largemessages

启动时,会自动创建以下内容,因此我的实际存储连接字符串应该是正确的:

  • hubname-applease
  • hubname-租约
  • 表 azure-webjobs-hosts
  • 表 azure-webjobs-secrets

知道是什么原因造成的吗?

完整的堆栈跟踪可以在这里看到:

Microsoft.Azure.WebJobs.Host.FunctionInvocationException:执行函数时出现异常:已编辑 ---> DurableTask.AzureStorage.Storage.DurableTaskStorageException:服务器未能对请求进行身份验证。确保 Authorization 标头的值正确形成,包括签名。 ---> Microsoft.WindowsAzure.Storage.StorageException:服务器未能对请求进行身份验证。确保 Authorization 标头的值正确形成,包括签名。 在 Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand_1 cmd、IRetryPolicy 策略、OperationContext operationContext、CancellationToken 令牌) 在 Microsoft.WindowsAzure.Storage.Blob.CloudBlob.DownloadRangeToStreamAsync(流目标、Nullable_1 偏移量、Nullable_1 长度、AccessCondition accessCondition、BlobRequestOptions 选项、OperationContext operationContext、IPProgress_1 progressHandler、CancellationToken cancelToken) 在//src/DurableTask.AzureStorage/Storage/AzureStorageClient.cs:line 130 中的 DurableTask.AzureStorage.Storage.AzureStorageClient.WrapFunctionWithReturnType(Func_3 storageRequest, OperationContext context, CancellationToken cancelToken) 在 DurableTask.AzureStorage.TimeoutHandler.ExecuteWithTimeout[T](String operationName, String account, AzureStorageOrchestrationServiceSettings settings, Func_3 operation, AzureStorageOrchestrationServiceStats stats, String clientRequestId) in //src/DurableTask.AzureStorage/TimeoutHandler.cs:line 52 在 DurableTask.AzureStorage.Storage.AzureStorageClient.MakeStorageRequest[T](Func_3 storageRequest, String operationName, String clientRequestId) in /_/src/DurableTask.AzureStorage/Storage/AzureStorageClient.cs:line 111

【问题讨论】:

    标签: azure-functions azure-blob-storage azure-storage azure-durable-functions


    【解决方案1】:

    请检查是否是以下原因:

    1. 出现此错误的主要原因是不正确的帐户名称或帐户密钥(可能是由于存在特殊字符或过期)
    2. 另一个问题可能是计算机/PC 的时间(时区差异)。
    3. 请在 Azure 门户中转到“设置”>“访问密钥”尝试连接字符串。
    4. 如果通过 Azure 存储资源管理器或门户网站使用,请尝试重新生成 SAS 令牌(这次尝试使用不同的密钥(例如 key2))。

    另外请检查其他可能性,例如

    1. 检查连接字符串是否有任何特殊字符(例如:尝试通过放置 %% 来转义 %)。检查您的 AzureWebJobsStorage 字符串是否是最新的。\

    2. 这可能是由于 azure sdks 版本不兼容

    参考资料:

    1. microsoft.com reference
    2. azurestorage blob server failed to authenticate the request-SO reference
    3. Upload File to Azure Blob Storage with PowerShell - Microsoft Q&A

    【讨论】:

      猜你喜欢
      • 2021-07-29
      • 2014-03-18
      • 1970-01-01
      • 2021-03-21
      • 1970-01-01
      • 2015-05-12
      • 2019-09-26
      • 2021-09-19
      • 1970-01-01
      相关资源
      最近更新 更多