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.
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.
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