Rory Primrose

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

View project on GitHub

Configuration for NewRelic 1.0.0.35 Azure Nuget package

I’ve previously posted about Nuget package update pain with the NewRelic Azure package (here and here). I’ve had issues again when updating to the latest version. This time I’ve added in a Worker role and found that the PowerShell script that installs the package did not configure the Worker role. I have gone through the PowerShell scripts to manually ensure that the configuration files match what they should be.

Here are the ServiceDefinition.csdef configurations for the two types of roles. The setup of this configuration seems to be the most common point of failure in the installation scripts.

Web Role

<WebRole>
    <Startup>
    <Task commandLine="newrelic.cmd" executionContext="elevated" taskType="simple">
        <Environment>
        <Variable name="EMULATED">
            <RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
        </Variable>
        <Variable name="IsWorkerRole" value="false" />
        </Environment>
    </Task>
    </Startup>
</WebRole>

Worker Role

<WorkerRole>
    <Startup>
    <Task commandLine="newrelic.cmd" executionContext="elevated" taskType="simple">
        <Environment>
        <Variable name="EMULATED">
            <RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
        </Variable>
        <Variable name="IsWorkerRole" value="true" />
        </Environment>
    </Task>
    </Startup>
    <Runtime>
    <Environment>
        <Variable name="COR_ENABLE_PROFILING" value="1" />
        <Variable name="COR_PROFILER" value="{FF68FEB9-E58A-4B75-A2B8-90CE7D915A26}" />
        <Variable name="NEWRELIC_HOME" value="D:\ProgramData\New Relic\.NET Agent\" />
    </Environment>
    </Runtime>
</WorkerRole>
Written on July 18, 2013