如何使用Azure CLI从特定的Azure存储帐户中获取所有容器?

发布于 2025-01-19 15:14:40 字数 210 浏览 0 评论 0 原文

如何使用 Azure CLI 从特定 Azure 存储帐户获取所有容器? 如何像在 Powershell 中设置上下文一样在 azure cli 中设置上下文? $ctx = $storageAccount.Context

我们如何使用 Azure CLI 实现此目的?

获取必须从中检索容器的存储帐户 获取

存储帐户上下文

列出所有容器

How to Get All the Containers From a Specific Azure Storage Account using Azure CLI?
How to set context in azure cli like we set context in Powershell?
$ctx = $storageAccount.Context

How can we achieve this using Azure CLI?

Get the storage account from which container has to be retrieved

Get the storage account context

List all the containers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴梦一场 2025-01-26 15:14:40

获取所有容器列表

az storage container list --account-name <Storage Account Name> --account-key <Storage Account Key> --query "[].{Name:name}" --output table

“

set&amp;获取上下文

# example to set the Az context
Set-AzContext -Subscription  "XXXX-XXXX-XXXX-XXXX"

请参阅&amp;

Get All the Container list

az storage container list --account-name <Storage Account Name> --account-key <Storage Account Key> --query "[].{Name:name}" --output table

enter image description here

Set & Get Context

# example to set the Az context
Set-AzContext -Subscription  "XXXX-XXXX-XXXX-XXXX"

Refer Set AzContext & Get AzContext

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文