3
votes

I would like to configure New Relic on an Azure Mobile Services instance with a .Net backend. The instructions I found seem to relate only to the Azure Mobile Services with JavaScript backend: http://azure.microsoft.com/en-us/documentation/articles/store-new-relic-mobile-services-monitor/

I tried the instructions to install New Relic on Azure Cloud Services, hoping that that would resemble the Azure Mobile Services, but unfortunately that didn't work. It showed the following error messages:

*Updating project items newrelic.cmd, NewRelicAgent_x64_3.4.24.0.msi, and NewRelicServerMonitor_x64_3.2.6.0.msi

*Updating the Windows Azure ServiceDefinition.csdef with the newrelic.cmd Startup task Unable to find the ServiceDefinition.csdef file in your solution, please make sure your solution contains an Azure deployment project and try again.

Updating the Windows Azure ServiceConfiguration..cscfg files with the license key Unable to find any ServiceConfiguration.cscfg files in your solution, please make sure your solution contains an Azure deployment project and try again.

*Updating the projects .config file with the NewRelic.AppName

*Package install is complete

Azure Mobile Services doesn't use an Azure deployment project so the necessary settings for New Relic cannot be stored there.

Now my question: does anyone know how to get New Relic working for Azure Mobile Services with a .Net backend?

Thanks, Jeffry

3

3 Answers

3
votes

Ok, I managed to get it working with the help from someone from the Azure Mobile Services team. The reason it doesn't work is a bug that will be fixed, but in the mean time there's an easy work around.

These are the steps to get it working:

  1. Turn on “developer analytics” in the portal and select your New Relic add-on and then press Save.
  2. Now if you look under “app settings” you should now see “NEW_RELIC_LICENSE_KEY”
  3. Rename “NEW_RELIC_LICENSE_KEY” to “NEWRELIC_LICENSEKEY” while keeping the same value.
  4. Add these extra settings under “app settings”

    a. COR_ENABLE_PROFILING = 1

    b. COR_PROFILER = {71DA0A04-7777-4EC6-9643-7D28B46A8A41}

    c. NEWRELIC_HOME = d:\Home\site\wwwroot\newrelic

    d. COR_PROFILER_PATH = d:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll

  5. Press Save
  6. Make sure you have added the NewRelic.Azure.WebSites package to your project and published
  7. Fire off a few requests to your service

    a. You can use the built-in test client right in the browser, for example: http://newrelictest.azure-mobile.net/help/Api/GET-tables-TodoItem

    b. To authenticate leave the username blank and paste in your app key as the password. You can find your app key in the portal under “manage keys”.

    c. Press “try it out” and then send a few GETs

  8. You should now be able to start seeing your analytics trickle in through the New Relic portal.
2
votes

If deploying the .NET agent to Azure Mobile Services is possible, nobody has documented it. Microsoft provided the capability for deploying the Node.js agent in Mobile Services; they will need to do the same for the .NET agent. Your best option is to contact Microsoft Azure support directly.

Please post back here if they have a solution. It would be great to include this both within stackoverflow and on the New Relic Community Forums.

Regards, Kyle

1
votes

You can use the NewRelic with the .NET backend, but you'll need to do some manual work since the built-in support isn't ready yet. Here are the steps you'll need (I'll reference the tutorial to add NewRelic monitoring for the node.js backend to avoid rewriting what is already there):

  • Sign up for New Relic using the Azure Store: same steps as in the corresponding section of the node.js tutorial
  • In the mobile service project on VS, install the NuGet package "New Relic for Windows Azure Web Sites (x86)" -(NewRelic.Azure.WebSites)
  • Publish the project to Azure
  • Enable the NewRelic developer analytics for the mobile service:
    • Start by following the corresponding section in the node.js tutorial
    • Now go to the app settings of your mobile service, and add the following 5 keys:
      • COR_ENABLE_PROFILING, value: 1
      • COR_PROFILER, value: {71DA0A04-7777-4EC6-9643-7D28B46A8A41}
      • NEWRELIC_HOME, value: d:\Home\site\wwwroot\newrelic
      • COR_PROFILER_PATH, value: d:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
      • NEWRELIC_LICENSEKEY, value: <the same value of the NEW_RELIC_LICENSE_KEY setting>
  • Generate traffic to your mobile service. At this point you should be able to monitor the service in the NewRelic dashboard (same steps as corresponding section in the node.js tutorial)

Notice that the extra steps listed below (adding custom application settings) is a temporary workaround while the product doesn't finish the integration between the .NET backend and the developer analytics.