Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to track deployment to Azure webapp in NewRelic?

Background info: I have set up Azure to automatically deploy code from develop branch (on Github) to dev-webapp when code is pushed to develop branch. When code is pushed to master branch, Azure deploys code from master branch to test-webapp and pre prod-deployment slot.

In Azure I'm using New Relic Appservice to monitor these apps. It works. What I want now is to notify New Relic when code is deployed to a webapp.

Quote New Relic:

To notify New Relic of a deployment, you can POST to https://api.newrelic.com/deployments.xml and add the API key as a header

To notify New Relic when code is deployed to dev and test, I could set up webhook in GitHub to run when code is pushed to develop-branch and master-branch. I have tested this, and it works. I feel like it is not optimal since the notification comes from Github, and not from Azure which is where the deployment actually takes place.

I also want to notify New Relic when the pre-prod deploymentslot is swapped with prod.

Is it possible? And what could be the best way to do this?

Maybe webjobs could be the soulution? This should be a webjob that only runs once after webapp is deployed and deployment-slot is swapped (for prod). I cannot find any information about setting up such job.

like image 833
henrik Avatar asked Oct 02 '15 20:10

henrik


1 Answers

use powershell to swap slots and call new relic uri https://azure.microsoft.com/en-us/documentation/articles/web-sites-staged-publishing/

I'm sorry I don't know New Relic but perhaps there is some similar solution as in application insights (why don't switch?), where you can specify version to be send: http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions.aspx (part: Version to Version comparisons)

like image 134
David B. Avatar answered Oct 26 '22 05:10

David B.