[英]In Visual Studio 2019, how to force deploy Azure App Service even if the app service is still running
From Visual Studio 2019 I publish my ASP.NET Core 2.1 WebAPI to Azure.从 Visual Studio 2019 开始,我将我的 ASP.NET Core 2.1 WebAPI 发布到 Azure。
The publish fails with this error message.发布失败并显示此错误消息。
Web deployment task failed. Web 部署任务失败。 (Web Deploy cannot modify the file 'xxxx.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at:http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE .) (Web Deploy 无法修改目标上的文件“xxxx.dll”,因为它被外部进程锁定。为了使发布操作成功,您可能需要重新启动应用程序以释放锁定,或者使用.Net 应用程序的 AppOffline 规则处理程序在您下次发布尝试时使用。了解更多信息:http ://go.microsoft.com/fwlink/?LinkId= 221672#ERROR_FILE_IN_USE。)
As a common practice, you can a new task on Azure Devops pipeline to stop the WebApp and restart the WebApp when deployment is done.作为一种常见做法,您可以在 Azure Devops 管道上执行一个新任务来停止 WebApp 并在部署完成后重新启动 WebApp。
If you don't have downtime You can configure the Azure Web App to have multiple slots
.如果您没有停机时间 您可以将 Azure Web 应用配置为具有multiple slots
。 Slots allow you to safely deploy your app and test it before making it available to your customers. Slots 允许您安全地部署您的应用程序并在将其提供给您的客户之前对其进行测试。
Also check Blue-Green Deployment with AppService另请使用 AppService检查蓝绿部署
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.