Azure Security Best Practices: A Checklist for 2026
Azure security best practices with az CLI commands: MFA through security defaults or Conditional Access, private storage, SQL firewall rules and Defender.
The most important Azure security best practices are to require MFA for every user through security defaults or Conditional Access, block anonymous and public network access to storage, tighten Azure SQL firewall rules, close RDP and SSH to the internet, and keep Owner access to a handful of people. Each item below includes the az CLI command to check it.
This checklist is written for growing companies on Azure that need to pass SOC 2 or ISO 27001 without a dedicated cloud security team. It comes from Strac, a Y Combinator-backed data security company trusted by enterprises, whose cloud posture checks run daily across Azure, AWS and Google Cloud.
Microsoft secures the platform; you secure your identities, configuration and data on it. Most real exposure in an Azure tenant comes from a short list of settings. This is how they look as findings in Strac, beside AWS and Google Cloud:


The checks below draw on the Microsoft cloud security benchmark and the CIS Microsoft Azure Foundations Benchmark, trimmed to what auditors and attackers care about most.
Identity is the front door to Azure, and a password alone does not hold it. Microsoft Entra ID gives you two ways to require multifactor authentication:

Security defaults are free and have been on by default for tenants created since October 2019, but many older tenants turned them off and never replaced them. If you have Entra ID P1, use Conditional Access instead: require MFA for all users, block legacy authentication, and exclude two monitored break-glass accounts. Microsoft is also enforcing MFA for Azure portal sign-ins and, from October 2025, for Azure CLI, PowerShell and infrastructure-as-code create, update and delete operations. Workload identities are excluded, which is one more reason to move automation to managed identities.
Since late 2023, new storage accounts disallow anonymous blob access by default, but older accounts often still allow it, and the public network endpoint stays on unless you change it. Check every account in a subscription:
az storage account list \
--query "[].{name:name, anonymousBlob:allowBlobPublicAccess, network:publicNetworkAccess, sharedKey:allowSharedKeyAccess, minTls:minimumTlsVersion}" \
-o tableThen lock down the ones that should not be public:
az storage account update -n ACCOUNT -g RG --allow-blob-public-access false
az storage account update -n ACCOUNT -g RG --min-tls-version TLS1_2
az storage account update -n ACCOUNT -g RG --public-network-access Disabled # once private endpoints are in placeTurning off shared key access forces apps to authenticate with Entra ID instead of account keys, which removes a long-lived credential that otherwise ends up in config files. The same pattern on AWS is covered in our guide to finding and fixing public S3 buckets.
The checkbox "Allow Azure services and resources to access this server" creates a firewall rule from 0.0.0.0 to 0.0.0.0, named AllowAllWindowsAzureIps. It admits connections from any Azure IP address, including other customers' resources, not just yours. Find it and any wide ranges:
az sql server firewall-rule list -g RG -s SERVER -o table
# remove the allow-all-Azure rule
az sql server firewall-rule delete -g RG -s SERVER -n AllowAllWindowsAzureIps
# turn off SQL logins so access follows Entra ID identities
az sql server ad-only-auth enable -g RG -n SERVER
Private endpoints are the cleanest answer for both storage and SQL: the service gets an address inside your virtual network and the public endpoint can be turned off. Enable auditing on SQL servers and keep automated backups with geo-redundancy where your recovery plan needs it.
Checking every subscription by hand before each audit?
A network security group rule that allows port 3389 or 22 from Internet, * or 0.0.0.0/0 puts a login prompt in front of the whole internet. Find them:
az network nsg list --query "[].{nsg:name, rg:resourceGroup}" -o tsv | while read nsg rg; do
az network nsg rule list -g "$rg" --nsg-name "$nsg" \
--query "[?access=='Allow' && direction=='Inbound' && (sourceAddressPrefix=='*' || sourceAddressPrefix=='Internet' || sourceAddressPrefix=='0.0.0.0/0')].{nsg:'$nsg', rule:name, port:destinationPortRange}" -o tsv
doneReplace them with Azure Bastion for admin access, or just-in-time VM access from Defender for Servers, which opens a port for a named user for a limited time.
Owner and User Access Administrator at subscription scope can do anything, including grant themselves more. List who holds them, cut the list to a few named people, and use Privileged Identity Management for just-in-time elevation if you have Entra ID P2:
az role assignment list --all \
--query "[?roleDefinitionName=='Owner' || roleDefinitionName=='User Access Administrator'].{who:principalName, role:roleDefinitionName, scope:scope}" \
-o tablePrefer managed identities over service principals with client secrets for anything running in Azure; a secret in an app setting is a hardcoded secret, as our guide to hardcoded secrets explains. Store whatever secrets remain in Key Vault with purge protection on.
Microsoft Defender for Cloud gives free Foundational CSPM recommendations and a Secure Score, with paid plans for attack paths, compliance dashboards and workload protection. Microsoft notes that subscriptions created from October 27, 2026 start with Foundational CSPM off, so check it on each one. The Azure activity log, which records control-plane changes, is kept for 90 days; send it to a Log Analytics workspace or storage account with longer retention so you can answer questions about the whole audit period:
az monitor diagnostic-settings subscription create \
--name activity-to-law --location eastus \
--workspace /subscriptions/SUB_ID/resourceGroups/RG/providers/Microsoft.OperationalInsights/workspaces/LAW \
--logs '[{"category":"Administrative","enabled":true},{"category":"Security","enabled":true},{"category":"Policy","enabled":true}]'Key Vault holds the secrets everything else depends on, so check its own settings. Soft delete is now always on; also turn on purge protection so a deleted vault or key cannot be destroyed before the retention period ends, use Azure RBAC rather than legacy access policies, and limit network access:
az keyvault list --query "[].name" -o tsv | while read kv; do
az keyvault show -n "$kv" \
--query "{vault:name, purgeProtection:properties.enablePurgeProtection, rbac:properties.enableRbacAuthorization, network:properties.publicNetworkAccess}" -o tsv
done
az keyvault update -n VAULT -g RG --enable-purge-protection trueMicrosoft recommends two emergency access accounts: cloud-only, excluded from normal Conditional Access policies, protected with phishing-resistant MFA such as a FIDO2 key, and alerted on every sign-in. They exist so a broken policy or a federation outage cannot lock every admin out of the tenant.
Azure's model trips up teams who learned cloud on AWS. There are two separate permission systems: Microsoft Entra roles, such as Global Administrator, govern the directory, while Azure RBAC roles, such as Owner, govern subscriptions and resources. They are reviewed in different places, so audits often check one and miss the other. A Global Administrator can also elevate their own access to manage every subscription in the tenant, so the Global Administrator list is effectively an Owner list too. Subscriptions are closer to AWS accounts than resource groups are, and management groups play the role of AWS organizational units for policy inheritance. Keep Global Administrators to a small number of named people, review both role systems in every access review, and check the root-scope role assignments that elevation creates.
| Area | Check | Why an auditor cares |
|---|---|---|
| Identity | MFA for all users via security defaults or Conditional Access | CC6.1: strong authentication |
| Identity | Legacy authentication blocked | CC6.1: no MFA bypass |
| Identity | Few Owners; PIM for elevation | CC6.3: least privilege |
| Storage | No anonymous blob access; TLS 1.2 minimum | CC6.1, CC6.7: data protected |
| Storage | Public network access limited; private endpoints | CC6.6: boundary protection |
| Databases | No AllowAllWindowsAzureIps; Entra-only auth; auditing on | CC6.1, CC7.2 |
| Network | No RDP/SSH from Internet; Bastion or JIT access | CC6.6: boundary protection |
| Secrets | Managed identities; Key Vault with purge protection | CC6.1: credentials controlled |
| Detection | Defender for Cloud on every subscription | CC7.2: anomaly detection |
| Logging | Activity log exported with long retention | CC7.2: monitoring |
Many Azure customers run Microsoft 365 on the same Entra tenant, so identity findings often overlap; our guide to Microsoft 365 SOC 2 compliance covers that side of the audit.
Fixing a setting once does not stop the next subscription from repeating the mistake. Azure Policy can audit or deny configurations at management group scope, so new subscriptions inherit the rules. Built-in policies cover most of this checklist, such as denying storage accounts that allow anonymous blob access or requiring private endpoints for SQL. Start in audit mode, fix what it finds, then switch the important ones to deny. Deny policies block a bad deployment at the moment someone tries it, which is far cheaper than finding it in next quarter's audit.
Hardening goes faster in a fixed order than as one long list. This sequence removes the most risk first:
AllowAllWindowsAzureIps and wide SQL firewall ranges, and close RDP and SSH from the internet.Write down each change with the date and the reason; that record is the evidence an auditor asks for when testing access and change management.
Strac connects to Azure through an app registration with the Reader role, granted with admin consent, and never changes your settings. It runs 34 Azure checks every day alongside 95 for AWS and 21 for Google Cloud. Each finding names the exact resource, explains why it matters and gives the fix steps. Fixed findings close on the next run, intentional exceptions go into a waiver register with a reason and a review date, and every daily result is saved as SOC 2, ISO 27001 and HIPAA evidence:

Native tools such as Defender for Cloud are worth running too; the difference is that Strac covers all three clouds in one list, ties each finding to the control it proves, and sits in the same platform as secret scanning, dependency scanning and the AI pen test. Our CSPM tools comparison covers the options, and our GCP security best practices and AWS security checklist follow the same format. For the category itself, see what CSPM is. See Strac's cloud posture checks.
Run every Azure check daily, with the fix and the audit evidence attached.
Require MFA for every user through security defaults or Conditional Access, block anonymous access to storage accounts, remove the Allow Azure services rule and broad IP ranges from Azure SQL firewalls, close RDP and SSH to the internet, keep Owner roles to a few people, and turn on Defender for Cloud and long-term activity log retention.
Security defaults are free and require MFA for everyone with sensible settings, which is right for most small tenants. Conditional Access needs Microsoft Entra ID P1 and lets you write your own policies, such as exceptions for break-glass accounts or stricter rules for admins. You use one or the other, not both.
Increasingly, yes. Microsoft began enforcing MFA for Azure portal sign-ins in 2024 and extended it to Azure CLI, PowerShell, infrastructure-as-code tools and REST API create, update and delete operations from October 2025. Workload identities such as managed identities and service principals are not affected.
No, not for new ones. Since late 2023, new storage accounts disallow anonymous blob access by default. Older accounts may still allow it, and a public network endpoint is still on by default, so check both settings on every account.
Its Foundational CSPM tier is free and provides recommendations and Secure Score. The paid Defender CSPM plan and workload protection plans add attack paths, regulatory compliance dashboards and threat protection. Microsoft notes that subscriptions created from October 27, 2026 start with Foundational CSPM off, so check it is enabled.
.avif)
.avif)
.avif)
.avif)
.avif)


.gif)

