azure - 我正在尝试在 azure cli 中创建文件共享,但它给了我错误
问题描述
我正在尝试在 Azure CLI 命令中创建文件共享:
az storage share create --account-name storeactjan --name filesharejan --account-key key1
但有以下错误:
服务器未能对请求进行身份验证。确保 Authorization 标头的值正确形成,包括签名。
错误代码:AuthenticationFailed
AuthenticationFailed
服务器未能对请求进行身份验证。确保 Authorization 标头的值正确形成,包括签名。RequestId:42b399c2-701a-006f-4630-1d9aad000000 时间:2020-04-28T07:39:27.0899771ZHTTP 请求“QVn0bi79ZIhaO+LS3w/VzaiI5cAMfJiVRav6RbgfbtA=”中找到的 MAC 签名与任何计算的签名都不相同。服务器使用以下字符串签名:'PUT'
解决方案
您的 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
希望它会帮助你。
推荐阅读
- reactjs - 使用 axios 从 GET 请求中提取数据
- html - PrimeNG Quill 编辑器内容中的响应式图像
- angular - 如何在angular10中显示http请求进度?
- c - 已定义单个结构。但是它的组件被赋予了两个不同的值,并且代码仍然有效
- python - “pip install MySQL-python”在 Ubuntu 20.04 上不起作用
- linux - make:如何将文本附加到列表的开头和结尾?
- reactjs - 删除 react-select 选择组件上的下划线
- android - 不同的屏幕尺寸问题?
- mongodb - mongodb中的UpdateMany使用其他字段的值
- java - junit5 创建临时文件