Join our Newsletter — 33% off our NHI Course
Home› Guides› How to disable local key authentication across Azure…
Guide Cloud & Workload Identity

How to disable local key authentication across Azure services and move callers to Entra ID: one switch per service, enforced by policy

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 15 min read
On this page

Most Azure data services still accept a static key or connection string next to Microsoft Entra ID, and every one of those keys is an unowned, non-expiring credential that bypasses role-based access control. Each service has its own switch to turn local authentication off, usually a property called disableLocalAuth, and Azure Policy has matching built-in definitions to audit, deny or fix it. This guide treats the job as one tenant-wide programme rather than a service-by-service clean-up: inventory every resource that still accepts keys, find the callers, move them to managed identities or service principals with data roles, then switch keys off and keep them off with policy. It is for Azure platform, cloud security and identity teams. Storage accounts are covered step by step in How to rotate Azure storage account keys and move to disabled Shared Key access, so this page links to it rather than repeating it.

Local authentication here means any data-plane credential that is not an Entra token: account keys, shared access signature (SAS) rules, access keys, API keys, admin users and connection strings built from them. A key is a non-human identity with no owner, no sign-in log entry under a named principal, and no Conditional Access. Removing the class of credential is stronger than rotating it.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • One concept, many switches. Service Bus, Event Hubs, Event Grid, Cosmos DB, App Configuration, Application Insights and Azure AI services each expose their own local authentication setting, and Storage, Redis, AI Search and Container Registry use different names for the same idea.
  • Find callers before you flip anything. Use each service's own evidence (runtime logs, connection metrics, transaction metrics) to prove no client still sends a key, then disable per environment, development first.
  • Effects differ by service. App Configuration deletes its keys, Redis drops every connection, and Azure AI services can keep honouring old keys for minutes to hours while its gateway cache refreshes.
  • Policy keeps the door shut. Assign the built-in "should have local authentication methods disabled" definitions in Audit first, then Deny for new resources, and use the "Configure ... to disable local authentication" Modify definitions with remediation tasks for estates you trust.
  • Control-plane roles still read keys. While keys are on, Owner and Contributor can call listKeys and reach all data, so disabling local authentication also shrinks the blast radius of broad Azure roles.

Why local keys are an identity problem

Entra ID authentication gives every caller a named principal, a token with a lifetime, a role assignment at a chosen scope and a sign-in record. A local key gives none of that. Microsoft's App Configuration documentation notes that Owner and Contributor do not grant Entra data access but do include listKeys/action, which gives access to all data through the access keys. The same pattern applies across services: whoever can list keys on the control plane effectively holds data access, whatever the data-plane role design says. Microsoft's Azure AI services guidance makes the point directly for that service: key-based authentication grants access without role restrictions.

Keys also leak in predictable places: application settings, pipeline variables, local configuration files and copied connection strings in tickets. That is ATT&CK T1552.001 Credentials In Files, and the wider pattern is covered in the MITRE ATT&CK T1552 Unsecured Credentials Guide. Turning local authentication off makes a leaked key useless instead of something you have to race to rotate.

The switch for each service

The table lists the setting, how to change it and the built-in Azure Policy definitions Microsoft documents for each. Names are as shown in Microsoft Learn in November 2026. Services are listed alphabetically.

ServiceSetting and whereBuilt-in audit or deny policy
App ConfigurationSettings, Access settings, Enable access keys set to DisabledApp Configuration stores should have local authentication methods disabled
Application InsightsDisableLocalAuth: true on Microsoft.Insights/components; portal Configure, PropertiesApplication Insights components should block non-Azure Active Directory based ingestion
Azure AI services (Foundry Tools)disableLocalAuth; Set-AzCognitiveServicesAccount -DisableLocalAuth $trueAzure AI Services resources should have key access disabled (disable local authentication)
Azure Cache for RedisAuthentication, Access keys, Disable Access Keys Authentication (Basic, Standard, Premium)Azure Cache for Redis should not use access keys for authentication
Container RegistryAdmin user off (it is off unless enabled); also anonymous pull, ARM audience tokens and repository scoped tokensContainer registries should have local admin account disabled
Cosmos DBdisableLocalAuth: true on Microsoft.DocumentDB/databaseAccounts; portal Key-based authentication set to Disable at creationCosmos DB database accounts should have local authentication methods disabled
Event GriddisableLocalAuth on topics, domains and partner namespaces; portal Local Authentication, DisabledAzure Event Grid topics (and domains, partner namespaces) should have local authentication methods disabled
Event HubsdisableLocalAuth on the namespaceAzure Event Hub namespaces should have local authentication methods disabled
Service Busaz servicebus namespace update --disable-local-auth trueService Bus namespaces should have local authentication methods disabled
StorageAllow storage account key access set to Disabled (AllowSharedKeyAccess false)Covered in How to rotate Azure storage account keys and move to disabled Shared Key access

Azure AI Search uses a mode rather than a property: under Settings, Keys choose Role-based access control instead of API Key or Both. Four services also have a Modify definition that switches keys off for you: "Configure App Configuration stores to disable local authentication methods", "Configure Cosmos DB database accounts to disable local authentication", "Configure container registries to disable local admin account" and the Event Grid "Configure ... to disable local authentication" definitions for topics, domains and partner namespaces. Cosmos DB also has a policy, "Azure Cosmos DB key based metadata write access should be disabled" (Append effect), which stops key holders changing databases and containers through the data plane. For the deep configuration of individual services, see the Azure Service Bus and Event Hubs Security, the Azure SQL and Cosmos DB Security Guide, the Azure OpenAI and Azure AI Foundry Security Guide and the Azure Container Registry Security Guide.

What changes when you flip the switch

The same word, "disable", has different consequences per service. Plan the cutover around them.

ServiceDocumented effectRollback behaviour
App ConfigurationAll access keys are deleted; key-based clients fail. If the ARM authentication mode is local, ARM template reads and writes of key-values stop too, so Microsoft recommends pass-through modeRe-enabling generates new keys; clients with the old keys still fail until updated
Application InsightsOnly telemetry authenticated with Entra ID is ingested; senders need Monitoring Metrics Publisher. Some SDKs are unsupported, including the JavaScript SDK and the Java 2.x SDK (use the Java agent 3.2.0 or later)Set the property back to false; templates are create-or-update, so include every property you want to keep
Azure AI servicesControl plane changes at once, but the shared gateway can keep accepting old keys until its cache refreshes, usually minutes and up to several hoursRe-enabling has the same delay
Azure AI SearchRequests carrying an API key are refused; admin keys can be disabled but not deleted. Role assignments can take 5 to 10 minutes to applySwitch back to Both or API Key
Azure Cache for RedisAll existing client connections are terminated, Entra or key; Entra authentication and at least one Redis user must exist first; geo-replicated caches must be unlinked firstRe-enable access keys in the same blade, again in a maintenance window
Container RegistryEvery user of the admin credentials is cut off; some portal deployments to Container Instances and Container Apps still rely on the admin userRe-enable the admin user and rotate its passwords
Cosmos DBKey-based connections fail; data-plane roles are assigned with az cosmosdb sql role assignment create, not in the portalSet disableLocalAuth back to false
Service Bus and Event HubsSAS rules remain but cannot produce working tokensSet the property back to false; SAS works again

A Deny policy assignment will also block re-enabling. Write the exemption process into your rollback plan before you switch policies to Deny.

Step-by-step: from inventory to enforced

  1. Inventory with Azure Resource Graph. Query the Resources table per type and project the local authentication property. A sample shape: Resources | where type =~ 'Microsoft.ServiceBus/namespaces' | project name, resourceGroup, subscriptionId, properties.disableLocalAuth. Repeat for Microsoft.EventHub/namespaces, Microsoft.EventGrid/topics, Microsoft.DocumentDB/databaseAccounts, Microsoft.CognitiveServices/accounts and the others in the table. Property paths are case-sensitive, and a missing value usually means the default (keys on). Run it with az graph query -q across all subscriptions you can read.
  2. Assign the audit policies. Put the "should have local authentication methods disabled" definitions in a single initiative at management group scope with the Audit effect. The compliance view becomes your live inventory and progress chart. See the Azure Policy and Management Groups Guide.
  3. Find the callers. Use service evidence: Service Bus and Event Hubs runtime audit logs; Redis metrics Connected Clients against Connected Clients Using Microsoft Entra Token; Storage transaction metrics split by authentication type; for Cosmos DB, check the data-plane request table schema in your workspace for the authentication column before you rely on it. Add the Activity Log: any listKeys or key regeneration call tells you which principal is fetching keys and therefore which application to migrate.
  4. Give each caller an identity and a data role. Prefer a managed identity for workloads running in Azure, and a federated credential for workloads outside it (see How to replace Azure app secrets with federated credentials). Assign data-plane roles at the narrowest scope: Azure Service Bus Data Sender or Receiver on the entity, EventGrid Data Sender on the topic, Cosmos DB Built-in Data Contributor or Reader on the container, Monitoring Metrics Publisher on the Application Insights component.
  5. Change the client. Replace the connection string with the service endpoint plus a token credential, for example DefaultAzureCredential during development and ManagedIdentityCredential in Azure. For App Service and Functions auto-instrumentation of Application Insights, Microsoft documents APPLICATIONINSIGHTS_AUTHENTICATION_STRING with Authorization=AAD (or the user-assigned client ID).
  6. Prove quiet with keys still on. Watch the evidence from step 3 for a full business cycle, including month-end jobs and disaster recovery tests. Only then disable.
  7. Disable per environment. Development, then test, then production. For Azure AI services, verify with an old key until it returns HTTP 401 rather than trusting the portal.
  8. Move policy to Deny and remediate. Switch the audit definitions to Deny for new resources. Where the Modify definitions exist, assign them with a managed identity and create remediation tasks for existing resources; Microsoft documents that remediation runs under the assignment's managed identity and that roles must be granted manually when assigning through the CLI, PowerShell or SDK.
  9. Clean up. Remove unused SAS rules and query keys, delete key copies from Key Vault, pipeline variables and app settings, and close the change record with the before and after compliance figures.

Decision guidance

SituationApproachTrade-off
New resources (greenfield)Deny policy from day one; templates set the property to trueDevelopers must use identities from the first commit; cheap now, expensive later
Existing estate with known ownersAudit, migrate per application, disable, then Modify with remediationSlower, but each change is tested by the team that owns the client
Third-party or vendor client that only takes a keyTime-boxed policy exemption, narrowest key available (for example an entity-scoped Send rule), stored in Key Vault with an owner and rotation dateResidual risk is explicit and visible in compliance reports
SDK or runtime without Entra supportUpgrade the SDK first (for example the Java agent for Application Insights); if impossible, exempt and recordUpgrade work may be larger than the authentication change
Disruptive switch (Redis, Container Registry admin user)Maintenance window, client retry logic confirmed, owner on callShort planned outage instead of an unplanned one

Small organisations can often do the whole estate in a few change windows: one subscription, a handful of resources, policy at subscription scope. Large organisations should run it as a programme with a management-group initiative, a compliance target per landing zone, and an exemption register reviewed monthly. Platform teams should bake disableLocalAuth: true into shared Bicep or Terraform modules so the default is right; see the Azure Bicep and ARM Template Security Guide.

Where identity fits

Disabling keys moves risk onto Entra identities, so those identities need the controls that keys never had. Each workload should have its own managed identity rather than one shared identity across many applications, so logs still tell you which application acted. Review data role assignments the same way you review human access, and remove the identities of decommissioned workloads. The Azure Managed Identities Security Guide covers identity choice and scoping, and the Service Principals vs Managed Identities page helps when a caller runs outside Azure.

Detection and measurement

  • Configuration drift: Activity Log writes that set disableLocalAuth back to false, re-enable App Configuration access keys or turn the Container Registry admin user on. Alert on each and require a linked change.
  • Key retrieval: listKeys, listConnectionStrings and key regeneration operations on resources declared Entra-only. After cutover these should be rare.
  • Policy state: non-compliant resource counts per definition, and Deny events showing who tried to create a key-enabled resource.
  • Service evidence: SAS authentication in Service Bus or Event Hubs runtime logs, and any gap between Redis connected clients and Entra-token clients.

Collect the Activity Log centrally as described in the Azure Monitor, Activity Log and Diagnostic Settings Guide. Metrics that show the programme is working:

  1. Percentage of in-scope resources compliant with the local authentication policies, per service and per landing zone.
  2. Number of active policy exemptions, each with an owner and an end date (target: falling).
  3. Count of listKeys calls per month on in-scope resource types (target: near zero).
  4. Number of key or connection-string secrets still stored in Key Vault and pipeline variables for these services.
  5. Re-enablement events per quarter, each with a recorded reason.

Framework mapping

FrameworkReferenceHow this work supports it
NIST CSF 2.0PR.AA-01, PR.AA-05Service credentials are managed identities with least-privilege data roles instead of shared keys
NIST CSF 2.0PR.PS-01Policy enforces the configuration across the estate
NIST SP 800-53 Rev 5IA-2, IA-5Callers are identified and authenticators are managed by the identity platform
NIST SP 800-53 Rev 5AC-6, CM-6Scoped data roles replace all-access keys; the setting is a managed configuration
ISO/IEC 27001:2022 Annex AA.5.17 Authentication information, A.8.2 Privileged access rightsShared secrets are removed and key-reading roles are reduced
MITRE ATT&CKT1552.001, T1078.004Leaked keys stop working; access depends on cloud accounts that can be monitored and governed

Common failure patterns

  • Disabling before measuring: a nightly batch job or disaster recovery runbook still holds a connection string and fails at the worst time. Watch a full cycle first.
  • Treating every service the same: Redis drops all connections and App Configuration deletes keys, so a "quick toggle" across services causes avoidable incidents.
  • Trusting the portal for Azure AI services: old keys can keep working for hours after the change. Test with a key until you get HTTP 401.
  • Deny with no exemption route: teams blocked by policy turn it off at a scope instead of requesting a dated exemption. Publish the process first.
  • One shared identity replacing one shared key: the secret is gone but attribution and least privilege are still missing.
  • Leaving key copies behind: keys in Key Vault, pipeline variables or app settings keep looking like live secrets in scans and confuse incident responders.

Practitioner checklist

  • Run a Resource Graph inventory of every resource type in the switch table, with the local authentication property projected.
  • Assign an initiative of the built-in audit definitions at management group scope.
  • Identify callers from runtime logs, metrics and listKeys events for each resource.
  • Give each workload its own managed identity or federated credential with a narrowly scoped data role.
  • Prove zero key traffic over a full business cycle before disabling.
  • Disable per environment, using maintenance windows for Redis and the Container Registry admin user.
  • Verify Azure AI services cutover with an old key returning HTTP 401.
  • Move policies to Deny, assign Modify definitions with remediation tasks, and run a dated exemption register.
  • Delete leftover keys, SAS rules and connection strings from vaults, pipelines and app settings.
  • Alert on re-enablement and listKeys on resources declared Entra-only.

Standards and references

Related NHI Mgmt Group resources: How to rotate Azure storage account keys and move to disabled Shared Key access · Azure Managed Identities Security Guide · Azure Policy and Management Groups Guide · Azure Service Bus and Event Hubs Security

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.