CloudVectra Logo CloudVectra
CloudVectra Knowledge Hub

Azure Blob Storage Security: Access Control, Encryption and Common Misconfigurations

Secure Azure Blob data with Entra ID, RBAC, ACLs, scoped SAS, private networking, encryption, recovery controls and threat monitoring.

8 min read

A private container can still leak data through an overpowered account key, a long-lived SAS, or a legitimate identity with excessive access. Encryption and a private endpoint each solve part of the problem; effective security requires the entire request and recovery path to be controlled.

This guide covers Blob Storage and the relevant ADLS Gen2 differences. Review feature support for the account type and protocols you actually use.

1. Overview: separate identity, authorization, and reachability

Authentication identifies the credential. Authorization determines which operations it permits. Network rules determine whether the request may reach the service through that path. A working private route grants no blob permissions, and a valid token does not bypass every network restriction.

Also separate management-plane access from data-plane access. A resource Reader can inspect account configuration without automatically reading blob content. Conversely, a role that can list storage account keys may obtain much broader data access through Shared Key.

2. Types and configurations: choose the credential model

MethodHow it worksSecurity implication
Microsoft Entra IDOAuth token for a user or workload identityUse data roles and short-lived credentials
Account access keyShared secret signs storage requestsBroad account authority; difficult per-user attribution
User delegation SASBlob access signed with an Entra-derived delegation keyPreferred SAS option where supported
Service SASDelegates access to one storage service, usually using an account keyProtect signer and revocation design
Account SASDelegates operations across services/resourcesScope can become much broader than intended

Managed identities remove application secrets from configuration. Use Storage Blob Data Reader or an appropriately scoped write role as needed, preferably at container scope. Broad Owner or Contributor roles can also enable privilege escalation through resource administration, even when they are not direct blob data roles.

Azure supplies two account keys to support staged rotation. Inventory every consumer before rotating: changing a key can invalidate applications and SAS tokens signed with it. Once compatibility is verified, disallow Shared Key authorization for Blob workloads that can use Entra ID. Do not assume that disabling anonymous access also disables key-based or SAS access.

RBAC versus ADLS ACLs

RBAC grants access at scopes such as account or container. ADLS Gen2 ACLs authorize directories and files for Entra identities; execute permission on ancestor directories matters for traversal.

An ACL cannot deny access already allowed by an applicable RBAC grant. Shared Key and key-signed SAS bypass the ordinary Entra RBAC/ACL path. Use a narrowly scoped data role and ACL design together; assigning account-wide data access can defeat the isolation expected from directory permissions.

3. Architecture: private networking needs DNS and policy

Original pencil diagram showing an Entra identity passing authorization and private-network checks before accessing an encrypted blob, with separate recovery and audit controls

Figure 1 — Test every allowed request path, including administration, ingestion, recovery, and service integrations.

A private endpoint exposes a private IP for a specific service subresource. Creating one does not automatically disable the public endpoint. Configure public network access or firewall policy explicitly and verify name resolution from each client network.

Service endpoints identify permitted subnets while reaching the storage service’s public endpoint; they do not create a private IP. Storage firewall rules and selected-network configuration still matter. Neither option replaces RBAC or credential controls.

For HNS workloads, Blob and DFS APIs can both be involved. Configure the required private endpoints and DNS zones for both subresources. Test hybrid DNS, VPN/ExpressRoute routing, ingestion tools, and monitoring integrations before closing the public path.

4. Limits and quotas: SAS and recovery have boundaries

A SAS is a bearer credential: whoever possesses it may exercise its permitted operations until it expires or an applicable revocation or policy takes effect. User delegation keys are valid for at most seven days, so their SAS cannot be used as a permanent service credential.

Account and service SAS tokens have different revocation options. A stored access policy can govern eligible service SAS tokens; it does not govern user delegation SAS or account SAS. Keep lifetimes short and document the emergency revocation procedure.

Feature compatibility matters as much as numeric limits. HNS accounts do not currently provide ordinary Blob versioning. Validate immutable-storage scope and supported combinations instead of copying a flat-namespace configuration into a data lake.

5. Gotchas: common exposure patterns

  1. - A SAS is logged in a URL, support ticket, browser history, or analytics trace.
  2. - Account-key access survives an apparently restrictive directory ACL.
  3. - A private endpoint exists, but public access remains open or DNS uses the wrong endpoint.
  4. - A broad data-role assignment makes a narrow ACL ineffective.
  5. - Network allowlists or trusted-service exceptions include more workloads than intended.
  6. - CORS is mistaken for authentication; it only controls browser cross-origin behavior.

Anonymous Blob access requires the relevant account setting and container access level. Disable account-level anonymous access for private datasets, then inspect container settings and external copies. Public caches and downloaded data do not disappear when the origin is secured.

6. Security: encryption, retention, and detection

Encryption keys and infrastructure encryption

Azure Storage encrypts data at rest with Microsoft-managed keys by default. Customer-managed keys in Key Vault or Managed HSM provide additional control over key lifecycle and access. Protect the storage managed identity’s key permissions, key rotation, soft delete, and purge protection; disabling a necessary key can make data unavailable.

Infrastructure encryption adds a separate encryption layer for an account or supported encryption scope. Plan it at creation where required. It does not change who may download a blob and does not replace TLS or authorization.

Blob soft delete retains supported deleted data for a configured period. Container soft delete protects a different level of deletion. Versioning preserves prior versions on eligible accounts; snapshots capture chosen states. None of these should be assumed to survive an uncontrolled account deletion or every administrator action.

On HNS accounts, soft-delete behavior differs, including overwrite protection limitations. A retention period is useful only when the actual failure can be recovered.

Immutable storage enforces write-once/read-many retention or legal holds at supported scopes. Test unlocked retention before locking it: a locked time-based policy cannot simply be shortened to remove an inconvenient object. Legal holds need a deliberate release workflow. Keep recovery administration separate from application write permissions.

Defender for Storage detects suspicious activity and offers capabilities such as malware scanning under the enabled plan and configuration. Route findings to an owned response process. Detection is not a substitute for access control, and scanning is not automatically a blocking quarantine workflow for every application.

7. Pricing: budget the controls around the data

Private endpoints incur endpoint-hour and data-processing charges where applicable. Diagnostics, log retention, Defender features, malware scanning, Key Vault operations, and retained deleted data can add costs.

For illustration, one endpoint at an assumed $0.01/hour costs $7.30 over 730 hours before data processing. This is a planning input, not a regional quote. A required security boundary should be budgeted with the workload rather than removed because its cost was omitted.

8. Optimization: verify configuration and issue narrow access

These Azure CLI examples use an authorized identity and an existing account. The first commands are read-only; management-plane access does not guarantee data access.

ACCOUNT='replacewithyouraccount'
RG='replacewithresourcegroup'

az storage account show --name "$ACCOUNT" --resource-group "$RG" --query '{anonymous:allowBlobPublicAccess,sharedKey:allowSharedKeyAccess,publicNetwork:publicNetworkAccess,https:enableHttpsTrafficOnly,tls:minimumTlsVersion,hns:isHnsEnabled}'

az storage account network-rule list --account-name "$ACCOUNT" --resource-group "$RG"
az storage blob service-properties show --account-name "$ACCOUNT" --auth-mode login

An unset property can require interpretation of service defaults; a failed query is not evidence that a control is enabled. Check effective role assignments, private-endpoint approvals, and actual data-plane access too.

For a short-lived read-only user delegation SAS, the following Bash example uses GNU date to calculate a 15-minute expiry. The signer needs delegation-key permission at an appropriate account scope and permission to read the selected blob. It creates a credential, captured in a variable rather than printed.

EXPIRY_UTC=$(date -u -d '+15 minutes' +%Y-%m-%dT%H:%MZ)

SAS=$(az storage blob generate-sas --account-name "$ACCOUNT" --container-name documents --name approved/report.pdf --permissions r --expiry "$EXPIRY_UTC" --https-only --as-user --auth-mode login --output tsv)

Do not enable shell tracing around secrets. Deliver the token only through the intended secure channel, avoid logging it, and clear it when finished. Use managed identity directly when the client can authenticate without a SAS.

9. Monitoring and governance: collect evidence of data access

Enable appropriate Blob diagnostic logs and route them to a controlled destination. Azure Activity Log covers management activity; it is not a complete log of blob reads. Inspect authentication type, operation, response, caller information, and network origin where available.

Alert on anonymous exposure, Shared Key re-enablement, role changes, firewall drift, unusual downloads, deletion spikes, and key failures. Use Azure Policy to enforce reviewed baselines and Defender findings for investigation. Validate coverage with a controlled read, denied request, and deletion/recovery test.

CloudVectra can help consolidate connected inventory, cost, and security signals for ongoing review. Confirm which Azure Storage controls it evaluates before relying on it as evidence of compliance.

10. AWS/Azure comparison: translate the policy objective

Entra data roles and ADLS ACLs differ from S3 identity and bucket policies. SAS resembles delegated signed access but has distinct signing and revocation models. Azure private endpoints and service endpoints are separate mechanisms; neither is simply an S3 gateway endpoint under another name.

Compare anonymous-access controls, effective identities, network routes, key administration, retained history, and immutability using real allowed and denied requests on each platform.

Sources and further reading

Review your Azure Storage access and recovery controls

CloudVectra Professional Services can help assess storage permissions, network paths, encryption, audit coverage, and data recovery controls against your security requirements.

Choose whether CloudVectra may load optional analytics. You can change this at any time.

Cookie names, providers, and retention