Skip to content

Instantly share code, notes, and snippets.

@runesoerensen
Created February 8, 2014 14:52
Show Gist options
  • Save runesoerensen/8884870 to your computer and use it in GitHub Desktop.
Save runesoerensen/8884870 to your computer and use it in GitHub Desktop.
New Relic deployment notification using AppHarbor configuration
using (var webClient = new WebClient())
{
var appSettings = ConfigurationManager.AppSettings;
webClient.Headers.Add("x-license-key", appSettings["NEWRELIC_LICENSEKEY"]);
webClient.UploadValues(new Uri("https://api.newrelic.com/deployments.xml"), new NameValueCollection
{
{ "deployment[app_name]", "My Application" },
{ "deployment[user]", "AppHarbor" },
{ "deployment[description]", string.Format("Deployment notification from {0}", appSettings["appharbor.worker_name"]) },
{ "deployment[revision]", appSettings["appharbor.commit_id"] },
{ "deployment[environment]", appSettings["Environment"] },
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment