[英]Azure DevOps - App Service - Parallel Slot Swap
This Deploy Task is super cool. 这个部署任务非常酷。 I want to do two at once. 我想一次做两个。 Is there a way to do this via DevOps tasks? 有没有办法通过DevOps任务执行此操作? If not are there any know work-arounds? 如果没有,是否有任何已知的解决方法? I tried this with Azure PowerShell but the commands didn't fire, even though it works locally :( 我尝试使用Azure PowerShell,但命令没有触发,即使它在本地工作:(
Start-Job -Name API {
#Switch-AzureRmWebAppSlot -SourceSlotName "staging" -DestinationSlotName "production" -ResourceGroupName "CoolResGroup" -Name "something-api-east"
}
Write-Host "API Staging <-> Prod swap initiated"
Start-Job -Name Web {
#Switch-AzureRmWebAppSlot -SourceSlotName "staging" -DestinationSlotName "production" -ResourceGroupName "CoolResGroup" -Name "something-web-east"
}
Write-Host "Web Staging <-> Prod swap initiated"
Wait-Job -Name API
Wait-Job -Name Web
If (Get-Job -Name API -ea silentlycontinue)
{
Write-Host "API state: $((Get-Job -Name API).State)"
}
Else
{
Write-Host "API slot swap complete."
}
If (Get-Job -Name Web -ea silentlycontinue)
{
Write-Host "Web state: $((Get-Job -Name Web).State)"
}
Else
{
Write-Host "Web slot swap complete."
}
By default those powershell cmdlets are blocking, so you either need to start them in a background thread, or convert them to API calls (they shouldn't be blocking). 默认情况下,那些powershell cmdlet是阻塞的,因此您需要在后台线程中启动它们,或者将它们转换为API调用(它们不应该阻塞)。 This way you can perform those 2 calls more or less at the same time. 这样,您可以同时或多或少地执行这两个呼叫。
This would, however, complicate your flow, as you'd need to detect if both swaps completed fine (so an extra check you'd need to make). 但是,这会使您的流量变得复杂,因为您需要检测两个掉期是否完成(因此需要额外检查)。
Alternatively you are better of using A\\B deployments. 或者,您最好使用A \\ B部署。 Links: https://www.hanselman.com/blog/ABTestingAndTestingInProductionWithAzureWebApps.aspx 链接: https : //www.hanselman.com/blog/ABTestingAndTestingInProductionWithAzureWebApps.aspx
http://involvenevolve.com/post/managing-azure-app-service-routing-rules/ http://involvenevolve.com/post/managing-azure-app-service-routing-rules/
https://docs.microsoft.com/ru-ru/cli/azure/webapp/traffic-routing?view=azure-cli-latest#az-webapp-traffic-routing-set https://docs.microsoft.com/ru-ru/cli/azure/webapp/traffic-routing?view=azure-cli-latest#az-webapp-traffic-routing-set
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.