You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过PowerShell访问Azure资源?Service Bus等资源查询方法

正确获取Azure Service Bus、App Service及App Service Plan资源的PowerShell命令

你之前用az monitor app-insights component show能成功,是因为App Insights属于Azure监控类组件,归类在az monitor子命令下,但Service Bus、App Service、App Service Plan是Azure核心服务,对应的CLI命令不在az monitor路径下,所以直接用az monitor servicebus component show会报错。下面是针对这三类资源的正确操作命令:

Service Bus

Service Bus的核心资源是命名空间,队列、主题等都是命名空间下的子资源,根据需求选择对应命令:

  • 获取指定资源组下的单个Service Bus命名空间:
    az servicebus namespace show --name <你的ServiceBus命名空间名称> --resource-group <资源组名称> | ConvertFrom-Json
    
  • 获取当前订阅下所有Service Bus命名空间:
    az servicebus namespace list | ConvertFrom-Json
    

如果需要获取命名空间下的队列/主题等子资源,可使用az servicebus queue show、az servicebus topic show等对应子命令,用法类似。

App Service

App Service对应的CLI子命令是webapp,操作命令如下:

  • 获取指定资源组下的单个App Service:
    az webapp show --name <你的AppService名称> --resource-group <资源组名称> | ConvertFrom-Json
    
  • 获取当前订阅下所有App Service:
    az webapp list | ConvertFrom-Json
    

App Service Plan

App Service Plan的CLI子命令是appservice plan,操作命令如下:

  • 获取指定资源组下的单个App Service Plan:
    az appservice plan show --name <你的AppServicePlan名称> --resource-group <资源组名称> | ConvertFrom-Json
    
  • 获取当前订阅下所有App Service Plan:
    az appservice plan list | ConvertFrom-Json
    

内容的提问来源于stack exchange,提问作者user19502045

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 01:20:39