Rory Primrose

Learn from my mistakes, you don't have time to make them yourself

View project on GitHub

NewRelic Azure NuGet package update pain again

I previously posted about issues I found when updating to the latest Azure NuGet package published by NewRelic. Unfortunately the install PowerShell script for the latest package now has more issues than the previous version. Here are the issues I found and how to fix them.

  1. newrelic.cmd not updated
    I believe the issue here (unconfirmed) is that the file is not updated because it has been changed as part of the previous package installation. The fix is to uninstall the previous package first and then manually delete the newrelic.cmd file. The uninstall won’t remove the file for the same reason.
  2. The license key is not written to newrelic.cmd
    This is a bug in the newrelic.cmd file published with the package. The install script is expect the file to have the line SET LICENSE_KEY=REPLACE_WITH_LICENSE_KEY so that the installer can substitute the value. Unfortunately the cmd file in the package has an actual license key rather than the expected placeholder. This means someone else’s license key will be used rather than your own.
  3. Same as my previous experience, ServiceDefinition.csdef was not found. You need to manually update this file to contain the following XML (slightly different to the previous version).
    <Task commandLine="newrelic.cmd" executionContext="elevated" taskType="simple">
        <Variable name="EMULATED">
        <RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
        <Variable name="IsWorkerRole" value="false" />

Note that this XML is for a WebRole only. The WorkerRole XML has additional elements and attributes that you will need to add according to the PowerShell script.

Written on April 3, 2013