How to enable Entra-only authentication on Azure SQL without locking anyone out

Microsoft Azure
Comments 0

Share to social media

Microsoft Entra-only authentication for Azure SQL Database disables SQL authentication across the whole logical server, so only Microsoft Entra ID identities can sign in.

The logical server is the Azure resource that groups databases under one name, one administrator, and one set of firewall rules. Turning the feature on takes one command, but doing it without locking out administrators and applications takes a plan.

This article walks through that plan, tested on a live server: an administrator group and emergency account, managed identities for applications, and then Defender for SQL, auditing, and a private endpoint.

Unless noted otherwise, I ran every command in this article against my own test server on October 27, 2026, using PowerShell in Azure Cloud Shell and the query editor in the Azure portal. A few client-side tests ran on my Windows workstation, and the text says so where it matters. The output is what came back, and all times are Central European Time, one hour ahead of Coordinated Universal Time.

What Entra-only authentication disables in Azure SQL

Once enabled, the feature disables SQL authentication for the entire logical server. This means SQL logins, users with SQL authentication, and the SQL server administrator lose access to every database – and you can only turn the feature on or off after a Microsoft Entra administrator has been set on the server.

Microsoft splits the two jobs on purpose, since they’re both Azure roles as opposed to roles inside SQL Server. Put simply, a SQL Server Contributor sets the administrator, and a SQL Security Manager turns the feature on or off.

Owners, Contributors, or a custom role with both sets of permissions can handle both steps at once – and turning the feature off again brings SQL logins back.

TaskAzure role needed
Set the Microsoft Entra administratorSQL Server Contributor
Turn Entra-only authentication on or offSQL Security Manager
Do bothOwner, Contributor, or a custom role with both sets of permissions

Features that don’t work with Entra-only authentication

Some features don’t work with Entra-only at all – or they do work, but with restrictions. These include Elastic Jobs, SQL Data Sync, transactional replication into the database, and EXEC AS for group members. Check that list against your environment before you start.

Microsoft’s list also names change data capture with a mix of SQL and Entra users. SQL Insights was on the list too, but Microsoft retired the service in December 2024.

Create the test server

My test used a Basic-tier database with the AdventureWorksLT sample. In West Europe, Azure rejected the new server with RequestDisallowedByAzure and a note that the region wasn’t accepting new customers.

Germany West Central, meanwhile, deployed without errors, and the resource group stayed in West Europe (important later for the private endpoint.)

Read-Host prompts for the SQL admin password so it never lands in the shell history. The server name has to be globally unique, and the firewall rule needs the public Internet Protocol (IP) address of the admin workstation:

Use a Microsoft Entra group as the Azure SQL administrator

Azure SQL stores the Entra administrator as a user in master, but a security group with two or three named database administrators (DBAs) is the better choice.

The server then still has an administrator who can sign in after one of them leaves the company.

The block below sets the group with az sql server ad-admin create and also creates sql-sales-readers-st, the reader group I use later:

In PowerShell, Set-AzSqlServerActiveDirectoryAdministrator does the same thing. The setup fails if master already contains a user with the group’s name:

Set up an emergency access account first

If you create a server with Entra-only enabled from the start, Azure generates an administrator with the prefix CloudSA and a random password, and Microsoft removes that password from the Azure management layer after deployment.

Since nobody knows that password, the account offers no emergency path.

Microsoft recommends two emergency accounts in the tenant, protected with a FIDO2 (Fast IDentity Online 2) passkey and excluded from blocking Conditional Access policies. One of them belongs in the administrator group.

To turn Entra-only off in an emergency, that account also needs an Azure role such as SQL Security Manager on the server.

Test the emergency path at least once before the switch, for example by signing in with the emergency account in SQL Server Management Studio (SSMS) and running SELECT SUSER_SNAME().

Enable Entra-only authentication with the Azure CLI or PowerShell

I turned the feature on at this point in my test because no application was using the database yet. In production, it comes last: after every application has moved over – and after you have checked your own Entra session with SELECT SUSER_SNAME(), IS_MEMBER('db_owner').

Azure SQL reads group memberships from the access token, the signed sign-in ticket that Entra ID issues to the client, and an older token doesn’t know about a group you were just added to.

The Azure command-line interface (CLI) needs version 2.14.2 or later, and az sql server ad-only-auth disable reverses the change.

Run the enable command and verify it

I switched with az sql server ad-only-auth enable. The first block below shows the PowerShell cmdlet that does the same, and the third block shows the CLI commands with their output.

Inside the database, SERVERPROPERTY('IsExternalAuthenticationOnly') returns 1 once the feature is on, and 0 while it is off:

What do SQL logins see after the switch?

From then on, every SQL login fails with error 18456 and the message “Login failed for user ‘sqladminst’. Reason: Azure Active Directory only authentication is enabled.”

At 9:07 a.m., a SqlClient script on my workstation with three wrong passwords got exactly the same message as the correct password did.

The message doesn’t tell an attacker whether a password was correct but, even if that message shows up in an application log after the switch, the application still needs to be migrated.

After a page reload, the portal’s query editor checked the setting on its own and stopped sending SQL logins to the server altogether, so test applications in SSMS or a script.

In my test, the query editor had still been connected as sqladminst before the switch, and the server rejected that session with the same message on the next query.

Enable Entra-only on new servers and enforce it with Azure Policy

For new servers, az sql server create with --enable-ad-only-auth and the --external-admin-* parameters turns the feature on from the start (az sql server).

Across a subscription, the built-in Azure Policy “Azure SQL Database should have Microsoft Entra-only authentication enabled” checks the setting.

Its default effect is Audit, and with the effect Deny it blocks new logical servers without Entra-only.

Connect applications with managed identities

A connection string with a password stops working after the switch.

Instead, the application signs in with the managed identity of its App Service, Azure Function, or virtual machine – an identity Azure manages without a stored password.

Authentication=Active Directory Default uses the managed identity in Azure, and the developer’s own sign-in is used on a workstation.

For an application that should use the managed identity and nothing else, Authentication=Active Directory Managed Identity is the stricter option.

I tested the managed identity path with a small Ubuntu virtual machine (VM) that connects through the private endpoint, described further down.

Important note for auditing: SUSER_SNAME() returned the identity’s client ID and tenant ID instead of the VM name.

Add database users with CREATE USER … FROM EXTERNAL PROVIDER

This is where migrations usually break, since the identity exists in Azure but the database doesn’t know about it yet. A role per application with permissions on its own schema keeps access tighter than db_datareader and db_datawriter.

You create the user with an Entra account that holds the ALTER ANY USER permission:

Fix error 33131 when two objects share a display name

If two objects share a display name, CREATE USER fails with error 33131. Microsoft describes WITH OBJECT_ID as a repair option for exactly that case, and advises against it for unique names.

When a user runs CREATE USER, Azure SQL queries Microsoft Graph with that user’s permissions. My test server had no server identity, and az sql server show reported identity: null.

However, Azure SQL still created the user for the reader group sql-sales-readers-st in 0.7 seconds, and in the afternoon it did the same for the managed identity of my test VM.

I didn’t create app-sales-st itself, so the block above shows the pattern, and the VM section further down shows it with a real identity. For that case, Microsoft suggests the display name plus a suffix as the user name – the first five characters of the object ID, for example, so it stays clear which identity is behind it.

Set up a server identity for automation (error 33134)

Deployment pipelines and other automation that run under a managed identity behave differently. They need a server identity with User.Read.All, GroupMember.Read.All, and Application.Read.All, or they fail with error 33134.

An application can’t act on behalf of another application, so Azure SQL falls back to the server identity, and the error text reads “Server identity is not configured.”

Instead of the three Graph permissions, a role-assignable group with the Directory Readers role works as well. The same error 33134 also appears when a Conditional Access policy blocks the lookup for a user.

Subscribe to the Simple Talk newsletter

All the latest articles, guides, podcasts, and more – delivered straight to your inbox.
Subscribe now

Grant permissions to Entra groups and plan for token delays

Permissions belong on groups. In my test, the group sql-sales-readers-st can read every table in the SalesLT schema:

In September 2026, Microsoft’s database support team described a customer case in which group users failed with error 18456 after their logins in master had been deleted. A contained user exists only in its database, while a login-based user depends on a login in master.

The query below shows which model a database uses: contained users have a 16-byte security identifier (SID), login-based users an 18-byte one. Type E stands for external users, X for external groups. Connect to each database in turn and run it there, before and after the switch.

A session of the Entra administrator runs as dbo, the database owner user, and in that session IS_MEMBER() returns 0 for groups even when the group works fine:

In my test database, the query returned a single row. The administrator group doesn’t appear in sys.database_principals of the user database at all, because Azure SQL maps it to dbo.

An administrator session, meanwhile, returned 0 for IS_MEMBER(sql-sales-readers-st), and 1 for IS_MEMBER (db_owner).

The SID check shows the reader group as a contained user with a 16-byte SID
Figure 1: The SID check shows the reader group as a contained user with a 16-byte SID.

Test nested group membership

I couldn’t find any Microsoft documentation on how nested groups behave in Azure SQL, so I put my user into an inner group, and that group into the reader group.

Remove your own user from the administrator group only while a second member, such as the emergency account, remains in it:

The session kept running as dbo even after a fresh sign-in to the query editor. The two Database Console Commands (DBCC) that clear the caches changed nothing.

Right after the change, the check query further down still returned in_db_owner = 1 and in_sales_reader = 0. Microsoft recommends DBCC FLUSHAUTHCACHE for new group members, and mentions the second command in the context of Entra logins.

Both ran without errors in my test:

The cause was the client’s access token. Signing in to the query editor again evidently reused that token, and it still carried the old group list, staying valid for a random 60 to 90 minutes.

After 66 minutes, the nesting took effect, and an UPDATE on SalesLT.Customer failed with the message “The UPDATE permission was denied.”

Revoked permissions and nested groups

A revoked permission therefore stays in effect until the token expires, and for managed identities that can take up to 24 hours. Nested memberships also hide who holds a permission, since the database only sees the outer group.

The disableNesting property, which Microsoft added to the beta version of Microsoft Graph in September 2026, keeps other groups out of a security group.

Enable Microsoft Defender for SQL per subscription

Defender for SQL bundles vulnerability assessment and Advanced Threat Protection. Microsoft recommends enabling the plan for the entire subscription so that servers created later are also covered.

Billing is per logical server. On October 27, 2026, the Azure retail price list showed $15 per server per month in West Europe and Germany West Central. Four servers cost $60.

Meanwhile, just one consolidated server costs $15 provided the firewall rules and the administrator fit every database on it – and a server with 20 databases costs the same as one with a single database.

Turn on the plan with the CLI or PowerShell

The plan for Azure SQL is called SqlServers. The current CLI returns the plans as an object with a value field, so older guides that query [] instead of value[] come back empty.

In my test subscription, SqlServers was on the Free tier beforehand, meaning the plan was switched off; Standard turns it on. In the portal, the setting sits in Defender for Cloud under “Environment settings” -> subscription -> “Defender plans”.

My test subscription listed 18 plans, with CloudPosture, Discovery, and FoundationalCspm already on Standard.

After the CREATE command, however, SqlServers showed Standard as being active since 7:20:15 a.m:

The first activation includes a 30-day free trial.

Note that Microsoft will retire the classic application programming interfaces (APIs) for vulnerability assessment and alert policies on August 16, 2027.

The AuditClassicPolicies.ps1 script finds affected servers. In a test subscription, set the plan back to Free before day 31, when billing per server starts.

AuditClassicPolicies.ps1 only reads, so it needs PowerShell 7 and Az.Accounts 2.9.1 or later. It writes a comma-separated values (CSV) file listing every server that still uses the classic configuration, but won’t write anything if nothing is found.

Approve known findings with a vulnerability assessment baseline

10 seconds after I enabled the plan, Defender turned on the ‘express configuration of vulnerability’ assessment by itself. This doesn’t require a storage account, and a baseline takes effect without a new scan.

PowerShell doesn’t support it, but the Azure CLI reaches it through az rest with API version 2026-04-01-preview. The first request for scan results returned ResultsAreNotAvailableYet, because Defender schedules the recurring scan itself and doesn’t have any results before the first one.

In the classic configuration, a baseline only takes effect after the next scan – and, according to the vulnerability assessment overview, it’s one rule at a time. Storage accounts from a classic setup stay in place after the switch and still hold the historical scan data.

Run an on-demand vulnerability scan

Running in the background, an on-demand scan took about two minutes and returned two findings across 24 rules. Wait until scans/latest returns a scan with the current start time before you read the results.

The output below is trimmed to the relevant fields:

The scan flags the new group and role as 'findings.'
Figure 2: The scan flags the new group and role as ‘findings’.

Both findings concern the group and the role I had just created. Vulnerability assessment flags every new permission until someone approves it.

While the baseline command from the documentation failed in PowerShell 7 with UnsupportedProperties, it did go through with the JavaScript Object Notation (JSON) body in a file.

The baseline took over four rules from the last scan: the two findings, plus VA1143 and VA1219 whose check queries had returned False, and which the scan had counted as passed.

The second scan only served as a check, however, because the baseline works without it when in express mode.

Figure 3: With the baseline in place, both rules keep the raw status Finding and show NonFinding in the baseline-adjusted result.
Figure 3: With the baseline in place, both rules keep the raw status Finding and show NonFinding in the baseline-adjusted result.

Only accept reviewed rules

The raw status stays Finding, so scripts should evaluate baselineAdjustedResult.

Accepting the latest scan wholesale works for a fresh database, but not servers that have grown over the years; on these, it simply turns old mistakes into the target state.

There, only reviewed rules belong in the file, with latestScan set to false.

For single rules, meanwhile, set latestScan to false and list the accepted result rows per rule under results. For my test, that would be {"VA1281": [["sales_reader", "sql-sales-readers-st"]]}.

Send Advanced Threat Protection alerts to your DBA team

Advanced Threat Protection raises alerts such as SQL.DB_BruteForce and SQL.DB_PotentialSqlInjection.

In my test, a malformed statement with O'Brien' OR '1'='1 sent from the query editor triggered nothing, and at 10:03 a.m. the subscription showed zero alerts.

SQL.DB_GeoAnomaly then reported a sign-in from an unusual location, and SQL.DB_PrincipalAnomaly reported a principal that hasn’t appeared for 60 days.

For faulty statements from an application, Microsoft lists SQL.DB_VulnerabilityToSqlInjection with medium severity. My statement failed with “Incorrect syntax near ‘Brien’. Defender didn’t react.

Protect your data. Demonstrate compliance.

With Redgate, stay ahead of threats with real-time monitoring and alerts, protect sensitive data with automated discovery & masking, and demonstrate compliance with traceability across every environment.
Learn more

Simulate alerts on Azure SQL Database

Alert simulation only covers SQL Server on virtual machines and Azure Arc-enabled servers. For Azure SQL Database, that leaves a test application with an input field, pointed at a test server.

Failed sign-in series for a brute-force test belong in SSMS or sqlcmd, because the portal query editor doesn’t send SQL logins to the server after the switch.

In my test, four attempts from the query editor never reached it.

A SQLBits 2023 session on Advanced Threat Protection uses a small C# test application for this. An input value with OR 1=1 and an appended UNION ALL returns every email address from the customer table, and Defender reports a potential SQL injection with high severity:

Set alert email recipients

By default, only subscription owners receive email, and only for high-severity alerts. Defender sends each address at most four emails a day for high severity: two for medium, and one for low.

In my test, the preview command group az security contact set the address and lowered the threshold to Medium.

(In the portal, the recipients sit in Defender for Cloud under “Environment settings” -> subscription -> “Email notifications.”)

Several recipients go into the same quoted string, separated by semicolons. In production, that should be the distribution list of the DBA team:

Send Azure SQL audit logs to Log Analytics

The default auditing policy records queries as well as successful and failed sign-ins. It writes them to the workspace through a diagnostic setting on master.

The parameters are --lats, short for --log-analytics-target-state, and --lawri, short for --log-analytics-workspace-resource-id. A guessed name such as --lat-workspace-resource-id fails with “unrecognized arguments.”

A plain -o table on the show command prints every property of the policy, so the --query in the last line trims the output to three columns:

Auditing to Log Analytics is enabled with the three default action groups.
Figure 4: Auditing to Log Analytics is enabled with the three default action groups.

Switch the log destination to Dedicated

The CLI created the diagnostic setting on master with AzureDiagnostics, the old shared table, as its destination. Queries against SQLSecurityAuditEvents then find nothing.

A second command switches the destination to Dedicated, because --export-to-resource-specific exists only when the setting is created. It reuses $srvRes from the vulnerability assessment block.

In my test, the new workspace used the PerGB2018 pricing tier with 30 days of retention, and audit-policy update took about 60 seconds.

If master has several diagnostic settings, the second line of the block below lists all names, while the first takes only the first entry:

Expect hours – not minutes – before the first records arrive

Even then, the workspace stayed empty for hours. At 10:02 a.m., two and a half hours after I enabled auditing, search * returned no records, although the diagnostic setting pointed to the workspace with the destination Dedicated. A test statement from 9:02 a.m. never arrived at all.

The first records in SQLSecurityAuditEvents date from 12:28 p.m., almost four hours after the switch to Dedicated, and from then on new events showed up within a few minutes.

The resource providers Microsoft.Insights, Microsoft.OperationalInsights, and Microsoft.Sql were registered.

In a session on Azure SQL auditing from August 2022, experienced DBA Josephine Bush expects 30 minutes to two hours before the first entries appear, so my test took about twice as long as her upper estimate. Auditing doesn’t record anything retroactively, and the data begins when the policy is switched on.

Allow several hours before the first evaluation. Before you build alert rules, run search * in the Logs view of the workspace to confirm that data is arriving. Log Analytics retains data for 30 days by default, and for up to two years at extra cost.

Audit data volume, cost and the unused SQL admin account

David Postlethwaite, a DBA at the Copenhagen-based financial services company Banking Circle, sends all diagnostic categories to one shared workspace and passes on a colleague’s warning about large data volumes and costs in a SQL Day 2025 session.

In his audit data, the never-used SQL administrator signs in four times, which he attributes to background work by Microsoft. After the switch to Entra-only, every sign-in of that account fails, so a hit for it deserves attention.

Three KQL queries for daily Azure SQL security checks

I ran the following Kusto Query Language (KQL) queries in the afternoon, once records were arriving, and checked the column names against the SQLSecurityAuditEvents table reference.

Query 1: failed sign-ins in the past 24 hours

The first counts failed sign-ins per account over the past 24 hours and collects the source IP addresses.

Microsoft states that failed Entra sign-ins don’t appear in the audit log and points to the Entra sign-in logs instead, because wrong Entra credentials never reach the database. Connections that the gateway rejects are a different case.

In my test, the query returned two failures for my Entra account: error 40615 while the firewall didn’t know my new IP address yet, and error 47073 while public access was denied.

After the switch to Entra-only, the query also catches rejected SQL logins, for example from old applications or from attacks on sqladminst.

Failed Entra credentials show up in the Entra ID sign-in logs, in the workspace as the SigninLogs table if the tenant’s diagnostic setting sends them there:

The audit log lists two rejected connections from the portal query editor, error 40615 from the firewall and error 47073 from the closed public endpoint.
Figure 5: The audit log lists two rejected connections from the portal query editor, error 40615 from the firewall and error 47073 from the closed public endpoint.

Query 2: sign-ins outside business hours

The second lists successful sign-ins outside business hours. EventTime is in Coordinated Universal Time (UTC), so the query converts it with datetime_utc_to_local(), which also handles daylight saving time.

(Replace Europe/London with your own time zone.)

In dayofweek(), 0d is Sunday and 6d is Saturday. All of my test sign-ins fell within business hours, so the query returned no rows:

Query 3: permission changes

The third finds permission changes such as ALTER ROLE ... ADD MEMBER in the logged statements. It caught the GRANT from the reader group section, which I ran again at 12:37 p.m. for this test, and the record was in the workspace less than four minutes later.

You can save each query as an alert rule in the workspace. The first one then fires when failed sign-ins cross a threshold your team defines, and BATCH_COMPLETED_GROUP records the text of every statement up to 4,000 characters.

If an existing diagnostic setting stays on AzureDiagnostics, the queries start with AzureDiagnostics | where Category == "SQLSecurityAuditEvents", and the columns carry suffixes, for example action_name_s instead of ActionName:

Add a private endpoint and deny public network access

A private endpoint gives the server an address inside a virtual network, but on its own it doesn’t block public access.

I built mine in the afternoon along the lines of Microsoft’s tutorial, with --group-ids sqlServer and a private Domain Name System (DNS) zone.

Two details differed in my subscription. Clients reach it through Azure ExpressRoute, a virtual private network (VPN), or peering, and the setting “Deny public network access” in the portal’s “Networking” blade stays off until you set it.

Create the private endpoint and private DNS zone

The resource group sits in West Europe, where I created it before Azure rejected the first server. Without -l, the endpoint inherited that region and failed with the same RequestDisallowedByAzure error as the first server.

With -l set to the region of the virtual network, however, it went through – and Azure approved the connection to the server automatically.

The private DNS zone then held an A record that pointed sql-st-joos-1027 to 10.20.1.4:

Test from a VM with a managed identity

The second detail concerns the test client. New subnets came up with defaultOutboundAccess set to false, so the VM got a subnet of its own with outbound access to download go-sqlcmd from GitHub.

go-sqlcmd is Microsoft’s newer, Go-based sqlcmd, which supports managed identity sign-in. The Ubuntu 24.04 image I used didn’t include bzip2, which the go-sqlcmd archive needs, so the script installs it first.

The VM doesn’t have a network security group (NSG) or public IP address of its own. Instead, its managed identity got a contained user in the application role from earlier:

I ran the script inside the VM with az vm run-command invoke, so the VM needs neither a public IP address nor Secure Shell (SSH) access:

The test VM resolves the server name to the private endpoint and signs in with its managed identity from 10.20.2.4.
Figure 6: The test VM resolves the server name to the private endpoint and signs in with its managed identity from 10.20.2.4.

The VM resolved the server name to the private address and signed in with its managed identity. The server saw 10.20.2.4, the VM’s address in the virtual network, as the client.

Close the public network path

The query also read all 847 rows of SalesLT.Customer – which the app_sales_rw role permits – and only then did I close the public path (Microsoft labels --enable-public-network as preview.)

In my test, PublicNetworkAccess changed to Disabled within 30 seconds, and the same sign-in from the VM still worked 30 seconds later:

Test-NetConnection on my Windows workstation still reported success, because the regional gateway, the Azure SQL entry point for all servers in the region, accepts connections on port 1433 and rejects them only at sign-in.

The portal query editor reported “An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied because Deny Public Network Access is set to Yes.”

Check name resolution from your workstation

Clients keep using the regular server name, and name resolution then tells you whether that name already points to the private address.

The output below comes from my workstation that morning, before the endpoint existed, so the name chain still ends at the public gateway.

The port test ran while public access was briefly closed. Inside the virtual network, the same name resolved to 10.20.1.4 (Figure 6).

A test connection with SQL authentication, also from my workstation, got the message “Azure Active Directory only authentication is enabled” in the same state and no hint of the network block.

Sign-ins through the private IP address or the privatelink name fail on purpose, because the gateway needs the regular server name to route the connection:

With public network access denied, the portal query editor can no longer connect.
Figure 7: With public network access denied, the portal query editor can no longer connect.

Connection policy and admin access over VPN

With a private endpoint, Microsoft recommends the Redirect connection policy, which requires ports 1433 through 65535.

My test server was set to Default, under which connections through a private endpoint run as Proxy over port 1433. I left it on Default, so the update command in the block below is untested.

Admins working from laptops need a point-to-site VPN with private name resolution before the public path closes. Over the public endpoint, Redirect needs ports 11000 to 11999 in addition, according to the connectivity architecture.

A point-to-site VPN into the hub network, a private DNS zone, and Azure DNS Private Resolver let SSMS on an admin workstation resolve the private endpoint, as a walkthrough from August 2024 shows.

Without that path, SSMS fails with error 47073 once the public path is closed:

Azure SQL lockdown checklist: the order of changes

Before the switch, an Entra group that includes an emergency account should be the server administrator, every application should have a contained user, and the SID check should show no login-based users.

The checklist (step-by-step)

  1. Set an Entra group that includes an emergency account as the server administrator.

  2. Create a contained database user for every application.

  3. Run the SID check and confirm no login-based users remain.

  4. Allow 90 minutes between revoking a permission and checking it, and 24 hours for managed identities.

  5. Enable Defender for SQL and set the alert recipients.

  6. Turn on auditing and confirm data is arriving.

  7. Test the private endpoint path.

  8. Run az sql server ad-only-auth enable, then az sql server update --enable-public-network false.

Allow 90 minutes between revoking a permission and checking it, and 24 hours for managed identities. Defender, alert recipients, auditing with data you have seen arrive, and a tested private path complete the list.

After that, ad-only-auth enable and --enable-public-network false are two short commands – and three more remove the test environment.

Clean up the test environment

The first of them sets Defender for SQL to Free for every server in the subscription, so leave it out if the subscription also holds production databases.

The security contact from the Defender section stays in place at the subscription level, so set it back if you changed it only for the test:

Azure SQL Entra-only error reference

ErrorWhat it means in this article
18456A SQL login was used after the switch (“Azure Active Directory only authentication is enabled”), so the application still needs migrating. It also appeared for group users whose logins in master had been deleted.
33131CREATE USER failed because two objects share a display name.
33134“Server identity is not configured”: automation under a managed identity needs a server identity with the Graph permissions. A Conditional Access policy blocking the lookup causes it too.
40615The firewall doesn’t know the client’s IP address yet.
47073Public network access is denied, so connect through the private path.
RequestDisallowedByAzureThe region isn’t accepting new customers. Deploy to another region.

Simple Talk is brought to you by Redgate Software

Take control of your databases with the trusted Database DevOps solutions provider. Automate with confidence, scale securely, and unlock growth through AI.
Discover how Redgate can help you

FAQs: Entra-only authentication in Azure SQL

1. What happens to SQL logins when you enable Entra-only authentication on Azure SQL?

Every SQL login stops working. Entra-only authentication disables SQL authentication for the whole logical server, so SQL logins, SQL-authenticated database users, and the SQL server administrator lose access to every database. Connection attempts fail with error 18456 and a message saying Microsoft Entra-only authentication is enabled. Turning the feature off again brings SQL logins back.

2. Can you turn Entra-only authentication off again?

Yes. Running az sql server ad-only-auth disable reverses the change and brings SQL logins back. You need an Azure role that allows it, such as SQL Security Manager on the server, and a Microsoft Entra administrator must already be set. Keep an emergency access account protected with a FIDO2 passkey so someone can always make the change.

3. How do applications connect to Azure SQL after Entra-only authentication is enabled?

Applications sign in with a managed identity instead of a password. Use Authentication=Active Directory Default to use the managed identity in Azure and the developer’s own sign-in on a workstation, or Active Directory Managed Identity for the stricter option. Then, run CREATE USER FROM EXTERNAL PROVIDER in the database and add the user to a role with only the permissions it needs.

4. How long do Entra group changes take to apply in Azure SQL?

Group membership comes from the client’s access token, so a change applies only once a new token is issued. In testing, a nested group took effect after 66 minutes, and Microsoft documents a random token lifetime of 60 to 90 minutes. A revoked permission can stay in effect for up to 24 hours for managed identities. DBCC FLUSHAUTHCACHE didn’t speed it up.

5. How much does Microsoft Defender for SQL cost for Azure SQL Database?

Defender for SQL is billed per logical server, not per database. On October 27, 2026, the Azure retail price list showed $15 per server per month in West Europe and Germany West Central. A server with 20 databases costs the same as one with a single database. The first activation includes a 30-day free trial.

This document contains proprietary information and is protected by copyright law.

Copyright © 2026 Red Gate Software Limited. All rights reserved

Article tags

About the author

Thomas Joos

See Profile

Thomas Joos has been working for more than three decades as an independent IT specialist, consultant and analyst focused on enterprise IT, cloud architectures, IT security and artificial intelligence. He has published around 100 technical books and written several thousand articles for leading IT media outlets, publishers, and portals.

Thomas's contributions

Thomas's latest contributions: