question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AzureRmWebAppDeployment fails to stop WebApp and fails with ERROR_FILE_IN_USE

See original GitHub issue

Our Release script uses the “Deploy AzureRM Web App” task and we have set “Take App Offline” to true.

Our WebApp no longer deploys, we get the following errors in the log:

2016-12-22T09:15:40.4470806Z ##[error]Failed to deploy website.
 
2016-12-22T09:15:40.4470806Z ##[error]Error Code: ERROR_FILE_IN_USE
 
2016-12-22T09:15:40.4470806Z More Information: Web Deploy cannot modify the file 'OurWebApp.exe' 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.
 
2016-12-22T09:15:40.4470806Z Error count: 1.

This used to work a while back, I am not quite sure when this error started happening. If we manually stop the app, the deploy works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
vincent1173commented, Jan 3, 2017

FILE_IN_USE error occurs when DLL’s are locked. App_offline brings the app down and unlocks the resource. ASPCore Module requires app_offline.htm but MSDeploy provides App_Offline.htm (case sensitive).

The fix for app_offline issue will be available soon.

0reactions
mvvsubbucommented, Jan 25, 2017

Closing it as there is another issue tracking the same https://github.com/Microsoft/vsts-tasks/issues/3312

Read more comments on GitHub >

github_iconTop Results From Across the Web

failed to deploy web app to App service" in Azure Devops?
How to solve "Error : failed to deploy web app to App service" in Azure Devops? Hi, I really dont know where this...
Read more >
Deploying to App Service from Azure Pipeline fails with error ...
task: AzureRmWebAppDeployment@3 displayName: 'Deploy Azure App Service' inputs: azureSubscription: 'Development' WebAppName: '$(AppName)' Package: '$(Agent.
Read more >
Azure Web App Deployment error: Web Deploy cannot modify ...
Hi, I'm using Azure Web App Deployment Task in a step of continuous integration on Visual Studio Team Services in hosted environment.
Read more >
How to not get "ERROR_FILE_IN_USE " error when deploying ...
I decided this issue by stopping my web app on a hosting. After it all had been succesfully published.
Read more >
Dealing with locked files - Azure WebApps - Deployment
Ever encountered an error like this below while deploying your code to Azure webapps? Microsoft.Web.Deployment.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found