Proximity Placement Group should have associated VMs
Low
Azure
General
proximityplacementgroups-proximity-placement-group
Applies to
Microsoft.Compute/proximityPlacementGroups
What CGPulse checks
A resource passes this rule when virtualMachinesCount must be greater than 0. Anything else is reported as a finding with the evaluated property value attached as evidence.
How to fix it
Associate VMs with the proximity placement group or remove unused groups to reduce clutter. In Azure Portal: Proximity Placement Group > Virtual Machines. See: https://learn.microsoft.com/en-us/azure/virtual-machines/co-location
CLI
az ppg show --ids "{id}" --query "virtualMachines"Bicep
// Associate a VM with a proximity placement group at creation:
resource vm 'Microsoft.Compute/virtualMachines@2024-03-01' = {{
name: 'vm-example'
location: location
properties: {{
proximityPlacementGroup: {{
id: '<ppg-resource-id>'
}}
hardwareProfile: {{ vmSize: 'Standard_D2s_v3' }}
}}
}}Terraform
# Associate a VM with a proximity placement group:
resource "azurerm_linux_virtual_machine" "{name}" {
name = "vm-example"
resource_group_name = "{rg}"
location = var.location
size = "Standard_D2s_v3"
proximity_placement_group_id = "<ppg-id>"
admin_username = "adminuser"
network_interface_ids = ["<nic-id>"]
os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}
source_image_reference {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-jammy"
sku = "22_04-lts"
version = "latest"
}
}
Compliance frameworks
Is your environment compliant with this rule?
CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.
Related Azure rules
- Action Group should be enabled
- Activity Log Alert should be enabled
- AKS cluster logs should be sent to Log Analytics
- AKS cluster must enable RBAC
- AKS cluster must enable RBAC
- AKS cluster should be a private cluster
- AKS cluster should disable local accounts
- AKS cluster should enable Azure RBAC for Kubernetes