The text of the error is:
web deploy cannot modify the file on the destination because it is locked by an external process in iis Remote Server
How can I investigate this?
The text of the error is:
web deploy cannot modify the file on the destination because it is locked by an external process in iis Remote Server
How can I investigate this?
If you are using VS tooling to publish using an msdeploy profile, then this property is automatically added to your pubxml.
True
In your output window you should see an msdeploy command similar to this.
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:manifest='C:\Users\vramak\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' -dest:manifest='C:\Users\vramak\AppData\Local\Temp\PublishTemp\obj\DestManifest.xml',ComputerName='https://netcoreappwithdb.scm.azurewebsites.net/msdeploy.axd',UserName='$netcoreappwithdb',Password='{PASSWORD-REMOVED-FROM-LOG}',IncludeAcls='False',AuthType='Basic' -verb:sync -enablerule:AppOffline -enableRule:DoNotDeleteRule -retryAttempts:20
-enablerule:AppOffline in the command should take care of adding the appOffline during deployment.
If custom appOffline content is needed, you can set this property in pubxml.
Path to app offline
The reason behind the issue is some of your files at the target of your publishing being in use, so they cannot be overwritten.
You could follow the below ways to resolve your issue:
Try to restart your app service. if your issue still exists every single time when you’re trying to deploy your changes to the server, especially in your development environment, and even more so, if it fails your automated deployments, this solution is not suitable.
Another way is you can also just modify the application settings to instruct MSDeploy to rename the files it can’t overwrite – it usually solves this issue! There are 2 ways to do that.
1)Edit the application settings at the target of your publishing:
Open your Azure Function’s/App Service’s application settings, and add the following key-value pair:
MSDEPLOY_RENAME_LOCKED_FILES = 1
2)Edit the publishing settings for MSDeploy:
Using Visual Studio for development, you can access the settings by clicking “Publish” on your project, and then clicking “Manage application settings” in the new window.
If the version is different then you can find clicking on the link to manage app (service) settings, you’ll get to a window like this, where you can just add the setting by clicking “Add”:
And add the new setting, something like below:
You could also refer this below link for more detail: