Azure App服务交换任务受应用服务IP白名单的阻碍:无法更新部署历史记录
我最近在预生产环境中启用了IP白色,并注意到了以下问题。
当我在Azure DevOps中运行Azure App Service Manager
任务以交换我的部署和生产插槽时,我会被警告## [警告]击中错误:错误:无法更新部署历史记录。禁止IP(代码:403)
。
这会导致该站点在交换后尝试访问站点时丢弃500.30和503错误。
在然后重新启动应用程序之前,这很容易修复,但是当然,最好的流量是在部署插槽交换后不必进行任何停机时间。
白名单上的DevOps Service标签
我认为解决方案是在预生产环境的白名单上包括DevOps Service标签。但是可悲的是,这对错误没有影响。
发布管道任务的完整输出。
2022-05-19T07:16:02.7051171Z ##[section]Starting: Swap CM slots
2022-05-19T07:16:02.7173325Z ==============================================================================
2022-05-19T07:16:02.7173625Z Task : Azure App Service manage
2022-05-19T07:16:02.7173987Z Description : Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service
2022-05-19T07:16:02.7174442Z Version : 0.200.0
2022-05-19T07:16:02.7174628Z Author : Microsoft Corporation
2022-05-19T07:16:02.7174919Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-app-service-manage
2022-05-19T07:16:02.7175256Z ==============================================================================
2022-05-19T07:16:03.7506005Z Warming-up slots
2022-05-19T07:16:04.1489337Z Swapping App Service 'my-site-as-cm-tst' slots - 'secondary' and 'production'
2022-05-19T07:17:52.5029319Z Swapped App Service 'my-site-as-cm-tst' slots - 'secondary' and 'production'
2022-05-19T07:17:59.5975474Z Successfully updated deployment History at https://my-site-secondary.scm.azurewebsites.net/api/deployments/151652944672891
2022-05-19T07:17:59.7169507Z ##[warning]Error: Failed to update deployment history. Ip Forbidden (CODE: 403)
2022-05-19T07:17:59.7221693Z ##[section]Finishing: Swap CM slots
I have recently enabled IP whitelisting on my pre-production environments and noticed the following issue.
When I run the Azure App Service Manager
Task in Azure DevOps to Swap my deployment and production slot I get hit with a warning ##[warning]Error: Failed to update deployment history. Ip Forbidden (CODE: 403)
.
This causes the site to throw a 500.30 and 503 errors when attempting to access the site after a swap.
This is easily fixed by then restarting the application, but of course the best flow would be to not have to have any downtime after a deployment slot swap.
DevOps service tag on whitelist
I figured the solution would be to include DevOps service tag on the whitelist of the pre-production environments.. But sadly that had no impact on the errors.
Full output of the release pipeline task.
2022-05-19T07:16:02.7051171Z ##[section]Starting: Swap CM slots
2022-05-19T07:16:02.7173325Z ==============================================================================
2022-05-19T07:16:02.7173625Z Task : Azure App Service manage
2022-05-19T07:16:02.7173987Z Description : Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service
2022-05-19T07:16:02.7174442Z Version : 0.200.0
2022-05-19T07:16:02.7174628Z Author : Microsoft Corporation
2022-05-19T07:16:02.7174919Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-app-service-manage
2022-05-19T07:16:02.7175256Z ==============================================================================
2022-05-19T07:16:03.7506005Z Warming-up slots
2022-05-19T07:16:04.1489337Z Swapping App Service 'my-site-as-cm-tst' slots - 'secondary' and 'production'
2022-05-19T07:17:52.5029319Z Swapped App Service 'my-site-as-cm-tst' slots - 'secondary' and 'production'
2022-05-19T07:17:59.5975474Z Successfully updated deployment History at https://my-site-secondary.scm.azurewebsites.net/api/deployments/151652944672891
2022-05-19T07:17:59.7169507Z ##[warning]Error: Failed to update deployment history. Ip Forbidden (CODE: 403)
2022-05-19T07:17:59.7221693Z ##[section]Finishing: Swap CM slots
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否检查REST网站scm.azurewebsites.net必须允许一切,即无限制。
另外,与***。azurewebsites.net相同的限制应不受组织。
您也可以在插槽交换上参考此详细文档: https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#hath-what what happens-during-happens-during-a-a-swap
Could you check the REST site scm.azurewebsites.net must have Allow All, i.e. no restriction.
Also, Same restrictions as ***.azurewebsites.net should be unchecked.
You may also refer to this detailed document on Slot Swap: https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#what-happens-during-a-swap