I created a dummy Hello World ASP.NET 5 (MVC 6) project hosted in Visual Studio Online's Git. I followed the steps described at this document to build and deploy into my Azure Websites.
It took me several attempts as the build failed with errors such as "Unable to restore NuGet package" or inexisting wwwfolder (which I had to commit to source control to have it working) but I got it working and the app is up and running.
The issue I need help with is with the Continuous Integration configuration. In Visual Studio I have selected a CI trigger to build/deploy whenever there is a check-in in my master branch. This triggers the attempt properly but it constantly fails with this error.
Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'AspNet.Loader.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.
How to solve this problem?
Thank you.
PS: Also I don't know why in Azure websites under Deployment I cannot see the log. When I was using a GitHub hook it used to display all the failed/successful deployments.
Usually in Azure under the web app > DEPLOYMENTS
I ran into the same issue. There are probably more elegant ways of dealing with it if you have multiple deployment slots but for my situation having a minute of downtime during deployment is acceptable.
You can modify the script to use Start-AzureWebsite and Stop-AzureWebsite Note: I added $hostNameIndex as this needs to change if you add domain names. You could then pass this in the Azure Powershell Script Arguments.
Resources: