首页 > 解决方案 > 使用 az cli 在 azure 中创建文件共享

问题描述

我想使用命令行在 azure 存储帐户中创建文件共享。

我正在使用命令az storage share create --name myfile --account-name $NAME --account-key $key。但它显示错误。

我也尝试了 azcopy make "url for file share?accountkey" 但它也不起作用。我使用的是 azcopy 7.3 版

这是我得到的错误。

该命令因意外错误而失败。这是回溯:

HTTPSConnectionPool(host='redboxtfstatebedtqgliqc.file.core.windows.net', port=443): 最大重试次数超过 url: /myfile?restype=share (由 SSLError(SSLError("bad handshake: Error([('SSL例程', 'tls_process_server_certificate', '证书验证失败')],)",),))

标签: azureazcopyaz

解决方案


我和帖子的作者有同样的问题。可以通过 George Chen 发布的链接解决:

https://github.com/Azure/azure-cli/blob/dev/doc/use_cli_effectively.md#working-behind-a-proxy

  1. 您需要编辑文件:“C:\path_to_your_cli_installation\CLI2\Lib\site-packages\certifi\cacert.pem”并添加代理服务器的证书
  2. 您需要将环境变量 REQUESTS_CA_BUNDLE 设置为“C:\path_to_your_cli_installation\CLI2\Lib\site-packages\certifi\cacert.pem”

推荐阅读