5
votes

I have automated deployment of ASP.NET MVC app which uses NewRelic for performance profiling to azure using MSBuild and WebDeploy.

I have used waws-prod-blu-001.publish.azurewebsites.windows.net:443 url for deployment as it was mentioned in publish profile. Also I stop my website before deployment and start after as NewRelic locks some log files so deployment fails. This is official workaround mentioned in NewRelic documentation.

Usually deployment takes 2-3 minutes. However last days deployment started taking more than 30 minutes and fails from time to time. I have downloaded new publish profile and noticed that WebDeploy url was changed to KUDU url ({my-app}.scm.azurewebsites.net:443). After updating url deployment takes 2-3 minutes as usual. However when I stop website KUDU is also not accessible and I cannot do deployment.

My question is: how can I do deployment of Azure website which uses NewRelic via KUDU when NewRelic requires website to be stopped while deployment and KUDU requires website running for deployment. Any other way of deployment are also acceptable.

I have already tried next things:

1) Deploy via FTP is also very, very slow as it uses the same url (ftps://waws-prod-blu-001.publish.azurewebsites.windows.net/).

2) Restaring website before deployment doesn't help. NewRelic still locks some log file.

2
That is an interesting problem you have there. I had to bin NewRelic because it does not support "Always On" option and just did not work. If you have access to "Always On" option, you can before deployment modify site configuration switch on "Always On", (this will disable NewRelic), do deployment, turn off "Always On". But this is a hack, so not submitting as an answer.trailmax
Also ask Azure support why old deployment has became slow. And support ticket to NewRelic why does it lock files and how to prevent. One of the answers will give you a working solution -)trailmax

2 Answers

10
votes

In the Azure portal you can force Azure to unload the profiler DLL file by changing the app setting COR_ENABLE_PROFILING to 0 and hitting save. This will restart IIS and unload the DLL without users seeing any error (just a delay in getting to the site). You can then run the deploy which should proceed without the locking issue. Make sure that the app setting is back to 1 when your finished deploying.

You can also do this via Azure Powershell.

0
votes

We made a recent change that allows Kudu to continue running even if you stop the site. So the simpler way to avoid this issue now is simply to stop the site, publish, and restart the site.