使用Powershell RM列出Azure App Service的实例

Sim*_*n C 2 powershell azure azure-web-sites octopus-deploy azure-resource-manager

我的目标是在Azure中找到特定App Service的所有实例ID,这样我就可以编写一个预热例程并针对所有正在运行的实例(ARRAfinity)进行测试.

我可以使用ASM Powershell执行以下操作,但我需要在ARM(RM)中为其配置Octopus.

(Get-AzureWebsite -Name "site-name" -Slot "Production").Instances
Run Code Online (Sandbox Code Playgroud)

我找到了关于RM备用的文档,以下内容并没有让我有所帮助:

Get-AzureRmWebApp -Name "site-name"
Run Code Online (Sandbox Code Playgroud)

任何帮助都会非常有帮助.

Dav*_*bbo 9

尝试这样的事情:

Get-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceType Microsoft.Web/sites/instances -Name $WebAppName -ApiVersion 2016-03-01
Run Code Online (Sandbox Code Playgroud)

另请参见此处了解适用于插槽的辅助功能.

  • 截至 2019 年 9 月更新:您可以使用 Az 模块并使用具有相同参数的命令 Get-AzResource 来实现相同的结果。 (2认同)