Windows 用 Azure Monitor Dependency 仮想マシン拡張機能

Azure Monitor for VMs のマップ機能では、Microsoft Dependency Agent からデータが取得されます。 Windows 用の Azure VM Dependency エージェント仮想マシン拡張機能を使うと、Azure 仮想マシンに Dependency エージェントがインストールされます。 このドキュメントでは、Windows 用 Azure VM Dependency Agent 仮想マシン拡張機能でサポートされているプラットフォーム、構成、デプロイ オプションについて詳しく説明します。

オペレーティング システム

Windows 用 Azure VM Dependency Agent 拡張機能は、次の表に示すサポートされているオペレーティング システムに対して実行できます。 次の表のすべてのオペレーティング システムは x64 と見なされます。 x86 はどのオペレーティング システムでもサポートされていません。

オペレーティング システム Azure VM Dependency Agent
Windows Server 2022
Windows Server 2022 Core
Windows Server 2019
Windows Server 2019 Core
Windows Server 2016
Windows Server 2016 Core
Windows Server 2012 R2
Windows Server 2012
Windows 11 クライアントおよび Pro 12
Windows 11 Enterprise
(マルチセッションを含む)
Windows 10 1803 (RS4) 以降 1
Windows 10 Enterprise
(マルチセッションを含む) および Pro
(サーバー シナリオのみ)
Windows 8 Enterprise および Pro
(サーバー シナリオのみ)
Windows 7 SP1
(サーバー シナリオのみ)
Azure Stack HCI
Windows IoT Enterprise

1 Azure Monitor エージェント クライアント インストーラーを使用。
2 Arm64 ベースのマシンもサポート対象。

拡張機能のスキーマ

次の JSON は、Azure Windows VM に対する Azure VM Dependency Agent 拡張機能のスキーマを示したものです。

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "vmName": {
      "type": "string",
      "metadata": {
        "description": "The name of existing Azure VM. Supported Windows Server versions:  2008 R2 and above (x64)."
      }
    }
  },
  "variables": {
    "vmExtensionsApiVersion": "2017-03-30"
  },
  "resources": [
    {
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "name": "[concat(parameters('vmName'),'/DAExtension')]",
      "apiVersion": "[variables('vmExtensionsApiVersion')]",
      "location": "[resourceGroup().location]",
      "dependsOn": [],
      "properties": {
          "publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
          "type": "DependencyAgentWindows",
          "typeHandlerVersion": "9.10",
          "autoUpgradeMinorVersion": true,
          "settings": {
                "enableAMA": "true"
		    }
      }
    }
  ],
    "outputs": {
    }
}

プロパティ値

名前 値/例
apiVersion 2015-01-01
publisher Microsoft.Azure.Monitoring.DependencyAgent
type DependencyAgentWindows
typeHandlerVersion 9.10
autoUpgradeMinorVersion true
設定 "enableAMA": "true"

重要

Azure Monitor エージェントを使っている場合は、必ずテンプレートに enableAMA を追加してください。それ以外の場合は、Dependency エージェントで、従来の Log Analytics エージェントへのデータの送信が試みられます。

テンプレートのデプロイ

Azure VM 拡張機能は、Azure Resource Manager テンプレートでデプロイできます。 前のセクションで詳しく説明した JSON スキーマを Azure Resource Manager テンプレートで使用すると、Azure Resource Manager テンプレートのデプロイ時に Azure VM Dependency Agent 拡張機能を実行できます。

仮想マシン拡張機能の JSON は、仮想マシン リソース内に入れ子にすることができます。 または、Resource Manager JSON テンプレートのルートまたは最上位に配置することができます。 JSON の配置は、リソースの名前と種類の値に影響します。 詳細については、子リソースの名前と種類の設定に関する記事を参照してください。

次の例では、Dependency Agent 拡張機能が仮想マシン リソース内で入れ子になっていることを前提としています。 拡張機能リソースを入れ子にすると、JSON は仮想マシンの "resources": [] オブジェクトに配置されます。

{
	"type": "extensions",
	"name": "DAExtension",
	"apiVersion": "[variables('apiVersion')]",
	"location": "[resourceGroup().location]",
	"dependsOn": [
		"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
	],
	"properties": {
      "publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
      "type": "DependencyAgentWindows",
      "typeHandlerVersion": "9.10",
      "autoUpgradeMinorVersion": true,
      "settings": {
            "enableAMA": "true"
    		    }
    }
}

拡張子 JSON をテンプレートのルートに配置すると、リソース名には親仮想マシンへの参照が含まれます。 種類には、入れ子にされた構成が反映されます。

{
	"type": "Microsoft.Compute/virtualMachines/extensions",
	"name": "<parentVmResource>/DAExtension",
	"apiVersion": "[variables('apiVersion')]",
	"location": "[resourceGroup().location]",
	"dependsOn": [
		"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
	],
	"properties": {
      "publisher": "Microsoft.Azure.Monitoring.DependencyAgent",
      "type": "DependencyAgentWindows",
      "typeHandlerVersion": "9.10",
      "autoUpgradeMinorVersion": true,
      "settings": {
            "enableAMA": "true"
    		    }
	}
}

PowerShell でのデプロイ

Set-AzVMExtension コマンドを使用して、Dependency Agent 仮想マシン拡張機能を既存の仮想マシンにデプロイすることができます。 このコマンドを実行する前に、パブリック構成とプライベート構成を PowerShell ハッシュ テーブルに格納しておく必要があります。


Set-AzVMExtension -ExtensionName "Microsoft.Azure.Monitoring.DependencyAgent" `
    -ResourceGroupName "myResourceGroup" `
    -VMName "myVM" `
    -Publisher "Microsoft.Azure.Monitoring.DependencyAgent" `
    -ExtensionType "DependencyAgentWindows" `
    -TypeHandlerVersion 9.10 `
    -Location WestUS

拡張機能の自動アップグレード

依存関係拡張機能のマイナー バージョンを自動的にアップグレードする新しい機能が、利用できるようになりました。

拡張機能の自動アップグレードを拡張機能に対して有効にするには、プロパティ enableAutomaticUpgradetrue に設定され、拡張機能テンプレートに追加されているようにする必要があります。 このプロパティは、すべての VM または VM スケール セットで個別に有効にする必要があります。 有効化のセクションで説明されているいずれかの方法を使用して、VM または VM スケール セットに対してこの機能を有効にします。

VM または VM スケール セットで拡張機能の自動アップグレードが有効になっていると、拡張機能の発行元がその拡張機能の新しいバージョンをリリースするたびに、拡張機能が自動的にアップグレードされます。 このアップグレードは、こちらで説明されているように、可用性優先の原則に従って安全に適用されます。

enableAutomaticUpgrade 属性の機能は、autoUpgradeMinorVersion の機能とは異なります。 拡張機能の発行元から新しいバージョンがリリースされる場合は、autoUpgradeMinorVersion 属性によるマイナー バージョンの自動更新は行われません。 autoUpgradeMinorVersion 属性は、デプロイ時に新しいマイナー バージョンが使用可能な場合に、それを拡張機能で使用する必要があるかどうかを示します。 ただし、デプロイされると、このプロパティが true に設定されていても、再デプロイされない限り、拡張機能でマイナー バージョンはアップグレードされません。

拡張機能のバージョンを最新の状態に保つために、拡張機能のデプロイで enableAutomaticUpgrade を使用することをお勧めします。

重要

テンプレートに enableAutomaticUpgrade を追加する場合は、必ず API バージョン 2019-12-01 以上で使用してください。

トラブルシューティングとサポート

トラブルシューティング

拡張機能のデプロイ状態に関するデータを取得するには、Azure portal または Azure PowerShell モジュールを使用します。 特定の VM での拡張機能のデプロイ状態を確認するには、Azure PowerShell モジュールを使用して次のコマンドを実行します。

Get-AzVMExtension -ResourceGroupName myResourceGroup -VMName myVM -Name myExtensionName

拡張機能の実行の出力は、次のディレクトリ内のファイルにログ記録されます。

C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.Monitoring.DependencyAgent\

サポート

この記事についてさらにヘルプが必要な場合は、いつでも Microsoft Q & A フォーラムと Stack Overflow フォーラムで Azure エキスパートに問い合わせることができます。 または、Azure サポート インシデントを送信できます。 その場合は、 Azure サポートのサイト に移動して、 [サポートの要求] をクリックします。 Azure サポートの使用方法の詳細については、「Microsoft Azure サポートに関する FAQ」を参照してください。