Azure App Service Deploy file in use

最后都变了- 提交于 2019-12-11 03:34:08

问题


In my project we use Azure App Service Deploy task to deploy our webdeploy packages.

I noticed that sometimes I get a file in use error while deploying, even when the option 'Take app offline' has been set on.

What is the best way to fix this ?

This is the error:

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.

回答1:


You can now use the 'Azure App Service Manage' task to stop and start the app service to prevent files being in use.




回答2:


I have a temporary fix as recommended in this page here

I have made a Azure CLI task using this command before the deploy:

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

(where XX is the resource group name, YY the web app service)

Then performing the deploy using Azure Web Deploy Task

Then performing this Azure CLI task after the deploy:

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

And that works.



来源:https://stackoverflow.com/questions/41055739/azure-app-service-deploy-file-in-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!