Azure Policy for governance
📖 Scenario: You are working as a cloud administrator for a company that wants to enforce rules on their Azure resources to keep them secure and compliant. You will create an Azure Policy that restricts the creation of virtual machines to only specific allowed sizes.
🎯 Goal: Create an Azure Policy definition that restricts virtual machine sizes to a specific list, assign this policy to a resource group, and verify the policy enforcement.
📋 What You'll Learn
Create an Azure Policy definition named
allowedVMsizes that restricts VM sizes to Standard_DS1_v2 and Standard_DS2_v2Create a policy assignment named
restrictVMsizesAssignment targeting the resource group TestResourceGroupUse the policy effect
Deny to prevent disallowed VM sizesUse JSON format for the policy definition and assignment
💡 Why This Matters
🌍 Real World
Azure Policy helps organizations enforce rules and compliance automatically on their cloud resources, preventing misconfigurations and security risks.
💼 Career
Cloud administrators and governance specialists use Azure Policy to maintain control over resource configurations and ensure compliance with company standards.
Progress0 / 4 steps