是否可以在天蓝色的devops上交换,启动,停止云服务经典版中的插槽? [英] Is it possible to do swap, start, stop slots in cloud service classic, on azure devops?
问题描述
我使用 azure devops 对 Cloud Service(经典)做ci/cd.我在此Cloud Service中具有开始或停止和交换插槽之类的步骤.我以为可以将 PowerShell 用于这些目标.一开始,我尝试了Azure PowerShell作业.不幸的是,我没有在 Az 和 azureRM 模块中找到所需的命令.因此,我决定只使用PowerShell作业,在其中安装Azure模块,并想使用这些命令 Start-AzureService
和 Stop-AzureService
.这是正确的方法吗?还是有更好的东西?
I do ci/cd to Cloud Service(classic) with azure devops. I have steps like start or stop and swap slots in this Cloud Service. I thought I can use PowerShell for these goals.
In the beginning, I tried Azure PowerShell job. Unfortunately, I have not found the required commands in Az and azureRM modules.
So I decided to use just PowerShell job, where I install the Azure module and I want to use these commands Start-AzureService
and Stop-AzureService
. Is it the right way? Or is there something better?
推荐答案
是的,原则上是正确的,但是您可以为此使用ARM代理提供程序( Microsoft.ClassicCompute
):
Yes, in principle that would be true, however you can use the ARM proxy provider (Microsoft.ClassicCompute
) for that:
Invoke-AzResourceAction -ResourceGroupName $resourceGroup `
-ResourceType 'Microsoft.ClassicCompute/domainNames/slots' `
-ResourceName $cloudService/$slotName `
-ApiVersion '2018-06-01' -Action 'Stop' -Force
我没有可运行的云服务来对此进行测试,但应该足够接近
I don't have a working cloud service to test this, but should be close enough
这篇关于是否可以在天蓝色的devops上交换,启动,停止云服务经典版中的插槽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!