azure - 是否可以在 azure devops 上的经典云服务中进行交换、启动、停止插槽?

标签 azure powershell azure-devops azure-powershell

我使用azure devops云服务(经典)进行ci/cd。我在此云服务中有启动停止以及交换槽等步骤。我认为我可以使用 PowerShell 来实现这些目标。 一开始,我尝试了 Azure PowerShell 作业。不幸的是,我没有在 AzazureRM 模块中找到所需的命令。 因此,我决定仅使用 PowerShell 作业,在其中安装 Azure 模块,并且我想使用这些命令 Start-AzureServiceStop-AzureService。这是正确的方法吗?或者有什么更好的吗?

最佳答案

是的,原则上是这样,但是您可以使用 ARM 代理提供程序 (Microsoft.ClassicCompute):

Invoke-AzResourceAction -ResourceGroupName $resourceGroup `
    -ResourceType 'Microsoft.ClassicCompute/domainNames/slots' `
    -ResourceName $cloudService/$slotName `
    -ApiVersion '2018-06-01' -Action 'Stop' -Force

我没有可用的云服务来测试这一点,但应该足够接近

关于azure - 是否可以在 azure devops 上的经典云服务中进行交换、启动、停止插槽?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59966577/

相关文章:

azure - Microsoft.Azure.WebJobs.Extensions.EventGrid : Object reference not set to an instance of an object

azure - Application Insights 查询显示请求总数、通过总数和失败总数

Azure Blob 源错误 : The remote server returned an error: (400) Bad Request

search - PowerShell,在特定目录中搜​​索特定文件名

sharepoint - 用于帮助台的 Powershell 脚本的 Web 前端

git - Azure DevOps 默认权限

android - 在 Azure Pipelines 的 Ubuntu 代理上构建 Android 项目时,SDK 目录不可写

Azure 数据工厂仅从 Blob 存储复制数据 新添加的文件

c# - 创建显示更新通知的 NuGet 包

azure - 有没有办法在 YML 中使用 Azure Artifacts 触发管道?