【问题标题】:I'm trying to create a file share in azure cli but its giving me error我正在尝试在 azure cli 中创建文件共享,但它给了我错误
【发布时间】:2020-04-28 07:42:54
【问题描述】:

我正在尝试在 Azure CLI 命令中创建文件共享:

az storage share create --account-name storeactjan --name filesharejan --account-key key1

但出现以下错误:

服务器未能验证请求。确保值 包括签名在内的授权标头格式正确。

错误代码:AuthenticationFailed AuthenticationFailedServer 未能验证请求。确保值 授权标头正确形成,包括签名。 请求 ID:42b399c2-701a-006f-4630-1d9aad000000 时间:2020-04-28T07:39:27.0899771Z 在 HTTP 请求中找到 MAC 签名 'QVn0bi79ZIhaO+LS3w/VzaiI5cAMfJiVRav6RbgfbtA=' 与任何不同 计算签名。服务器使用以下字符串进行签名:'PUT'

【问题讨论】:

  • 从哪里运行代码?您应该检查两件事:1) 您使用的帐户密钥是否正确,以及 2) 您运行代码的机器上的时钟设置是否正确。

标签: azure command-line-interface storage account fileshare


【解决方案1】:

您的帐户密钥参数格式不正确。 根据 microsoft 文档 (https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-create-file-share?tabs=azure-cli),这是您必须执行的操作。供您参考,我在 PowerShell 中使用 CLI。

1) 以正确的格式检索密钥

$key1 = az storage account keys list --account-name storeactjan --query "[0].value" | tr -d '"'

2) 创建您的文件共享

az storage share create --account-name storeactjan --name filesharejan --account-key $key1

希望对你有所帮助。

【讨论】:

    【解决方案2】:

    我会说,您可以为其创建 arm 模板并调用它。

    PFB 链接 -

    https://github.com/Azure/azure-quickstart-templates/tree/master/101-storage-file-share

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-16
      相关资源
      最近更新 更多