Databases Cache verified

Redis access key

A Redis access key is a password-like secret for a Redis cache. Applications can use it in a connection string to prove they are allowed to connect. Azure usually provides a primary and secondary key so one can stay active while the other is rotated. A single key is convenient, but it is also a shared secret. Anyone who gets it can connect as broadly as the key allows, so it belongs in Key Vault, app settings, or a managed secret store, never in code.

Aliases
No aliases mapped yet
Difficulty
intermediate
CLI mappings
7
Last verified
2026-05-21

Microsoft Learn

A Redis access key is one of the secret values clients can use to authenticate to Azure Cache for Redis or Azure Managed Redis when key-based authentication is enabled. Operators list or regenerate keys through Azure management tools, then update client connection secrets carefully.

Microsoft Learn: az redis and az redisenterprise database access key commands2026-05-21

Technical context

In Azure architecture, a Redis access key sits between the control plane that manages the cache and the data-plane clients that connect to Redis. Basic, Standard, and Premium Azure Cache for Redis use az redis commands, while Azure Managed Redis and Enterprise-style databases use az redisenterprise database commands. The key is not a role assignment; it is a shared authentication secret. Modern designs prefer Microsoft Entra authentication where supported, but access keys still appear in connection strings, legacy clients, rotation workflows, diagnostics, and break-glass procedures.

Why it matters

Redis access key matters because cache authentication often hides inside application settings until an outage or leak exposes it. A stale key can keep old services connected after they should be retired. A leaked key can let an attacker read or modify cached session data, feature flags, tokens, or rate-limit counters. A careless regeneration can disconnect every application that still uses the old value. The operational value is controlled rotation: update clients to use the alternate key, verify connections, regenerate the old key, then repeat if needed. Treating the key as a managed secret keeps Redis fast without making authentication invisible.

Where you see it

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

Signal 01

Azure CLI output from az redis list-keys or az redisenterprise database list-keys returns primary and secondary key fields that must be handled as sensitive secret material.

Signal 02

App Service configuration, AKS secrets, Function App settings, or Key Vault references contain Redis connection strings that embed either the primary or secondary key during audits.

Signal 03

Incident runbooks and rotation change records mention which Redis access key was active, which applications were moved, and when regeneration occurred during response planning during security response planning.

When this becomes relevant

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

  • Rotate a leaked primary key by moving clients to the secondary key, validating connections, then regenerating the compromised value.
  • Support a legacy Redis client library that cannot yet use Microsoft Entra authentication during a staged Azure Managed Redis migration.
  • Store a cache connection secret in Key Vault and reference it from App Service or Functions without committing it to source control.
  • Identify which application still uses an old Redis key after a rotation by correlating secret versions, deployments, and connection logs.
  • Perform a break-glass cache connection during an incident while preserving an audit trail of who listed or regenerated the key.

Real-world case studies

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

Case study 01

Media platform rotates exposed cache secret after CI leak

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

Scenario

A streaming media platform discovered that a Redis connection string had been printed in a failed build log. The cache stored session hints and recommendation counters for several customer-facing APIs.

Business/Technical Objectives
  • Remove the exposed Redis access key without a full application outage.
  • Confirm which services still used key-based authentication.
  • Move the new secret into Key Vault references.
  • Preserve evidence for the security incident review.
Solution Using Redis access key

The platform team used the two-key rotation pattern for the Redis access key. First, they checked the cache resource with Azure CLI and confirmed that applications were using the primary key. They stored the secondary key as a new Key Vault secret version, updated App Service settings and Kubernetes secrets to reference it, then restarted one region at a time. After connection metrics stayed healthy, they regenerated the primary key and removed the leaked build artifacts. The team avoided copying key values into incident tickets; they recorded command timestamps, secret version IDs, deployment IDs, and validation metrics instead.

Results & Business Impact
  • Customer API error rate stayed below 0.2 percent during the rotation.
  • Seven services moved from inline connection strings to Key Vault-backed settings.
  • The exposed primary key was invalidated within 90 minutes of detection.
  • The incident review had clear evidence without retaining the leaked secret value.
Key Takeaway for Glossary Readers

A Redis access key can be rotated safely when the alternate key, secret store, and validation plan are ready before regeneration.

Case study 02

Logistics SaaS keeps legacy workers online during migration

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

Scenario

A logistics SaaS provider was migrating to Azure Managed Redis, but several older worker services still used a client library that did not support Entra authentication. The company needed a temporary but controlled key-based path.

Business/Technical Objectives
  • Support legacy workers without blocking the Redis migration.
  • Keep access keys out of source code and container images.
  • Define a deprecation date for key-based authentication.
  • Monitor worker reconnections during each rollout.
Solution Using Redis access key

The engineering team enabled access-key authentication only for the Redis database used by the legacy worker fleet. The Redis access key was stored in Key Vault, and workloads consumed it through managed deployment secrets. Azure CLI scripts showed the Redis resource, listed keys during a controlled ceremony, and regenerated the inactive key after each environment moved. New services used Entra authentication and custom access policies, so the shared key did not become the default pattern. The migration runbook tracked which worker versions still depended on the key and which had been upgraded.

Results & Business Impact
  • The Redis migration finished four weeks earlier because legacy clients had a safe bridge.
  • No Redis keys were present in container images after the first rollout.
  • Worker reconnect latency stayed under the existing five-second threshold.
  • The team retired key use from production workers within two release cycles.
Key Takeaway for Glossary Readers

A Redis access key can be a practical migration bridge when it is scoped by process, protected as a secret, and given an exit plan.

Case study 03

Gaming studio stabilizes rotation for seasonal launch

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

Scenario

A gaming studio expected a major traffic spike for a seasonal event. Previous Redis key rotations had caused lobby-service reconnect storms because teams regenerated the active key too early.

Business/Technical Objectives
  • Create a repeatable rotation runbook before launch week.
  • Avoid reconnect storms across lobby, matchmaking, and inventory APIs.
  • Reduce the number of engineers allowed to list keys.
  • Prove applications were using the intended secret version.
Solution Using Redis access key

The studio built a Redis access key runbook around Azure CLI and Key Vault versioning. Operators first showed cache metadata and confirmed the active secret reference in each service. They moved clients to the secondary key during a low-traffic window, warmed connection pools, and watched Application Insights for reconnect spikes. Only after all services reported healthy connections did they regenerate the primary key. RBAC was tightened so only the platform on-call group could list or regenerate Redis keys. The final checklist included cache metrics, secret versions, deployment hashes, and rollback steps.

Results & Business Impact
  • Seasonal launch traffic peaked at 2.8 million concurrent users without a key-related outage.
  • Rotation time dropped from three hours to 55 minutes.
  • Only four approved operators retained permission to list Redis keys.
  • Post-rotation cache hit ratio returned to normal within ten minutes.
Key Takeaway for Glossary Readers

Redis access key operations are reliable when rotation is treated as a production deployment, not a secret-copy task.

Why use Azure CLI for this?

Azure CLI is useful for a Redis access key because key work must be exact, repeatable, and auditable. With long Azure operations experience, I do not want a production rotation to depend on someone remembering which portal tab they clicked. CLI can show the cache, list keys when access-key authentication is enabled, regenerate only Primary or Secondary, and query output without exposing more fields than needed. It also lets runbooks compare environments, capture timestamps, and coordinate Key Vault updates or app restarts in a controlled sequence. That repeatability matters when several application teams must coordinate one sensitive secret change. Use evidence.

CLI use cases

  • List Redis keys only during an approved rotation window and immediately place the selected value into a managed secret store.
  • Regenerate the inactive primary or secondary key after applications have been moved to the alternate connection secret.
  • Show cache configuration before rotation to confirm resource group, SKU, endpoint, and access-key authentication state.
  • Query only nonsecret metadata during routine reviews so key values are not printed into terminals or ticket attachments.
  • Export a rotation evidence record with cache name, key type, secret version, command timestamp, and validation status.

Before you run CLI

  • Confirm tenant, subscription, resource group, cache name, cache family, and whether az redis or az redisenterprise applies.
  • Verify permission to list or regenerate keys, and remember that command output may contain sensitive secret values.
  • Identify every app, job, container, and pipeline using the key before regenerating Primary or Secondary.
  • Check whether Microsoft Entra authentication is available and whether access-key authentication is intentionally enabled.
  • Plan application restarts, Key Vault version updates, rollback timing, and monitoring for connection failures or cache misses.

What output tells you

  • primaryKey and secondaryKey values are secrets; their presence means access-key authentication can be used by clients.
  • Resource ID, hostname, port, and provisioning state confirm that you are inspecting the intended Redis resource.
  • Key type in a regenerate command tells you which side of the two-key rotation pattern changed.
  • Access-key authentication settings help explain whether clients can still connect with keys or must use Entra authentication.
  • Timestamps and command context support audit evidence without needing to retain the secret value itself.

Mapped Azure CLI commands

Redis access key CLI Commands

az redis show --name <cache-name> --resource-group <resource-group>
az redisdiscoverDatabases
az redis list-keys --name <cache-name> --resource-group <resource-group> --query "[primaryKey,secondaryKey]" --output tsv
az redisdiscoverDatabases
az redis regenerate-keys --name <cache-name> --resource-group <resource-group> --key-type Primary
az redisoperateDatabases
az redis regenerate-keys --name <cache-name> --resource-group <resource-group> --key-type Secondary
az redisoperateDatabases
az redisenterprise database show --cluster-name <cache-name> --resource-group <resource-group>
az redisenterprise databasediscoverDatabases
az redisenterprise database list-keys --cluster-name <cache-name> --resource-group <resource-group>
az redisenterprise databasediscoverDatabases
az redisenterprise database regenerate-key --cluster-name <cache-name> --resource-group <resource-group> --key-type Primary
az redisenterprise databaseoperateDatabases

Architecture context

An experienced Azure architect treats a Redis access key as a compatibility mechanism, not the preferred identity boundary. It belongs in the application secret path, alongside Key Vault references, App Service settings, AKS secrets, pipeline variables, and incident runbooks. The cache resource still has network controls, SKU decisions, diagnostics, and possibly private endpoints, but the key decides whether a client can authenticate once it reaches the endpoint. For new Azure Managed Redis workloads, Entra-based authentication is often a stronger target. For legacy libraries or migration phases, the key rotation pattern must be designed before production launch, including owners, timing, monitoring, and rollback.

Security

Security impact is direct and high. A Redis access key is a shared secret, not a scoped user permission. If the key is copied into source control, chat, logs, build output, or an unmanaged workstation, every client using that key may be at risk. Store it in Key Vault or a managed application secret store, restrict who can list keys, and prefer Entra authentication where feasible. Listing keys requires sensitive management permission and the output can itself become a leak. Disable access-key authentication only after every client has moved to a supported identity-based connection path. Review diagnostic logs afterward for unexpected clients using the new secret.

Cost

A Redis access key has no direct meter, but poor key handling creates avoidable cost. Emergency rotations consume engineering time, force application restarts, and can trigger support incidents. A leaked key may require cache rebuilds, session invalidation, forensic review, and customer communication. Using keys for every workload can also slow migration to Entra authentication and custom data access policies, keeping teams on legacy patterns. FinOps impact appears when outages cause overprovisioned fallback systems, lost productivity, or extra monitoring work. The cheapest key strategy is planned rotation, minimal exposure, and clear ownership of every consuming application. Planned key rotation is cheaper than emergency coordination after customer-facing errors begin.

Reliability

Reliability impact comes from rotation and dependency behavior. Regenerating the active Redis access key before clients switch to the alternate key can cause immediate connection failures, cache misses, login problems, or application restarts. A reliable pattern uses two keys: move applications to the secondary key, confirm successful connections, regenerate the primary key, then update and repeat if policy requires both keys refreshed. Blue-green deployments, Key Vault versioning, and application restart planning reduce blast radius. For geo-replicated or multi-region designs, teams must know which key each endpoint expects before a region event. Keep the old secret version available until rollback risk has clearly passed.

Performance

Runtime performance is not improved by the key itself; Redis speed comes from in-memory data and the chosen cache tier. The key affects performance indirectly when rotation or secret distribution disrupts connection pools. Clients may reconnect, retry, or fall back to databases if the key changes unexpectedly, increasing latency and load elsewhere. Authentication configuration also affects operational performance: teams troubleshoot faster when they know which key, secret version, endpoint, and client fleet are in use. Keeping secrets centralized shortens incident response because operators do not search every deployment for hard-coded connection strings. Stable secret distribution prevents avoidable reconnect spikes during busy periods.

Operations

Operators manage a Redis access key through inventory, key listing, secret distribution, rotation, incident response, and evidence collection. They check the cache type first because az redis and az redisenterprise commands differ. They then identify which applications reference the key, where the secret is stored, and whether diagnostic logs show continued connections after rotation. Strong runbooks avoid printing key values into tickets. Instead, they capture command names, timestamps, secret version IDs, and validation results. During incidents, operators may regenerate a key, restart affected clients, and watch connection, latency, error, and cache-hit metrics. Mature teams also rehearse the rotation in nonproduction before touching customer traffic.

Common mistakes

  • Regenerating the active key before applications have switched to the alternate key and verified healthy connections.
  • Pasting key output into a ticket, shell history, shared document, or CI log during troubleshooting.
  • Assuming a Redis access key is scoped like RBAC when it is actually a broad shared secret.
  • Rotating the cache secret but forgetting worker apps, background jobs, deployment slots, or Kubernetes secrets.
  • Disabling access-key authentication before all client libraries and identities support the Entra-based connection model.