az vmss list 命令返回空值

发布于 2025-01-09 19:10:42 字数 329 浏览 2 评论 0原文

我在 Azure 中有两个资源组,每个资源组包含一个 VMSS(虚拟机规模集),并且资源在 Azure 门户中可见。问题是,以下命令返回空输出:

az resource list --subscription MySubscription -g vmss-rg
az vmss list --subscription MySubscription -g vmss-rg
az vmss list

但是,使用没有 VMSS 的不同资源组运行 az resources list 可以正常工作。我还使用不同的 Azure 帐户和订阅对其进行了测试,它也有效。

I have two resource groups in Azure, each contains one VMSS (Virtual Machine Scale Sets) and the resources are visible in Azure Portal. The problem is, the following commands return empty output:

az resource list --subscription MySubscription -g vmss-rg
az vmss list --subscription MySubscription -g vmss-rg
az vmss list

However, running az resource list with different resource groups which doesn't have VMSS works fine. I also tested it with different Azure account and subscription, it also worked.

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

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

发布评论

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

评论(1

余罪 2025-01-16 19:10:42

我们已经在本地测试了@VenkateshDodda-MT 并且工作正常。将其作为答案发布,以帮助其他社区成员解决类似问题,以便他们能够找到并解决问题。

为了实现上述要求,我们需要 在我们的本地 .

发布在 powershell 中运行命令以获取我们的订阅或资源组下的 vmss 列表:-

az resource list --resource-type  "Microsoft.Compute/virtualMachineScaleSets"

输出:-

在此处输入图像描述

获取VMSS特定资源组下的列表运行以下 cmd:

az resource list --resource-type  "Microsoft.Compute/virtualMachineScaleSets" -g '<rgName>'

输出:-
输入图片此处描述

有关更多信息,请参阅此SO THREAD:Azure PS 命令返回空列表 按照 @Olga Osinskaya 的建议 -微软金融科技

We have tested the same command in our local as suggested by @VenkateshDodda-MT and it works fine. Posting it as an answer to help other community members for the similar issue so that they can find and fix their problem.

To achieve the above requirement we need to install the az powershell module in our local .

Post that run the command in powershell to get the vmss list under our subscription or resource groups:-

az resource list --resource-type  "Microsoft.Compute/virtualMachineScaleSets"

OUTPUT:-

enter image description here

To get the VMSS list under particular resource group run the below cmd:

az resource list --resource-type  "Microsoft.Compute/virtualMachineScaleSets" -g '<rgName>'

OUTPUT:-
enter image description here

For more information please refer this SO THREAD:Azure PS command returns empty list as suggested by @Olga Osinskaya - MSFT

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