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:
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 つ実行するだけで、ユーザーを作成し、すべての管理グループ/サブスクリプションにロールを割り当てることができます
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 ポータルを使用して統合する
In the Azure integration tile, select Configuration > New App Registration > Using Azure Portal.
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.
Click Open Template.
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.
Next をクリックします。
Select the Create new option in Service principal type.
Click the Change selection link in Service principal.
A form to create a new app registration is displayed:
Enter a name for the app registration, select the supported account types, and click Register.
A page opens to create a client secret. Click + New client secret to add a client secret.
Copy the value of the client secret, and click the close (X) button in the top-right corner of the screen.
Paste the value of the client secret in the corresponding field on the template, and click Next.
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.
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.
Click Review + create, then click Create.
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;
}
Active Directory でアプリ登録を作成し、正しい認証情報を Datadog に渡します。
管理グループレベルでアクセスを割り当てるには、Management Groups に移動して、監視したいサブスクリプションのセットを含む管理グループを選択します。
注: 管理グループレベルでアクセスを割り当てることは、グループに追加された新しいサブスクリプションが、Datadog によって自動的に検出され、監視されることを意味します。
テナント全体の監視を構成するには、Tenant Root Group にアクセス権を割り当てます。
監視するサブスクリプションをクリックします。
サブスクリプションのメニューで Access control (IAM) を選択し、Add > Add role assignment を選択します。
Role には、Monitoring Reader を選択します。Select では、前の手順で作成したアプリケーションの名前を選択します。
Save をクリックします。
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.
インテグレーションを完了する
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.
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.
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.
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 をデプロイすることもできます。