我正在尝试在azure cli中创建文件共享,但它给了我错误

问题描述 投票:0回答:2

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

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

但有以下错误:

服务器无法验证请求。确保值授权标头的格式正确,包括签名。

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

azure command-line-interface storage account fileshare
2个回答
0
投票

您的account-key参数格式不正确。这是根据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

希望它会帮助您。


0
投票

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

PFB链接-

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

© www.soinside.com 2019 - 2024. All rights reserved.