LoginSignup
0
0

More than 1 year has passed since last update.

[Application Insights] プロジェクトに追加する

Last updated at Posted at 2019-07-05

ウェブ開発では必須のApplication Insightsの導入方法をおさらい。サービスの解析、問題解明などなどに日々使っています。

こちらを参照:
https://docs.microsoft.com/en-us/azure/azure-monitor/learn/dotnetcore-quick-start

#1. Azure上でApplication Insightsを作成

新しいリソース追加→からのApplication Insightsを選択、必要な項目を埋めます。Application Insightsを消費するサービスと同じリージョンを選択します。(そうじゃないとネットワーク料金がかかってしまいます)

image.png

#2. Application Insight SDKをプロジェクトに追加

image.png

作業の開始をクリック

image.png

次のページで1で作成したApplication Insightsを選択します。簡単!

#3. ILogger経由で自分のログを記録する

ASP.NET Core 2.xにてILoggerというインターフェイスが用意されています。

こちらを参照:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.2

おしまい

これで設定は終わりです。

次はApplication Insightsを使ってログを記録してみます。 [AZURE] Application Insightsで指定した情報を確認する

0
0
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
0
0