【问题标题】:Azure App Service Deploy file in use正在使用的 Azure 应用服务部署文件
【发布时间】:2017-02-10 20:27:14
【问题描述】:

在我的项目中,我们使用 Azure App Service Deploy 任务来部署我们的 webdeploy 包。

我注意到,有时我在部署时遇到文件正在使用错误,即使已设置“使应用脱机”选项也是如此。

解决此问题的最佳方法是什么?

这是错误:

2016-12-07T15:26:44.8411101Z ##[error]Failed to deploy website.

2016-12-07T15:26:44.8411101Z ##[error]Error Code: ERROR_FILE_IN_USE

2016-12-07T15:26:44.8421096Z More Information: Web Deploy cannot modify the file 'Microsoft.CodeAnalysis.CSharp.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.

【问题讨论】:

    标签: azure azure-pipelines-release-pipeline


    【解决方案1】:

    您现在可以使用'Azure App Service Manage' 任务来停止和启动应用服务,以防止文件被使用。

    【讨论】:

      【解决方案2】:

      我有一个本页建议的临时修复程序here

      我在部署之前使用此命令创建了一个 Azure CLI 任务:

      azure webapp stop --resource-group XX --name YY
      

      (其中 XX 是资源组名称,YY 是 Web 应用服务)

      然后使用 Azure Web 部署任务执行部署

      然后在部署后执行此 Azure CLI 任务:

      azure webapp start --resource-group XX --name YY
      

      这行得通。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-02-19
        • 1970-01-01
        • 1970-01-01
        • 2020-01-16
        • 2021-08-01
        • 2019-08-14
        相关资源
        最近更新 更多