last sync: 2020-Dec-03 15:30:53 UTC

Azure Policy Initiative

Enable Azure Monitor for VMs

NameEnable Azure Monitor for VMs
Azure Portal
Id55f3eceb-5573-4f18-9695-226972c6d74a
Version2.0.0
details on versioning
CategoryMonitoring
Microsoft docs
DescriptionEnable Azure Monitor for the virtual machines (VMs) in the specified scope (management group, subscription or resource group). Takes Log Analytics workspace as parameter.
TypeBuiltIn
DeprecatedFalse
PreviewFalse
History
Date/Time (UTC ymd) (i) Changes
2020-05-29 15:39:26 add Policy [Preview]: Deploy Log Analytics agent to Linux Azure Arc machines (9d2b61b4-1d14-4a63-be30-d4498e7ad2cf)
add Policy [Preview]: Deploy Dependency agent to hybrid Linux Azure Arc machines (deacecc0-9f84-44d2-bb82-46f32d766d43)
2020-05-21 16:06:36 add Policy [Preview]: Deploy Log Analytics agent to Windows Azure Arc machines (69af7d4a-7b18-4044-93a9-2651498ef203)
2020-05-14 05:31:20 add Policy [Preview]: Deploy Dependency agent to Windows Azure Arc machines (91cb9edd-cd92-4d2f-b2f2-bdd8d065a3d4)
2020-04-22 04:43:14 Name change: '[Preview]: Enable Azure Monitor for VMs' to 'Enable Azure Monitor for VMs'
Policy count Total Policies: 10
Builtin Policies: 10
Static Policies: 0
Policy used
Policy DisplayName Policy Id Category Effect State
[Preview]: Audit Log Analytics Agent Deployment - VM Image (OS) unlisted 32133ab0-ee4b-4b44-98d6-042180979d50 Monitoring Fixed: auditIfNotExists Preview
[Preview]: Deploy Dependency agent to hybrid Linux Azure Arc machines deacecc0-9f84-44d2-bb82-46f32d766d43 Monitoring Fixed: deployIfNotExists Preview
[Preview]: Deploy Dependency agent to Windows Azure Arc machines 91cb9edd-cd92-4d2f-b2f2-bdd8d065a3d4 Monitoring Fixed: deployIfNotExists Preview
[Preview]: Deploy Log Analytics agent to Linux Azure Arc machines 9d2b61b4-1d14-4a63-be30-d4498e7ad2cf Monitoring Fixed: deployIfNotExists Preview
[Preview]: Deploy Log Analytics agent to Windows Azure Arc machines 69af7d4a-7b18-4044-93a9-2651498ef203 Monitoring Fixed: deployIfNotExists Preview
Audit Dependency agent deployment - VM Image (OS) unlisted 11ac78e3-31bc-4f0c-8434-37ab963cea07 Monitoring Fixed: auditIfNotExists GA
Deploy Dependency agent for Linux virtual machines 4da21710-ce6f-4e06-8cdb-5cc4c93ffbee Monitoring Fixed: deployIfNotExists GA
Deploy Dependency agent for Windows virtual machines 1c210e94-a481-4beb-95fa-1571b434fb04 Monitoring Fixed: deployIfNotExists GA
Deploy Log Analytics agent for Linux VMs 053d3325-282c-4e5c-b944-24faffd30d77 Monitoring Fixed: deployIfNotExists GA
Deploy Log Analytics agent for Windows VMs 0868462e-646c-4fe3-9ced-a733534b6a2c Monitoring Fixed: deployIfNotExists GA
Json
{
  "properties": {
    "displayName": "Enable Azure Monitor for VMs",
    "policyType": "BuiltIn",
    "description": "Enable Azure Monitor for the virtual machines (VMs) in the specified scope (management group, subscription or resource group). Takes Log Analytics workspace as parameter.",
    "metadata": {
      "version": "2.0.0",
      "category": "Monitoring"
    },
    "parameters": {
      "logAnalytics_1": {
        "type": "String",
        "metadata": {
          "displayName": "Log Analytics workspace",
          "description": "Select Log Analytics workspace from dropdown list. If this workspace is outside of the scope of the assignment you must manually grant 'Log Analytics Contributor' permissions (or similar) to the policy assignment's principal ID.",
          "strongType": "omsWorkspace"
        }
      },
      "listOfImageIdToInclude_windows": {
        "type": "Array",
        "metadata": {
          "displayName": "Optional: List of VM images that have supported Windows OS to add to scope",
          "description": "Example value: '/subscriptions//resourceGroups/YourResourceGroup/providers/Microsoft.Compute/images/ContosoStdImage'"
        },
        "defaultValue": [
          
        ]
      },
      "listOfImageIdToInclude_linux": {
        "type": "Array",
        "metadata": {
          "displayName": "Optional: List of VM images that have supported Linux OS to add to scope",
          "description": "Example value: '/subscriptions//resourceGroups/YourResourceGroup/providers/Microsoft.Compute/images/ContosoStdImage'"
        },
        "defaultValue": [
          
        ]
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionReferenceId": "LogAnalyticsExtension_Windows_HybridVM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/69af7d4a-7b18-4044-93a9-2651498ef203",
        "parameters": {
          "logAnalytics": {
          "value": "[parameters('logAnalytics_1')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "LogAnalyticsExtension_Windows_VM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0868462e-646c-4fe3-9ced-a733534b6a2c",
        "parameters": {
          "logAnalytics": {
          "value": "[parameters('logAnalytics_1')]"
          },
          "listOfImageIdToInclude": {
          "value": "[parameters('listOfImageIdToInclude_windows')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "LogAnalyticsExtension_Linux_HybridVM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9d2b61b4-1d14-4a63-be30-d4498e7ad2cf",
        "parameters": {
          "logAnalytics": {
          "value": "[parameters('logAnalytics_1')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "LogAnalyticsExtension_Linux_VM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/053d3325-282c-4e5c-b944-24faffd30d77",
        "parameters": {
          "logAnalytics": {
          "value": "[parameters('logAnalytics_1')]"
          },
          "listOfImageIdToInclude": {
          "value": "[parameters('listOfImageIdToInclude_linux')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "DependencyAgentExtension_Windows_HybridVM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/91cb9edd-cd92-4d2f-b2f2-bdd8d065a3d4"
      },
      {
        "policyDefinitionReferenceId": "DependencyAgentExtension_Windows_VM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1c210e94-a481-4beb-95fa-1571b434fb04",
        "parameters": {
          "listOfImageIdToInclude": {
          "value": "[parameters('listOfImageIdToInclude_windows')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "DependencyAgentExtension_Linux_HybridVM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/deacecc0-9f84-44d2-bb82-46f32d766d43"
      },
      {
        "policyDefinitionReferenceId": "DependencyAgentExtension_Linux_VM_Deploy",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/4da21710-ce6f-4e06-8cdb-5cc4c93ffbee",
        "parameters": {
          "listOfImageIdToInclude": {
          "value": "[parameters('listOfImageIdToInclude_linux')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "LogAnalytics_OSImage_Audit",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/32133ab0-ee4b-4b44-98d6-042180979d50",
        "parameters": {
          "listOfImageIdToInclude_windows": {
          "value": "[parameters('listOfImageIdToInclude_windows')]"
          },
          "listOfImageIdToInclude_linux": {
          "value": "[parameters('listOfImageIdToInclude_linux')]"
          }
        }
      },
      {
        "policyDefinitionReferenceId": "DependencyAgent_OSImage_Audit",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/11ac78e3-31bc-4f0c-8434-37ab963cea07",
        "parameters": {
          "listOfImageIdToInclude_windows": {
          "value": "[parameters('listOfImageIdToInclude_windows')]"
          },
          "listOfImageIdToInclude_linux": {
          "value": "[parameters('listOfImageIdToInclude_linux')]"
          }
        }
      }
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/55f3eceb-5573-4f18-9695-226972c6d74a",
  "type": "Microsoft.Authorization/policySetDefinitions",
  "name": "55f3eceb-5573-4f18-9695-226972c6d74a"
}