【发布时间】:2019-07-30 00:48:12
【问题描述】:
我想停止当前在 Azure 的应用计划中的所有应用上运行的具有特定名称的 Web 作业。我更喜欢 PowerShell,但是 Azure PS 模块与 az cli 相比缺少,所以我最终得到了以下内容,感觉真的很笨重:
Get-AzWebApp
|
where ServerFarmId -EQ '$appPlanId'
|
select Name, ResourceGroup
|
% {az webapp webjob continuous list --name $_.Name --resource-group $_.ResourceGroup --query '[].{Id:id}' | ConvertFrom-Json}
|
% {az webapp webjob continuous stop --webjob-name $webjobName --ids "$($_.Id)"}
我很感激有关更好方法的建议。
【问题讨论】:
-
据我所知,这是一种简单的方法。 Powershell 对此更加复杂。
标签: azure powershell azure-webjobs azure-powershell azure-cli