Microsoft Azure¶
Scope: workloads on Microsoft Azure, from a single subscription to an enterprise landing zone. Cloud-neutral rules live elsewhere: least privilege (SEC-1) and secrets management (SEC-2) in Security, resilience and monitoring in Operations and reliability, Terraform itself in Terraform, and pipelines that deploy to Azure in GitHub Actions. For the other clouds, see AWS and Google Cloud.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 10 Azure Well-Architected Framework: the baseline, used for every workload review. Its pillars each have a design review checklist:
- 7 Reliability
- 7 Security
- 7 Operational Excellence
- 7 Cost Optimization
- 7 Performance Efficiency
- 9 What is an Azure landing zone? (Cloud Adoption Framework): the baseline for the environment: platform and workload landing zones, design areas such as resource organization and governance, and implementation options, including infrastructure-as-code accelerators.
- 8 Using availability zones and regions (Well-Architected Framework): how to choose between zonal, zone-redundant and multi-region deployments. Read it with the reliability guides for Azure services, which describe each service's zone support and recovery options.
- 7 Microsoft cloud security benchmark: security controls for Azure with implementation guidance and Azure Policy mappings. Version 2 is in preview and supersedes version 1.
- 7 Azure Architecture Center: reference architectures, example workloads, architecture guides and technology decision guides.
- 7 Azure service guides (Well-Architected Framework): pillar-by-pillar recommendations for individual services, such as App Service, AKS and Azure SQL Database.
- 7 Bicep best practices: parameters, naming, resource definitions, child resources and outputs.
- 7 Azure Verified Modules: Microsoft-supported Bicep and Terraform modules that follow the Well-Architected Framework.
Key rules¶
Organization and governance¶
- 8
AZURE-1Deploy workloads into an Azure landing zone: put platform services such as management, connectivity and identity in their own subscriptions, and give each workload environment its own subscriptions. Subscriptions are boundaries for policy, access, billing and scale. A landing zone accelerator deploys the recommended structure as code. (CAF, What is an Azure landing zone?, CAF, Subscription considerations and recommendations) - 7
AZURE-2Agree on a naming convention and a set of required tags, such as application, environment and cost center, before you deploy, and enforce the tags with Azure Policy. Most resource names can't be changed after creation. Tags are stored as plain text, so never put sensitive values in them. (CAF, Define your naming convention, CAF, Define your tagging strategy, Policy definitions for tagging resources) - 7
AZURE-3Set guardrails with Azure Policy: prefer built-in policies and initiatives, assign them at the highest suitable scope, and roll out each new assignment in audit mode before you switch it to deny. (CAF, Azure governance design area, Safe deployment of Azure Policy assignments) - 6
AZURE-4Keep the management group hierarchy flat, ideally three or four levels, and group subscriptions by workload type, such as corp and online, not by environment or org chart. Keep policy assignments at the root management group to a minimum. (CAF, Management groups)
Identity and secrets¶
- 8
AZURE-5Authenticate workloads with managed identities, and pipelines and workloads outside Azure with workload identity federation, instead of client secrets, certificates or access keys. Where a service allows it, also turn off key-based access, such as Shared Key authorization for Storage. For GitHub Actions, seeGHA-5in GitHub Actions. (Managed identities for Azure resources, Microsoft Entra Workload ID, Workload identity federation, Prevent authorization with Shared Key) - 8
AZURE-7Assign Azure RBAC roles to groups rather than users, at the narrowest scope, keep at most three subscription owners, and give administrators just-in-time access with Privileged Identity Management. (Best practices for Azure RBAC) - 7
AZURE-6Use one Key Vault per application, environment and region, authorize access with Azure RBAC rather than legacy access policies, and turn on purge protection. (Secure your Azure Key Vault: identity and access management, data protection)
Networking¶
- 7
AZURE-8Reach PaaS data services, such as Storage, SQL Database and Key Vault, through private endpoints, and block public traffic with the service firewall or turn public network access off. A private endpoint alone doesn't block public access, and clients need DNS, usually private DNS zones, that resolves the service to the endpoint. This is how Azure appliesSEC-20. (Well-Architected Framework, Private endpoints, What is a private endpoint?)
Reliability¶
- 8
AZURE-9Deploy production workloads across availability zones in regions that have them, and prefer zone-redundant service configurations. Zone support differs between services, so check each service's reliability guide. (What are Azure availability zones?, Well-Architected Framework, Using availability zones and regions, Reliability guides for Azure services)
Delivery and operations¶
- 8
AZURE-10Define all Azure resources as code in Bicep or Terraform, deploy them from a pipeline, and build on Azure Verified Modules. Terraform is the better choice when you also manage other clouds or on-premises resources. (Well-Architected Framework, Infrastructure as code, Comparing Terraform and Bicep, Azure Verified Modules) - 7
AZURE-11In Bicep, mark secret parameters and outputs with@secure(), don't give secure parameters default values, and read secrets from Key Vault withgetSecret()or theexistingkeyword instead of passing them through outputs. Anyone with access to the deployment history can read outputs that aren't secure. (Bicep best practices: outputs, Use Key Vault to pass a secret during Bicep deployment, Linter rule: secure parameter default) - 7
AZURE-12Route resource logs to a central Log Analytics workspace with diagnostic settings, deployed at scale with Azure Policy, and start with a single workspace. Azure generates resource logs, but you can't query them until a diagnostic setting sends them to a workspace. (Monitor Azure resources: diagnostic settings, Enable diagnostic settings with built-in policies, Design a Log Analytics workspace architecture) - 7
AZURE-13Create a budget with actual and forecasted cost alerts for every subscription. Budgets only notify: they don't stop resources or spending. (Cost Management, Create and manage budgets, CAF, Azure governance design area) - 6
AZURE-14Assess each workload with the Azure Well-Architected Review, and act on Azure Advisor recommendations, which Advisor scores by pillar. (Azure Well-Architected Review, Well-Architected Framework pillars, Introduction to Azure Advisor)
How to enforce¶
Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.
- 7 Azure Policy, Microsoft cloud security benchmark initiative: Defender for Cloud assigns it by default and continuously reports resources that break it, for example Key Vaults without deletion protection or the RBAC permission model, apps without a managed identity, local authentication left on, and PaaS services with public network access. Other built-in initiatives audit zone resilience and deploy diagnostic settings, and the tagging policies deny resources without required tags. Partly checks
AZURE-2,AZURE-5,AZURE-6,AZURE-8,AZURE-9andAZURE-12. - 6 PSRule for Azure rules: tests Bicep and ARM templates in CI against rules aligned with the Well-Architected Framework, such as Azure.KeyVault.RBAC, Azure.KeyVault.PurgeProtect, Azure.KeyVault.Firewall, Azure.AppService.ManagedIdentity, Azure.Storage.LocalAuth, Azure.AppService.AvailabilityZone, Azure.Resource.UseTags and Azure.Deployment.OutputSecretValue. Partly checks
AZURE-2,AZURE-5,AZURE-6,AZURE-8,AZURE-9andAZURE-11. - 6 Bicep linter: built into the Bicep CLI and the VS Code extension.
secure-parameter-defaultflags defaults on secure parameters andoutputs-should-not-contain-secretsflags secrets in outputs. Both are warnings by default, so set them toerrorinbicepconfig.jsonto fail the build in CI. Partly checksAZURE-11. - 6 Checkov Terraform policies and Bicep policies: misconfiguration checks before deployment, including Key Vault purge protection (
CKV_AZURE_110), public network access (CKV_AZURE_189) and private endpoint (CKV2_AZURE_32), managed identity for App Service (CKV_AZURE_71), Shared Key authorization on Storage (CKV2_AZURE_40) and zone-redundant App Service plans (CKV_AZURE_225). Partly checksAZURE-5,AZURE-6,AZURE-8andAZURE-9.
Tutorials and further reading¶
- 6 Build great solutions with the Microsoft Azure Well-Architected Framework (Microsoft Learn): a free learning path with an introduction and one module per pillar.
- 6 Fundamentals of Bicep (Microsoft Learn): a free learning path on writing and deploying Bicep files.
- 5 Azure landing zone documentation: how to deploy and operate the platform landing zone with the infrastructure-as-code accelerator.
- 5 Mission-critical workloads (Well-Architected Framework): design guidance for workloads that need the highest reliability.