Azure deployment with and New Relic
Asked Answered
W

2

5

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.

Wellborn answered 15/7, 2014 at 9:51 Comment(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.Supersonics
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 -)Supersonics
E
10

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.

Epicanthus answered 15/7, 2014 at 16:17 Comment(2)
I just ran into this and this solution worked for me. My error was: Web Deploy cannot modify the file 'NewRelic.Collections.dll' on the destination because it is locked by an external process.Bassist
Like Cameron, I was unable to deploy because the NewRelic.Collections.dll file was in use. Unfortunately, adding that app setting, stopping/starting/restarting the prep slot didn't make any difference. I wound up having to delete and recreate my prep slot in order for my deployment to succeed.Hayse
S
0

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.

Stav answered 14/9, 2014 at 5:14 Comment(1)
As I mentioned on Twitter, stopping the site does not release the lock. I've run into this issue many times while trying to deploy Azure Websites, and it's made me tear my hair out every time. The marked answer is the only solution that has worked consistently.Elephant

© 2022 - 2024 — McMap. All rights reserved.