LoginSignup
2
1

More than 5 years have passed since last update.

Azure App ServicesをNew Relicでパフォーマンス監視する

Posted at

ASP.NETサンプルアプリをVisual Studioからデプロイして、New Relic APMでパフォーマンス監視してみました。

実行環境

  • Azure App Service Web Apps (App Service Plan Free)
  • Visual Studio 2015

Web Apps作成

  • ポータルから[新規]→[Web App]の順に選択する
    image.png

  • アプリ名とApp Service名を入力して[作成]をクリック(App Service PlanはFreeにしてます)
    image.png

  • 作成できたら完了
    image.png

New Relic準備

  • New Relicのポータルにログインして[APM]→[Microsoft .NET]の順に選択する
    image.png

  • 環境を聞かれるので、[Azure]→[Azure Website]→[Visual Studio]の順に選択し、[Generate My Instructions]を選択する
    image.png

  • [Reveal license key]を選択し、表示されたLicenseKeyをメモしておく
    image.png

Web Apps設定

  • 作成したWeb Appsを開き、[アプリケーション設定]を選択する
    image.png

  • アプリ設定欄に以下のように5行追記する。NEW_RELIC_LICENSE_KEYは、先程メモしたLicenseKeyを入力する

Key Value
COR_ENABLE_PROFILING 1
COR_PROFILER {71DA0A04-7777-4EC6-9643-7D28B46A8A41}
COR_PROFILER_PATH D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
NEWRELIC_HOME D:\Home\site\wwwroot\newrelic
NEW_RELIC_LICENSE_KEY メモしたLicenseKey

image.png

  • [保存]を選択する
    image.png

  • 左バーより、[拡張機能]を選択する
    image.png

  • [追加]を選択する
    image.png

  • 拡張機能の選択画面より、[New Relic]を選択する
    image.png

  • 法令条項画面で[OK]を選択する

  • New Relicが追加されていることを確認する
    image.png

  • 左バーより、[概要]を選択し、[再起動]を選択する
    image.png

Visual Studio準備

  • Visual Studioを開き、[ファイル]→[新規作成]→[プロジェクト]の順に選択する
  • 今回はサンプルとしてASP.NET Web Applicationのテンプレートを使用する
    image.png

  • [MVC]を選択する
    image.png

  • ソリューションエクスプローラーより、プロジェクトを右クリックし、[公開]を選択する
    image.png

  • 発行先に[Microsoft Azure App Service]を選択する
    image.png

  • AzureのログインID/パスワードを入力すると、自IDの閲覧権限のあるWeb Appsが表示されるので、先程作成したWeb Appsを選択する
    image.png

  • [接続の検証]を選択する
    image.png

  • Web Appsへの接続が問題なければ以下のような画面になる
    image.png

  • [発行]を選択する
    image.png

パフォーマンス情報確認

  • NewRelicポータルに戻ると、Web Appsアプリケーション名で追加されている
    image.png

  • ドリルダウンしていくと各種アプリケーションパフォーマンスを確認することができる
    image.png

注意点

公式インストール手順によると、Visual Studio SolutionにNuget Packageをインストールすることになってますが、それやっちゃうとなぜかVisual StudioからのWebAppsへのデプロイに失敗しました。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1