简体   繁体   English

使用.Net后端的Azure移动服务的新版本

[英]New Relic on Azure Mobile Services with .Net backend

I would like to configure New Relic on an Azure Mobile Services instance with a .Net backend. 我想在带有.Net后端的Azure移动服务实例上配置New Relic。 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/ 我发现的说明似乎只涉及带有JavaScript后端的Azure移动服务: 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. 我尝试了在Azure云服务上安装New Relic的说明,希望这类似于Azure移动服务,但不幸的是,这不起作用。 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 *更新项目项newrelic.cmd,NewRelicAgent_x64_3.4.24.0.msi和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. *使用newrelic.cmd启动任务更新Windows Azure ServiceDefinition.csdef无法在解决方案中找到ServiceDefinition.csdef文件,请确保您的解决方案包含Azure部署项目,然后重试。

Updating the Windows Azure ServiceConfiguration. 更新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. 带有许可证密钥的.cscfg文件无法在解决方案中找到任何ServiceConfiguration.cscfg文件,请确保您的解决方案包含Azure部署项目,然后重试。

*Updating the projects .config file with the NewRelic.AppName *使用NewRelic.AppName更新项目.config文件

*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. Azure移动服务不使用Azure部署项目,因此无法在此存储New Relic的必要设置。

Now my question: does anyone know how to get New Relic working for Azure Mobile Services with a .Net backend? 现在我的问题是:有没有人知道如何使用.Net后端为Azure移动服务工作New Relic?

Thanks, Jeffry 谢谢,杰弗里

Ok, I managed to get it working with the help from someone from the Azure Mobile Services team. 好的,我设法让它在Azure移动服务团队的帮助下工作。 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. 在门户中打开“开发人员分析”并选择New Relic插件,然后按“保存”。
  2. Now if you look under “app settings” you should now see “NEW_RELIC_LICENSE_KEY” 现在,如果您查看“应用程序设置”,您现在应该看到“NEW_RELIC_LICENSE_KEY”
  3. Rename “NEW_RELIC_LICENSE_KEY” to “NEWRELIC_LICENSEKEY” while keeping the same value. 将“NEW_RELIC_LICENSE_KEY”重命名为“NEWRELIC_LICENSEKEY”,同时保持相同的值。
  4. Add these extra settings under “app settings” 在“应用设置”下添加这些额外设置

    a. 一个。 COR_ENABLE_PROFILING = 1 COR_ENABLE_PROFILING = 1

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

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

    d. d。 COR_PROFILER_PATH = d:\\Home\\site\\wwwroot\\newrelic\\NewRelic.Profiler.dll 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 确保已将NewRelic.Azure.WebSites包添加到项目中并已发布
  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 您可以直接在浏览器中使用内置测试客户端,例如: 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. C。 Press “try it out” and then send a few GETs 按“试一试”,然后发送一些GET

  8. You should now be able to start seeing your analytics trickle in through the New Relic portal. 您现在应该可以通过New Relic门户开始看到您的分析。

If deploying the .NET agent to Azure Mobile Services is possible, nobody has documented it. 如果可以将.NET代理部署到Azure移动服务,则没有人记录它。 Microsoft provided the capability for deploying the Node.js agent in Mobile Services; Microsoft提供了在移动服务中部署Node.js代理的功能; they will need to do the same for the .NET agent. 他们需要为.NET代理做同样的事情。 Your best option is to contact Microsoft Azure support directly. 您最好的选择是直接联系Microsoft Azure支持。

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 . 将它们包含在stackoverflow和New Relic社区论坛中会很棒。

Regards, Kyle 问候,凯尔

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. 您可以将NewRelic与.NET后端一起使用,但由于内置支持尚未准备好,您需要进行一些手动操作。 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): 以下是您需要的步骤(我将参考教程为node.js后端添加NewRelic监视,以避免重写已存在的内容):

  • Sign up for New Relic using the Azure Store: same steps as in the corresponding section of the node.js tutorial 使用Azure Store注册New Relic:与node.js教程相应部分中的步骤相同
  • In the mobile service project on VS, install the NuGet package "New Relic for Windows Azure Web Sites (x86)" -( NewRelic.Azure.WebSites ) 在VS上的移动服务项目中,安装NuGet包“Windows Azure网站的新版本(x86)” - ( NewRelic.Azure.WebSites
  • Publish the project to Azure 将项目发布到Azure
  • Enable the NewRelic developer analytics for the mobile service: 为移动服务启用NewRelic开发人员分析:
    • Start by following the corresponding section in the node.js tutorial 首先按照node.js教程中相应部分进行操作
    • Now go to the app settings of your mobile service, and add the following 5 keys: 现在转到移动服务的应用程序设置,并添加以下5个键:
      • COR_ENABLE_PROFILING, value: 1 COR_ENABLE_PROFILING,值: 1
      • COR_PROFILER, value: {71DA0A04-7777-4EC6-9643-7D28B46A8A41} COR_PROFILER,价值: {71DA0A04-7777-4EC6-9643-7D28B46A8A41}
      • NEWRELIC_HOME, value: d:\\Home\\site\\wwwroot\\newrelic NEWRELIC_HOME,值: d:\\Home\\site\\wwwroot\\newrelic
      • COR_PROFILER_PATH, value: d:\\Home\\site\\wwwroot\\newrelic\\NewRelic.Profiler.dll COR_PROFILER_PATH,值: d:\\Home\\site\\wwwroot\\newrelic\\NewRelic.Profiler.dll
      • NEWRELIC_LICENSEKEY, value: <the same value of the NEW_RELIC_LICENSE_KEY setting> NEWRELIC_LICENSEKEY,值:<NEW_RELIC_LICENSE_KEY设置的相同值>
  • 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 ) 此时,您应该能够在NewRelic仪表板中监控服务(与node.js教程中相应部分的步骤相同)

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. 请注意,下面列出的额外步骤(添加自定义应用程序设置)是一种临时解决方法,而产品未完成.NET后端与开发人员分析之间的集成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM