last sync: 2021-Jul-08 14:19:52 UTC

Azure Policy Initiative

Configure Azure Monitor Agent to Linux virtual machines and associate to Data Collection Rule

NameConfigure Azure Monitor Agent to Linux virtual machines and associate to Data Collection Rule
Azure Portal
Id118f04da-0375-44d1-84e3-0fd9e1849403
Version1.0.0
details on versioning
CategoryMonitoring
Microsoft docs
DescriptionDeploy Azure Monitor Agent for Linux virtual machines if the virtual machine image (OS) and location are in the list defined and the agent is not installed. Then, deploy Association to link virtual machine to specified Data Collection Rule. The list of OS images is updated over time as support is increased.
TypeBuiltIn
DeprecatedFalse
PreviewFalse
History
Date/Time (UTC ymd) (i) Changes
2021-05-26 13:43:18 add Initiative 118f04da-0375-44d1-84e3-0fd9e1849403
Policy count Total Policies: 2
Builtin Policies: 2
Static Policies: 0
Policy used
Policy DisplayName Policy Id Category Effect State
Configure Association to link Linux virtual machines to Data Collection Rule 2ea82cdd-f2e8-4500-af75-67a2e084ca74 Monitoring Default: DeployIfNotExists
Allowed: (DeployIfNotExists, Disabled)
GA
Configure Linux virtual machines with Azure Monitor Agent a4034bc6-ae50-406d-bf76-50f4ee5a7811 Monitoring Default: DeployIfNotExists
Allowed: (DeployIfNotExists, Disabled)
GA
JSON
{
  "properties": {
    "displayName": "Configure Azure Monitor Agent to Linux virtual machines and associate to Data Collection Rule",
    "policyType": "BuiltIn",
    "description": "Deploy Azure Monitor Agent for Linux virtual machines if the virtual machine image (OS) and location are in the list defined and the agent is not installed.  Then, deploy Association to link virtual machine to specified Data Collection Rule. The list of OS images is updated over time as support is increased.",
    "metadata": {
      "version": "1.0.0",
      "category": "Monitoring"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy."
        },
        "allowedValues": [
          "DeployIfNotExists",
          "Disabled"
        ],
        "defaultValue": "DeployIfNotExists"
      },
      "listOfLinuxImageIdToInclude": {
        "type": "Array",
        "metadata": {
          "displayName": "Optional: List of virtual machine images that have supported Linux OS to add to scope",
          "description": "Example value: '/subscriptions//resourceGroups/YourResourceGroup/providers/Microsoft.Compute/images/ContosoStdImage'"
        },
        "defaultValue": [
          
        ]
      },
      "DcrResourceId": {
        "type": "String",
        "metadata": {
          "displayName": "Data Collection Rule resource Id",
          "description": "Resource Id of the Data Collection Rule that the virtual machines in scope should point to."
        }
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionReferenceId": "deployAzureMonitoringAgentLinux",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a4034bc6-ae50-406d-bf76-50f4ee5a7811",
        "parameters": {
          "effect": {
          "value": "[parameters('effect')]"
          },
          "listOfLinuxImageIdToInclude": {
          "value": "[parameters('listOfLinuxImageIdToInclude')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "associateDataCollectionRuleLinux",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2ea82cdd-f2e8-4500-af75-67a2e084ca74",
        "parameters": {
          "effect": {
          "value": "[parameters('effect')]"
          },
          "listOfLinuxImageIdToInclude": {
          "value": "[parameters('listOfLinuxImageIdToInclude')]"
          },
          "DcrResourceId": {
          "value": "[parameters('DcrResourceId')]"
          }
        }
      }
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/118f04da-0375-44d1-84e3-0fd9e1849403",
  "type": "Microsoft.Authorization/policySetDefinitions",
  "name": "118f04da-0375-44d1-84e3-0fd9e1849403"
}