Gallery › Monitoring › Azure built-in policies
Enable Azure Monitor for Hybrid VMs with AMA
Converted Initiative Version 1.1.0
Enable Azure Monitor for the hybrid virtual machines with AMA.
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONAzureMonitor_HybridVM_AMA_new.json · 95 lines
{
"properties": {
"displayName": "Enable Azure Monitor for Hybrid VMs with AMA",
"policyType": "BuiltIn",
"description": "Enable Azure Monitor for the hybrid virtual machines with AMA.",
"metadata": {
"version": "1.1.0",
"category": "Monitoring"
},
"version": "1.1.0",
"parameters": {
"enableProcessesAndDependencies": {
"type": "Boolean",
"metadata": {
"displayName": "Enable Processes and Dependencies",
"description": "Deprecated. This parameter is no longer used due to the planned retirement of the Dependency Agent on June 30, 2028. There is no replacement for the Dependency Agent. For more information, see https://aka.ms/dependencyagentretirement.",
"deprecated": true
},
"allowedValues": [
true,
false
],
"defaultValue": false
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect for all constituent policies",
"description": "Enable or disable the execution of each of the constituent policies in the initiative."
},
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"defaultValue": "DeployIfNotExists"
},
"dcrResourceId": {
"type": "string",
"metadata": {
"displayName": "VMI Data Collection Rule Resource Id",
"description": "VMI Data Collection Rule Resource Id. Please refer to this link for newer experience migration: https://aka.ms/vminsights-dcrOnboarding",
"portalReview": "true"
}
}
},
"policyDefinitions": [
{
"policyDefinitionReferenceId": "AzureMonitorAgent_Windows_HybridVM_Deploy",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/94f686d6-9a24-4e19-91f1-de937dc171a4",
"definitionVersion": "2.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect')]"
}
}
},
{
"policyDefinitionReferenceId": "AzureMonitorAgent_Linux_HybridVM_Deploy",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/845857af-0333-4c5d-bbbc-6076697da122",
"definitionVersion": "2.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect')]"
}
}
},
{
"policyDefinitionReferenceId": "DataCollectionRuleAssociation_Linux",
"definitionVersion": "6.*.*",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2ea82cdd-f2e8-4500-af75-67a2e084ca74",
"parameters": {
"dcrResourceId": {
"value": "[parameters('dcrResourceId')]"
}
}
},
{
"policyDefinitionReferenceId": "DataCollectionRuleAssociation_Windows",
"definitionVersion": "4.*.*",
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/eab1f514-22e3-42e3-9a1f-e1dc9199355c",
"parameters": {
"dcrResourceId": {
"value": "[parameters('dcrResourceId')]"
}
}
}
],
"versions": [
"1.1.0",
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policySetDefinitions/2b00397d-c309-49c4-aa5a-f0b2c5bc6321",
"name": "2b00397d-c309-49c4-aa5a-f0b2c5bc6321"
}Bylaw2b00397d-c309-49c4-aa5a-f0b2c5bc6321.bylaw.ps1 · 68 lines
# Converted from AzureMonitor_HybridVM_AMA_new.json by ConvertTo-Bylaw.
Initiative '2b00397d-c309-49c4-aa5a-f0b2c5bc6321' {
Properties @{
DisplayName = 'Enable Azure Monitor for Hybrid VMs with AMA'
Description = 'Enable Azure Monitor for the hybrid virtual machines with AMA.'
Version = '1.1.0'
Category = 'Monitoring'
PolicyVersion = '1.1.0'
}
Parameter EnableProcessesAndDependencies @{
Type = 'Boolean'
AllowedValues = @($true, $false)
Default = $false
DisplayName = 'Enable Processes and Dependencies'
Description = 'Deprecated. This parameter is no longer used due to the planned retirement of the Dependency Agent on June 30, 2028. There is no replacement for the Dependency Agent. For more information, see https://aka.ms/dependencyagentretirement.'
Metadata = [ordered]@{ deprecated = $true }
}
Parameter Effect @{
AllowedValues = @('DeployIfNotExists', 'Disabled')
Default = 'DeployIfNotExists'
DisplayName = 'Effect for all constituent policies'
Description = 'Enable or disable the execution of each of the constituent policies in the initiative.'
}
Parameter DcrResourceId @{
Type = 'string'
DisplayName = 'VMI Data Collection Rule Resource Id'
Description = 'VMI Data Collection Rule Resource Id. Please refer to this link for newer experience migration: https://aka.ms/vminsights-dcrOnboarding'
Metadata = [ordered]@{ portalReview = 'true' }
}
PolicyDefinition @{
Id = '94f686d6-9a24-4e19-91f1-de937dc171a4'
ReferenceId = 'AzureMonitorAgent_Windows_HybridVM_Deploy'
Version = '2.*.*'
Parameters = @{
effect = (Param Effect)
}
}
PolicyDefinition @{
Id = '845857af-0333-4c5d-bbbc-6076697da122'
ReferenceId = 'AzureMonitorAgent_Linux_HybridVM_Deploy'
Version = '2.*.*'
Parameters = @{
effect = (Param Effect)
}
}
PolicyDefinition @{
Id = '2ea82cdd-f2e8-4500-af75-67a2e084ca74'
ReferenceId = 'DataCollectionRuleAssociation_Linux'
Version = '6.*.*'
Parameters = @{
dcrResourceId = (Param DcrResourceId)
}
}
PolicyDefinition @{
Id = 'eab1f514-22e3-42e3-9a1f-e1dc9199355c'
ReferenceId = 'DataCollectionRuleAssociation_Windows'
Version = '4.*.*'
Parameters = @{
dcrResourceId = (Param DcrResourceId)
}
}
}Members (4)
- Configure Windows Arc-enabled machines to run Azure Monitor Agent
- Configure Linux Arc-enabled machines to run Azure Monitor Agent
- Configure Linux Machines to be associated with a Data Collection Rule or a Data Collection Endpoint
- Configure Windows Machines to be associated with a Data Collection Rule or a Data Collection Endpoint
Source: built-in-policies/policySetDefinitions/Monitoring/AzureMonitor_HybridVM_AMA_new.json in Azure/azure-policy, under the MIT licence.
Bylaw