# Storage accounts should prevent shared key access

Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.

Storage accounts should prevent shared key access is an Azure guardrail written in Azure Policy. Denies storage accounts that allow Shared Key authorization, so requests must use Microsoft Entra ID. What it breaks: existing storage accounts that allow Shared Key are marked non-compliant but not changed.

```text
Built-in policy definition: Storage accounts should prevent shared key access
Definition ID: 8c6a50c6-9ffd-4ae7-986f-5fa6111f9a54
Category: Storage
Supported effects: Audit, Deny, Disabled
policyRule (copied from the repository file):
{
    "if": {
      "allOf": [
        {
          "field": "type",
          "equals": "Microsoft.Storage/storageAccounts"
        },
        {
          "anyOf": [
            {
              "value": "[contains(parameters('excludedManagedByResourceProviders'), 'Azure Red Hat OpenShift')]",
              "equals": false
            },
            {
              "value": "[resourcegroup().managedBy]",
              "notContains": "/providers/Microsoft.RedHatOpenShift/"
            }
          ]
        },
        {
          "anyOf": [
            {
              "value": "[contains(parameters('excludedManagedByResourceProviders'), 'Azure Databricks')]",
              "equals": false
            },
            {
              "value": "[resourcegroup().managedBy]",
              "notContains": "/providers/Microsoft.Databricks/"
            }
          ]
        },
        {
          "anyOf": [
            {
              "value": "[contains(parameters('excludedManagedByResourceProviders'), 'Microsoft Purview')]",
              "equals": false
            },
            {
              "value": "[resourcegroup().managedBy]",
              "notContains": "/providers/Microsoft.Purview/"
            }
          ]
        },
        {
          "anyOf": [
            {
              "value": "[contains(parameters('excludedManagedByResourceProviders'), 'All managed resource groups')]",
              "equals": false
            },
            {
              "value": "[empty(resourcegroup().managedBy)]",
              "equals": true
            }
          ]
        },
        {
          "anyOf": [
            {
              "anyOf": [
                {
                  "field": "Microsoft.Storage/storageAccounts/allowSharedKeyAccess",
                  "exists": "false"
                },
                {
                  "field": "Microsoft.Storage/storageAccounts/allowSharedKeyAccess",
                  "equals": ""
                }
              ]
            },
            {
              "field": "Microsoft.Storage/storageAccounts/allowSharedKeyAccess",
              "equals": "true"
            }
          ]
        }
      ]
    },
    "then": {
      "effect": "[parameters('effect')]"
    }
  }
```

- **Blocks:** Denies storage accounts that allow Shared Key authorization, so requests must use Microsoft Entra ID.
- **Breaks:** Existing storage accounts that allow Shared Key are marked non-compliant but not changed. ([source](https://learn.microsoft.com/en-us/azure/governance/policy/concepts/effect-deny))
- **Test before applying:** As for every Azure Policy guardrail: [how to test before enforcing](/mechanisms/azure-policy/)
- **Mechanism:** [Azure Policy (built-in definitions)](/mechanisms/azure-policy/): Resources at the scope of the assignment (management group, subscription, resource group) and their children, except notScopes and exemptions
- **Taken from:** [open source set](https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-policies/policyDefinitions/Storage/StorageAccountAllowSharedKeyAccess_Audit.json), MIT License, Azure/azure-policy repository, https://raw.githubusercontent.com/Azure/azure-policy/master/LICENSE

## What the source says

"Audit requirement of Azure Active Directory (Azure AD) to authorize requests for your storage account." (read 10 Nov 2026).

What it breaks is documented for every guardrail of this mechanism: see [Azure Policy](/mechanisms/azure-policy/).

## Related guardrails

- [Prevent root credentials management in member accounts](/guardrails/aws-scp-deny-member-root-credentials/): AWS, Service control policies (SCPs), identity and privilege
- [Deny the root user except for S3 bucket policy changes](/guardrails/aws-scp-deny-root-except-s3-bucket-policy/): AWS, Service control policies (SCPs), identity and privilege
- [Deny critical IAM user actions](/guardrails/aws-scp-deny-critical-iam-user-actions/): AWS, Service control policies (SCPs), identity and privilege
- [Azure Key Vault should use the RBAC permission model](/guardrails/azure-policy-keyvault-use-rbac/): Azure, Azure Policy (built-in definitions), identity and privilege
- [Azure SQL Database should have Microsoft Entra-only authentication enabled](/guardrails/azure-policy-sql-entra-only/): Azure, Azure Policy (built-in definitions), identity and privilege

## Related pages

- [Storage SAS tokens should adhere to 7 day maximum validity (Azure Azure Policy)](/guardrails/azure-policy-storage-sas-7-days/)
- [Key vaults should have deletion protection enabled (Azure Azure Policy)](/guardrails/azure-policy-keyvault-purge-protection/)
- [Azure Key Vault should use the RBAC permission model (Azure Azure Policy)](/guardrails/azure-policy-keyvault-use-rbac/)

## Sources

- Storage accounts should prevent shared key access: https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-policies/policyDefinitions/Storage/StorageAccountAllowSharedKeyAccess_Audit.json (read 10 Nov 2026)
- What it breaks: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/effect-deny (read 10 Nov 2026)
- How to test it first: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/guardrails/azure-policy-storage-no-shared-key/
