gpt4 book ai didi

azure - az 存储容器列表。不起作用,引用已删除的存储

转载 作者:行者123 更新时间:2023-12-03 02:27:05 25 4
gpt4 key购买 nike

我正在按照本教程进行操作,在本地 MacOS 上运行 az cli(v 2.11): https://learn.microsoft.com/en-us/learn/modules/provision-infrastructure-azure-pipelines/6-run-terraform-remote-storage

执行包括此在内的几个步骤后:

az storage account create --name tfsa$UNIQUE_ID --resource-group tf-storage-rg --sku Standard_LRS

并运行此命令:

az storage container list --query "[].{name:name}" --output tsv

我收到以下信息:

HTTPSConnectionPool(host='mystorageaccount20822.blob.core.windows.net', port=443): Max retries exceeded with url: /?comp=list&maxresults=5000 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d2566a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

上述命令在云 shell 中有效,但在我的本地 shell 中失败(运行 v 2.20,最新)

在 Cloud shell 上,我确实收到此警告:

There are no credentials provided in your command and environment, wewill query for the account key inside your storage account. Pleaseprovide --connection-string, --account-key or --sas-token ascredentials, or use --auth-mode login if you have required RBACroles inyour command. For more information about RBAC roles instorage, visithttps://learn.microsoft.com/en-us/azure/storage/common/storage-auth-aad-rbac-cli.

我几周前创建了一个 mystorageaccount20822 但将其删除...我的 AZ CLI 仍然绑定(bind)到之前的帐户吗?有没有办法告诉我的 az cli(在 mac 上)与我正在运行的当前资源同步。在 Azure 门户中,mystorageaccount20822 不存在。

Azure CLI 是否缓存某些值或其他内容?是否有一些隐藏的配置文件设置了旧的“mystorageaccount20822”,并且 CLI 每次都尝试引用该文件而不是名为 tfsa$UNIQUE_ID 的新帐户?

最佳答案

使用调试运行命令后:

az 存储容器列表 --debug --account-name tfsa$UNIQUE_ID --query [].name --output tsv

我能够看到它正在设置。

事实证明,它已经在几天前的教程中设置了环境变量“AZURE_STORAGE_CONNECTION_STRING”,该变量在发送命令时覆盖了一个属性,以使用旧的示例值。取消设置该环境变量后,该命令起作用了。

关于azure - az 存储容器列表。不起作用,引用已删除的存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66536704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com