简体   繁体   English

在 Visual Studio 2019 中,即使应用服务仍在运行,如何强制部署 Azure 应用服务

[英]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。)

  1. If I manual stop in the App Service in Azure and then publish, the error does not appear.如果我在 Azure 中的应用服务中手动停止然后发布,则不会出现该错误。
  2. Problem happens intermittently.问题间歇性发生。

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.

相关问题 无法从 Visual Studio 2019 将 web 部署到 Linux 应用服务 - Unable to web deploy to Linux App Service from Visual Studio 2019 如何在Azure App Service上部署Windows服务 - How to deploy windows service on Azure App Service 通过 Visual Studio 2019 将逻辑应用部署到 Azure - Deploy Logic App to Azure via Visual Studio 2019 无法使用 Visual Studio 2019 部署我的 Azure Web 应用程序 - Unable to deploy my Azure Web App using visual studio 2019 Visual Studio 2019 IIS 配置文件创建 web.config 文件,该文件破坏了 Azure 应用服务 - Visual Studio 2019 IIS profile creates web.config file that breaks Azure App Service 无法从 Visual Studio 2019 社区版附加到 Azure 应用服务 - Unable to attach to Azure App Service from Visual Studio 2019 Community edition Visual Studio 2022 调试 Azure 应用服务 - Visual Studio 2022 Debug Azure App Service 如何使用 Visual Studio 中的路径映射将调试器附加到 Azure 应用服务? - How to attach a debugger to Azure App Service with path mapping in Visual Studio? 将 Angular 8 通用应用程序部署到 Linux 运行节点上的 Azure 应用程序服务 - Deploy an Angular 8 Universal App to an Azure App Service on Linux Running Node 如何将.NETCore应用程序部署到Azure Service Fabric - How to Deploy .NETCore App to Azure Service Fabric
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM