概要

Use this guide to manually set up the Datadog Azure integration through an app registration with read permissions to the monitored subscriptions.

All sites: All Datadog sites can use the steps on this page to complete the app registration credential process for Azure metric collection and the Event Hub setup for sending Azure Platform Logs.

US3: If your organization is on the Datadog US3 site, you can use the Azure Native integration to streamline management and data collection for your Azure environment. Datadog recommends using this method when possible. Setup entails creating a Datadog resource in Azure to link your Azure subscriptions to your Datadog organization. This replaces the app registration credential process for metric collection and Event Hub setup for log forwarding. See the Azure Native manual setup guide for more information.

セットアップ

Azure CLI を使用して統合する

To integrate Datadog with Azure using the Azure CLI, Datadog recommends using the Azure Cloud Shell.

First, log into the Azure account you want to integrate with Datadog:

az login

サービスプリンシパルを作成し、Azure リソースへのアクセスを構成します。

az ad sp create-for-rbac

サブスクリプションのリストを表示し、subscription_id をコピーアンドペーストできるようにします。

az account list --output table

次の形式を使用して、サービスプリンシパルとなるアプリケーションを作成します。

az ad sp create-for-rbac --role "Monitoring Reader" --scopes /subscriptions/{subscription_id}

出力例:

{
  "appId": "4ce52v13k-39j6-98ea-b632-965b77d02f36",
  "displayName": "azure-cli-2025-02-23-04-27-19",
  "password": "fe-3T~bEcFxY23R7NHwVS_qP5AmxLuTwgap5Dea6",
  "tenant": "abc123de-12f1-82de-97bb-4b2cd023bd31"
}
  • このコマンドは、監視するサブスクリプションに対する monitoring reader ロールをサービスプリンシパルに付与します。
  • The appID generated from this command must be entered in the Datadog Azure integration tile under Client ID.
  • Enter the generated Tenant ID value in the Datadog Azure integration tile under Tenant name/ID.
  • --scope は複数の値をサポートすることができ、一度に複数のサブスクリプションまたは管理グループを追加することができます。az ad sp ドキュメントにある例を参照してください。
  • 自分で選択した名前を使用する場合は、--name <CUSTOM_NAME> を追加します。それ以外の場合は、Azure によって一意の名前が生成されます。この名前は、セットアッププロセスでは使用されません。
  • Add --password <CUSTOM_PASSWORD> to use a hand-picked password. Otherwise Azure generates a unique one. This password must be entered in the Datadog Azure integration tile under Client Secret.

管理グループは、スコープとして有効かつ推奨されるオプションです。例:

az account management-group entities list --query "[?inheritedPermissions!='noaccess' && permissions!='noaccess'].{Name:displayName,Id:id}" --output table
  • このコマンドは、ユーザーがアクセスできるすべてのサブスクリプションと管理グループを表示します。
  • ID を結合して、サービスプリンシパルを作成します。このコマンドを 1 つ実行するだけで、ユーザーを作成し、すべての管理グループ/サブスクリプションにロールを割り当てることができます

最初に、Datadog と統合する Azure アカウントにログインします。

azure login

account show コマンドを実行します。

az account show

生成されたテナント ID 値を Datadog Azure インテグレーションタイルTenant name/ID に入力します。

名前とパスワードを作成します。

azure ad sp create -n <NAME> -p <PASSWORD>
  • <NAME> は使用されませんが、セットアッププロセスの一環として必要です。
  • The <PASSWORD> you choose must be entered in the Datadog Azure integration tile under Client Secret.
  • このコマンドから返されるオブジェクト ID を、次のコマンドの <OBJECT_ID> の代わりに使用します。

次の形式を使用して、サービスプリンシパルとなるアプリケーションを作成します。

azure role assignment create --objectId <オブジェクト_ID> -o "Monitoring Reader" -c /subscriptions/<サブスクリプション_ID>/
  • このコマンドは、監視するサブスクリプションに対する monitoring reader ロールをサービスプリンシパルに付与します。
  • The Service Principal Name generated from this command must be entered in the Datadog Azure integration tile under Client ID.
  • <SUBSCRIPTION_ID> は監視対象の Azure サブスクリプションです。これは、azure account show コマンドを使用すると、またはポータルに ID として一覧表示されます。

Azure ポータルを使用して統合する

  1. In the Azure integration tile, select Configuration > New App Registration > Using Azure Portal.

  2. Select Management Group (Auto-Discover) or Individual Subscriptions.

    • If you select Management Group, Datadog automatically discovers and monitors any subscriptions within that selected scope, including any subscriptions created in the future. You must have the owner role in the Management Group selected.
    • If you select Individual Subscriptions, you must have the owner role in any subscriptions you want to monitor.
  3. Click Open Template.

The Azure tile in the Datadog integrations page with Using Azure Portal and Management Group selected
  1. Select the Region, Subscription, and Resource Group for the template to be deployed.

    Note: The selection of region, subscription, and resource group only defines where this template is deployed. It has no impact on which subscriptions are monitored by Datadog.

  2. Next をクリックします。

  3. Select the Create new option in Service principal type.

  4. Click the Change selection link in Service principal. A form to create a new app registration is displayed:

The service principal page in the Azure ARM template with the option to Create New selected and the link to Change Selection highlighted
  1. Enter a name for the app registration, select the supported account types, and click Register.

  2. A page opens to create a client secret. Click + New client secret to add a client secret.

  3. Copy the value of the client secret, and click the close (X) button in the top-right corner of the screen.

  4. Paste the value of the client secret in the corresponding field on the template, and click Next.

  5. Provide a Datadog API key and Datadog Application key value in the corresponding fields. If you launched the template from the Azure integration page in Datadog, you can copy the keys provided there. Otherwise, you can find your API and App keys in the Access section of the Organization Settings.

    Note: If you’ve selected to monitor individual subscriptions rather than a management group, select the subscriptions to monitor from the Subscriptions to monitor dropdown.

  6. Select your Datadog site, as well as any other integration configuration options, such as host filters and whether to collect resources for Cloud Security Management.

  7. Click Review + create, then click Create.

  8. Once the deployment has completed, click Done in the Azure integration page in Datadog to refresh the list and review your newly added App Registration.

class SampleRegistry { public function put($key, $value) { \App\some_utility_function(‘some argument’); // 挿入されたアイテムの ID を返す return 456; }

  1. Active Directory でアプリ登録を作成し、正しい認証情報を Datadog に渡します。
  2. 監視するサブスクリプションに対する読み取りアクセス権をアプリケーションに付与します。

アプリ登録の作成

  1. Azure Active Directory で、App Registrations に移動し、New registration をクリックします。

  2. 以下の各項目を入力し、Create ボタンをクリックします。名前とサインオン URL は使用されませんが、セットアッププロセスで必要です。

    • 名前: Datadog Auth
    • サポート対象のアカウントの種類: この組織ディレクトリのアカウントのみ (Datadog)
    • リダイレクト URI:
Azure でアプリを作成

読み取りアクセス許可をアプリケーションに付与する

  1. 個々のサブスクリプションレベルでアクセスを割り当てるには、検索ボックスまたは左サイドバーから Subscriptions に移動してください。
サブスクリプションアイコン

管理グループレベルでアクセスを割り当てるには、Management Groups に移動して、監視したいサブスクリプションのセットを含む管理グループを選択します。 : 管理グループレベルでアクセスを割り当てることは、グループに追加された新しいサブスクリプションが、Datadog によって自動的に検出され、監視されることを意味します。

管理グループアイコン

テナント全体の監視を構成するには、Tenant Root Group にアクセス権を割り当てます。

  1. 監視するサブスクリプションをクリックします。

  2. サブスクリプションのメニューで Access control (IAM) を選択し、Add > Add role assignment を選択します。

    ロールの割り当ての追加
  3. Role には、Monitoring Reader を選択します。Select では、前の手順で作成したアプリケーションの名前を選択します。

  4. Save をクリックします。

  5. Repeat this process for any additional subscriptions you want to monitor with Datadog. Note: Users of Azure Lighthouse can add subscriptions from customer tenants.

Note: Diagnostics must be enabled for ARM deployed VMs to collect metrics, see Enable diagnostics.

インテグレーションを完了する

  1. Under App Registrations, select the App you created, copy the Application ID and Tenant ID, and paste the values in the Datadog Azure integration tile under Client ID and Tenant ID.

  2. 同じアプリで、Manage > Certificates and secrets と移動します。

  3. datadogClientSecret という新しい Client Secret を追加し、Expires に期間を選択して Add をクリックします。

    Azure のクライアントシークレット
  4. When the key value is shown, copy and paste the value in the Datadog Azure integration tile under Client Secret and click Install Integration or Update Configuration.

: Azure コンフィギュレーションの変更が Datadog で反映されるまで、最大で 20 分ほどかかります。

構成

To limit metric collection for Azure-based hosts, open the integration tile for Azure. Select the Configuration tab, then open App Registrations. Enter a list of tags in the text box under Metric Collection Filters.

この <KEY>:<VALUE> 形式のタグリストはカンマ区切りで、メトリクスを収集する際に使用されるフィルターを定義します。? (1 文字) や * (複数文字) などのワイルドカードも使用できます。

定義されたタグのいずれかに一致する VM だけが Datadog にインポートされます。それ以外は無視されます。タグの前に ! を追加することで、指定されたタグに一致する VM を除外することもできます。例:

datadog:monitored,env:production,!env:staging,instance-type:c1.*

インテグレーションステータスの監視

インテグレーションが構成されると、Datadog は Azure API への連続した一連のコールを実行し始め、Azure 環境から重要な監視データを収集します。これらのコールは、時々エラーを返します (例えば、提供された資格情報が期限切れの場合など)。これらのエラーは、Datadog が監視データを収集する能力を阻害またはブロックする可能性があります。

重大なエラーが発生すると、Azure インテグレーションは Datadog イベントエクスプローラーにイベントを生成し、5 分ごとに再パブリッシュします。これらのイベントが検出されたときにトリガーし、適切なチームに通知するイベントモニターを構成することができます。

Datadog は、始めるためのテンプレートとして使用できる推奨モニターを提供します。推奨モニターを使用するには、

  1. In Datadog, go to Monitors -> New Monitor and select the Recommended Monitors tab.
  2. [Azure] Integration Errors というタイトルの推奨モニターを選択します。
  3. 検索クエリまたはアラート条件に必要な修正を加えます。デフォルトでは、モニターは新しいエラーが検出されるたびにトリガーされ、過去 15 分間エラーが検出されなかったときに解決されます。
  4. 必要に応じて、通知メッセージと再通知メッセージを更新します。イベント自体には、イベントに関する適切な情報が含まれており、自動的に通知に含まれることに注意してください。これには、範囲、エラー応答、修復のための一般的な手順に関する詳細な情報が含まれます。
  5. Configure notifications through your preferred channels (email, Slack, PagerDuty, or others) to make sure your team is alerted about issues affecting Azure data collection.

メトリクスの収集

インテグレーションタイルのセットアップが完了すると、メトリクスがクローラーによって収集されます。他のメトリクスを収集する場合は、以下のように、Datadog Agent を VM にデプロイします。

Agent のインストール

Azure 拡張機能を使用して、Windows VM、Linux x64 VM、および Linux ARM ベースの VM に Datadog Agent をインストールすることができます。また、AKS クラスター拡張機能を使用して、AKS クラスターに Agent をデプロイすることもできます。

  1. Azure ポータルで、該当する VM を選択します。
  2. 左サイドバーから、Settings の下にある Extensions + applications を選択します。
  3. Click + Add.
  4. Datadog Agent 拡張機能を検索して選択します。
  5. Next をクリックします。
  6. Datadog API キーDatadog サイトを入力し、OK をクリックします。

オペレーティングシステムまたは CI/CD ツールに応じた Agent のインストール方法については、Datadog Agent のインストール手順を参照してください。

: Azure の拡張機能と併せて Datadog Agent をインストールする場合、ドメインコントローラーはご利用いただけません。

Datadog AKS クラスター拡張機能を使用すると、Azure AKS 内に Datadog Agent をネイティブにデプロイできるため、サードパーティの管理ツールの複雑さを回避できます。AKS クラスター拡張機能を使って Datadog Agent をインストールするには:

  1. Azure ポータルで AKS クラスターに移動します。
  2. AKS クラスターの左サイドバーから、Settings の下にある Extensions + applications を選択します。
  3. Datadog AKS Cluster Extension を検索して選択します。
  4. Create をクリックし、表示される指示に従って Datadog の資格情報Datadog のサイトを使用してください。

Sending logs

See the Azure Logging guide to set up log forwarding from your Azure environment to Datadog.

PREVIEWING: bartol/timeshift-docs