Is it possible to do swap, start, stop slots in cloud service classic, on azure devops?

给你一囗甜甜゛ 提交于 2021-01-29 03:10:42

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/59966577/is-it-possible-to-do-swap-start-stop-slots-in-cloud-service-classic-on-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!