通过管道进行 Azure App Service Canary 部署

Azure App Service Canary Deployment through Pipeline

我们使用 Azure Devops 流程部署到暂存槽,然后我们在暂存和生产之间进行直接交换。

我们注意到,通过门户界面,我们可以将一定比例的流量引导至暂存,是否有一种方法可以通过 Azure Devops/CD 流程执行此操作,以便我们将一定比例的流量引导至特定插槽然后逐渐增加,本质上是一种使用 Azure Web App Slots 通过管道进行金丝雀部署的方法?

提前致谢。

看着 the documentation 看起来是可能的:

Next to the Azure portal, you can also use the az webapp traffic-routing set command in the Azure CLI to set the routing percentages from CI/CD tools like DevOps pipelines or other automation systems.

您可以使用此命令增加流量:

az webapp traffic-routing set --distribution staging=50 --name MyWebApp --resource-group MyResourceGroup

并且使用 Start-Sleep -Seconds 10 你可以逐渐增加百分比。