Storage Access control complete template-specs-five-use-cases template-specs-five-use-cases-three-case-studies

Shared Key

Shared Key is the old but still common way to authenticate to Azure Storage by using an account key. Think of it as a powerful password for the storage account, not a user-specific permission. Applications use the key to sign requests to blobs, files, queues, or tables, and anyone holding it can often do far more than intended. It is useful for compatibility, automation, and emergency access, but it is risky when keys are copied into scripts, connection strings, build variables, or partner integrations without rotation.

Aliases
storage Shared Key, account key authorization, storage account key, Shared Key auth
Difficulty
fundamentals
CLI mappings
5
Last verified
2026-05-24

Microsoft Learn

Shared Key is an Azure Storage authorization method where requests are signed with a storage account access key. Because the key can authorize broad data-plane access, Microsoft recommends evaluating Microsoft Entra ID, user delegation SAS, and disabling Shared Key where workloads no longer require it.

Microsoft Learn: Authorize with Shared Key2026-05-24

Technical context

Technically, Shared Key lives in the Azure Storage data plane. The storage account has account keys, and clients use one of those keys to create signed requests or connection strings. It appears beside SAS tokens, access keys, connection strings, storage SDK configuration, AzCopy jobs, and legacy applications. Control-plane RBAC decides who can read or rotate the keys, but possession of the key can authorize data access independently of the Entra permissions assigned to the user. That separation is why Shared Key must be governed carefully.

Why it matters

Shared Key matters because it is convenient enough to become invisible. A team may copy a connection string once, forget where it went, and discover years later that a vendor, function app, or pipeline can still reach sensitive storage. Key rotation then becomes frightening because nobody knows what will break. Shared Key also weakens identity-based accountability: logs may show key-based access rather than the human or managed identity behind the action. In secure environments, reducing Shared Key usage is a major step toward least privilege, better audit trails, safer SAS practices, and cleaner incident response when a credential leaks. quickly.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

The Storage account Access keys blade shows key1, key2, and connection strings, which is the main portal location where administrators handle Shared Key secret material.

Signal 02

Application settings, function configuration, pipeline variables, or Key Vault secrets contain DefaultEndpointsProtocol connection strings that indicate a workload still authenticates with storage account keys today.

Signal 03

Azure Activity Log or audit reviews show listKeys, regenerateKey, or storage account update operations, signaling that Shared Key management occurred during a controlled change safely.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Keep a legacy storage SDK or third-party tool running while a migration to Microsoft Entra ID is planned.
  • Rotate a compromised storage account key with a staged primary-secondary process that avoids unnecessary downtime.
  • Identify storage accounts where account keys are still being listed, distributed, or embedded in application settings.
  • Provide a temporary partner integration exception when the partner cannot yet use Entra ID or user delegation SAS.
  • Replace key-based connection strings in apps, pipelines, and functions with managed identity and RBAC.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Film archive rotates a leaked storage connection string

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A post-production studio discovered that an old storage connection string had been committed to a private repository used by freelancers. The account stored finished video masters and proxy files for active productions.

Business/Technical Objectives
  • Invalidate the exposed credential without interrupting delivery deadlines.
  • Find every application and worker that still used Shared Key.
  • Move stable services toward managed identity where supported.
  • Produce incident evidence for client security reviews.
Solution Using Shared Key

The cloud team used Azure CLI to list the account keys in a secured session, identify which key matched the exposed connection string, and update Render Farm workers to the secondary key through Key Vault references. After validation, they regenerated the exposed primary key and monitored storage request failures, data egress, and pipeline queue depth. Longer term, the archive management app moved to managed identity and RBAC, while one vendor tool kept a documented Shared Key exception with a 60-day rotation schedule. The incident runbook was rewritten so key output could not be copied into support tickets.

Results & Business Impact
  • The exposed key was invalidated within 74 minutes of detection.
  • No production delivery jobs missed their deadline during the rotation.
  • Shared Key dependencies fell from 14 workloads to three in six weeks.
  • Client review time dropped from five days to one day because evidence was complete.
Key Takeaway for Glossary Readers

Shared Key can be rotated safely, but only when dependencies, secret handling, and monitoring are treated as part of the incident response.

Case study 02

Agricultural sensor platform cleans up forgotten account keys

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

An agricultural IoT vendor stored irrigation telemetry in Azure Storage and Cosmos DB. Several field gateways still used storage account keys copied into configuration years earlier by a contractor.

Business/Technical Objectives
  • Discover where account keys were still used across gateways and batch jobs.
  • Reduce credential blast radius before expanding into regulated water districts.
  • Avoid interrupting overnight telemetry uploads from remote farms.
  • Create a repeatable rotation process for remaining exceptions.
Solution Using Shared Key

Engineers used CLI inventory to list storage accounts, check Shared Key access, and compare Key Vault secret versions with gateway configuration exports. They migrated cloud-hosted processors to managed identity first, then updated field gateways in batches so only one region changed per night. The primary and secondary account keys were rotated separately, with health checks watching upload success, queue length, and storage transaction failures. A small number of offline gateways kept Shared Key temporarily, but the exception list included owner, location, firmware version, and an expiration date tied to the next service visit.

Results & Business Impact
  • Managed identity replaced Shared Key in 81 percent of cloud-hosted components.
  • Nightly upload success stayed above 99.6 percent during staged rotations.
  • Unknown connection-string locations dropped from 37 to zero.
  • The security team approved expansion into two regulated districts after exception tracking was added.
Key Takeaway for Glossary Readers

Shared Key cleanup succeeds when cloud and edge dependencies are inventoried before rotation pressure arrives.

Case study 03

Airline maintenance partner uses a controlled key exception

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

An airline maintenance group exchanged inspection images with a specialist vendor whose transfer appliance did not support Entra authentication. The prior process used a shared mailbox and manual uploads, delaying aircraft release paperwork.

Business/Technical Objectives
  • Enable automated uploads without giving the vendor broad operational access.
  • Keep the Shared Key exception visible to security and procurement.
  • Rotate credentials without stopping maintenance-night transfers.
  • Prepare for a future move to SAS or identity-based access.
Solution Using Shared Key

The platform team created a dedicated storage account for vendor exchange rather than reusing the main maintenance data account. The Shared Key was stored in Key Vault, distributed through the vendor appliance onboarding process, and protected by network rules and private operational runbooks. CLI commands checked key age, listed account configuration, and rotated the secondary key during a trial. The team also logged every key-list and key-regeneration event, then documented a replacement path using scoped SAS once the vendor firmware supported it.

Results & Business Impact
  • Image transfer time fell from four hours to 35 minutes per aircraft package.
  • No vendor credential touched the primary maintenance archive account.
  • Quarterly key rotation completed twice without a failed overnight transfer.
  • The exception passed procurement review because owner, scope, and sunset criteria were explicit.
Key Takeaway for Glossary Readers

Shared Key is sometimes a compatibility bridge, but it should be isolated, rotated, and scheduled for retirement from the start.

Why use Azure CLI for this?

As an Azure engineer, I use Azure CLI for Shared Key because the risky part is not just whether keys exist; it is who can list them, where they are used, and whether the account allows key-based access. CLI lets me inventory storage accounts, inspect allowSharedKeyAccess, list or rotate keys during a controlled window, and export evidence for security reviews. It also makes emergency rotation repeatable instead of improvising inside the portal while an incident is active. For this term, CLI should be treated as sensitive tooling because some commands return secrets that must never be pasted into tickets or chat.

CLI use cases

  • Show whether a storage account permits Shared Key access before planning a credential cleanup or policy rollout.
  • List storage account keys only in a controlled terminal when emergency rotation or secure configuration update is required.
  • Regenerate the primary or secondary key during a staged rotation and validate dependent applications afterward.
  • Find app settings or deployment outputs that still contain storage connection strings and need migration.
  • Export storage account inventory to identify where Shared Key exceptions remain across subscriptions.

Before you run CLI

  • Confirm tenant, subscription, resource group, storage account, and change window before running commands that expose or rotate keys.
  • Use least-privilege roles; listing keys requires powerful control-plane access and returns secrets that must be protected.
  • Know which applications use the primary key and which use the secondary key before regenerating either one.
  • Capture output in secure JSON files only when necessary, and never paste access keys into tickets or shared chat.
  • Check whether allowSharedKeyAccess is false, because key-based commands or clients may fail when Shared Key is blocked.

What output tells you

  • allowSharedKeyAccess shows whether the storage account currently allows key-signed requests or has blocked that path.
  • keys list output returns sensitive key values and creation metadata; it should be treated as privileged secret material.
  • regenerateKey success means the old key value is invalid, so clients using it must already have been updated.
  • Connection strings reveal whether application configuration is still built around account keys rather than identities.
  • Activity logs for listKeys and regenerateKey show who handled key material and when the credential lifecycle changed.

Mapped Azure CLI commands

Storage Shared Key discovery and rotation

direct
az storage account show --name <storage-account> --resource-group <resource-group> --query "allowSharedKeyAccess" --output tsv
az storage accountdiscoverStorage
az storage account keys list --account-name <storage-account> --resource-group <resource-group> --output json
az storage account keysdiscoverStorage
az storage account keys renew --account-name <storage-account> --resource-group <resource-group> --key primary
az storage account keyssecureStorage
az storage account update --name <storage-account> --resource-group <resource-group> --allow-shared-key-access false
az storage accountsecureStorage
az resource list --resource-group <resource-group> --query "[?type=='Microsoft.Storage/storageAccounts'].{name:name,location:location}" --output table
az resourcediscoverStorage

Architecture context

Architecturally, Shared Key is a compatibility and break-glass pattern inside the storage access model. I do not design new production systems around it unless a service dependency clearly requires account-key authentication. The preferred pattern is usually Microsoft Entra ID with managed identities, RBAC, user delegation SAS, private networking, and short-lived credentials. Shared Key remains important because many older SDKs, tools, and third-party integrations still expect connection strings. A good architecture records every allowed use, isolates it to specific storage accounts, protects the keys in Key Vault or managed configuration, and has a tested rotation process. The key should never be the only access strategy.

Security

Security impact is direct and high. A storage account key can authorize broad data access, and if it leaks, an attacker may bypass the careful RBAC assignments created for users and managed identities. Protect keys like privileged secrets: store them in Key Vault or a secure configuration system, restrict who can list keys, rotate them, and avoid embedding connection strings in source code. Monitor for key-list operations and unusual data access. Where possible, set the storage account to disallow Shared Key and move clients to Entra-based authentication. If Shared Key remains necessary, document the exception and review it regularly. explicitly.

Cost

Cost impact is mostly indirect. Shared Key does not have a separate meter, but it can hide cost ownership because key-based clients may generate storage transactions, egress, or capacity growth without clear identity attribution. A forgotten script with an account key can keep copying data or writing logs long after the project ended. Rotation and migration to Entra ID also create engineering labor, testing, and outage risk if poorly planned. On the positive side, removing Shared Key dependence can lower incident-response cost and make showback cleaner because activity is tied to managed identities, applications, or teams instead of anonymous key usage.

Reliability

Reliability impact is indirect but real. Shared Key itself does not make storage more durable or less durable, but rotating or disabling it can break applications that depend on connection strings. A rushed key rotation can stop ingestion jobs, backup scripts, data exports, or function apps if the new key is not distributed correctly. The safe pattern is to use the two account keys deliberately: update clients to the secondary key, validate traffic, rotate the primary key, then repeat if needed. Before disabling Shared Key, test every dependent workload with Entra ID or user delegation SAS. Log evidence should confirm success.

Performance

Performance impact is indirect. Shared Key does not change the storage service throughput limits, latency, redundancy, or partition behavior. The performance issue appears during operations: applications that rely on old connection strings may fail or retry heavily after a key rotation, which can look like a storage slowdown. Moving to identity-based access can also expose token acquisition, role propagation, or SDK configuration problems that need testing. For performance-sensitive pipelines, validate authentication changes under load, watch request error rates, and confirm that retries are controlled. The access method should not become the hidden bottleneck during a security improvement. earlier. Without delay.

Operations

Operators deal with Shared Key during audits, migrations, incident response, and credential rotation. Practical work includes listing accounts where Shared Key is allowed, checking who has permission to list keys, finding app settings that contain connection strings, rotating keys, and validating that clients still connect. Because key commands can expose secrets, operators need safe output handling and secure terminals. Runbooks should include a dependency inventory, a communication plan, staged rotation, rollback steps, and monitoring for failed requests. The operational goal is not merely to rotate keys; it is to reduce the number of places where account keys are needed. safely.

Common mistakes

  • Pasting storage account keys into tickets, screenshots, logs, shell history, or deployment output during troubleshooting.
  • Rotating both account keys at once and breaking every client that depended on key-based connection strings.
  • Assuming RBAC protects data access when a copied account key can still authorize storage requests.
  • Leaving old vendor integrations on Shared Key because nobody owns the migration to Entra-based access.
  • Disabling Shared Key without first finding backup jobs, functions, pipelines, or SDKs that still use connection strings.