I am developing an Azure Functions Project and when I publish first time, OK. Then I publish again, this Error appears:
Web Deploy cannot modify the file 'FunctionApp5.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.
It only Publishes if I enter Azure portal, and Restart this Azure Function App
Set
MSDEPLOY_RENAME_LOCKED_FILES=1
in the Azure Function Application Settings usually resolved this
This can also be done in Visual Studio on the Publish -> Application Settings:
Following this article, you could also try adding this directive in your Web Deploy pubxml to instruct taking the Function app offline while deploying:
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With