0
0

Application Insights の環境変数について

Last updated at Posted at 2024-05-13

はじめに

本記事は、App Service における Application Insights に関する環境変数を有効・無効化した場合の挙動について検証した結果をまとめたものである。

前提

  • App Service は作成済み
  • デフォルトの環境変数は下記の通り
    • WEBSITES_ENABLE_APP_SERVICE_STORAGE
    • DOCKER_ENGINE_CI
    • DOCKER_REGISTRY_SERVER_USERNAME
    • DOCKER_REGISTRY_SERVER_PASSWORD
    • DOCKER_REGISTRY_SERVER_URL
    • MICROSOFT_PROVIDER_AUTHENTICATION_SECRET
    • Auth0_AUTHENTICATION_SECRET

検証

1. Application Insights を有効化し、App Service を再起動

下記の環境変数が追加された

環境変数
APPINSIGHTS_INSTRUMENTATIONKEY c88XXXXXe44
APPLICATIONINSIGHTS_CONNECTION_STRING InstrumentationKey=c88XXXXXe44;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/
ApplicationInsightsAgent_EXTENSION_VERSION ~3
XDT_MicrosoftApplicationInsights_Mode recommended
APPINSIGHTS_PROFILERFEATURE_VERSION 1.0.0
DiagnosticServices_EXTENSION_VERSION ~3
APPINSIGHTS_SNAPSHOTFEATURE_VERSION 1.0.0
SnapshotDebugger_EXTENSION_VERSION diabled
InstrumentationEngine_EXTENSION_VERSION disabled
XDT_MicrosoftApplicationInsights_BaseExtensions disabled
XDT_MicrosoftApplicationInsights_PreemptSdk disabled
APPLICATIONINSIGHTS_CONFIGURATION_CONTENT

image (1).png

2. Application Insights を無効化し、App Service を再起動

APPINSIGHTS_INSTRUMENTATIONKEY と APPLICATIONINSIGHTS_CONNECTION_STRING を除く環境変数の値が disabledになった

環境変数
APPINSIGHTS_INSTRUMENTATIONKEY c88XXXXXe44
APPLICATIONINSIGHTS_CONNECTION_STRING InstrumentationKey=c88XXXXXe44;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/
ApplicationInsightsAgent_EXTENSION_VERSION disabled
XDT_MicrosoftApplicationInsights_Mode default
APPINSIGHTS_PROFILERFEATURE_VERSION disabled
DiagnosticServices_EXTENSION_VERSION disabled
APPINSIGHTS_SNAPSHOTFEATURE_VERSION disabled
SnapshotDebugger_EXTENSION_VERSION diabled
InstrumentationEngine_EXTENSION_VERSION disabled
XDT_MicrosoftApplicationInsights_BaseExtensions disabled
XDT_MicrosoftApplicationInsights_PreemptSdk disabled
APPLICATIONINSIGHTS_CONFIGURATION_CONTENT

image.png

3. Application Insights を有効化した状態で環境変数を削除し、App Service を再起動

Application Insights が無効化された

結果

  • Application Insights の有効・無効は環境変数によって判断されている
  • 環境変数が disabled の状態は、環境変数を削除した状態と同じである

以上

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