1. Resources
  2. Detection rules
  3. Microsoft Entra Administrator Set on a Database Server

Microsoft Entra Administrator Set on a Database Server detection rules

Someone sets the Microsoft Entra administrator of an Azure SQL, PostgreSQL, MySQL or Synapse server, or removes Entra-only authentication. A control-plane role becomes full access to the data in every database of the server.

Platform
Azure
Severity
High
Log source
Azure Activity log
Last updated
MITRE ATT&CK technique
T1098Account Manipulation
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A role that can write the administrator of the database server, such as Contributor or SQL Server Contributor, and network access to the server.
Impact
Owner-level access to every database on the server for a principal the attacker controls, and password logins where Entra-only authentication was removed.
Response
Set the administrator back to the approved group, enable Microsoft Entra-only authentication again, contain the caller and review the databases.
Mitigation
Use a Microsoft Entra group under Privileged Identity Management as server administrator and enforce Microsoft Entra-only authentication with Azure Policy.
Operations
MICROSOFT.SQL/SERVERS/ADMINISTRATORS/WRITEMICROSOFT.SQL/MANAGEDINSTANCES/ADMINISTRATORS/WRITEMICROSOFT.DBFORPOSTGRESQL/FLEXIBLESERVERS/ADMINISTRATORS/WRITEMICROSOFT.DBFORMYSQL/FLEXIBLESERVERS/ADMINISTRATORS/WRITEMICROSOFT.SYNAPSE/WORKSPACES/ADMINISTRATORS/WRITEMICROSOFT.SYNAPSE/WORKSPACES/SQLADMINISTRATORS/WRITEMICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/DELETEMICROSOFT.SQL/MANAGEDINSTANCES/AZUREADONLYAUTHENTICATIONS/DELETEMICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/WRITEMICROSOFT.SQL/MANAGEDINSTANCES/AZUREADONLYAUTHENTICATIONS/WRITEMICROSOFT.SYNAPSE/WORKSPACES/AZUREADONLYAUTHENTICATIONS/WRITE

How the attack works

Azure database servers have an administrator that is assigned from the Azure side and not from inside the database. For Azure SQL, Microsoft documents that a Microsoft Entra administrator has to be set on the logical server or managed instance to enable Microsoft Entra authentication, that it can be any one security object in the tenant, a user, a group, a service principal or a managed identity, and that the administrator account is a member of the db_owner role in every user database. Azure Database for PostgreSQL states that a Microsoft Entra administrator gets the same privileges as the original PostgreSQL administrator. The assignment is an Azure Resource Manager operation, for example Microsoft.Sql/servers/administrators/write, which Microsoft describes as adding or updating the Microsoft Entra administrator object.

This lets a principal that manages the server resource, but has no rights inside the databases, give itself those rights: it names itself, or a group or application it controls, as the Microsoft Entra administrator and then connects as the owner of every database. On Azure SQL the server has one such administrator object, so the previous one is replaced. A related change is the removal of Microsoft Entra-only authentication. Microsoft documents that this setting disables SQL authentication, including for the server administrator login. With it gone, password logins are accepted again, and an update of the server can set the password of the administrator login. These changes are recorded in the Azure Activity log with their caller. Microsoft does not document that the event names the new administrator, and what is read in the databases afterwards is not in the Activity log at all. It is in the audit logs of the database, where auditing is enabled.

What an attacker needs

  • A role that can write the administrator of the server: Owner, Contributor, the contributor role of the service such as SQL Server Contributor, or a custom role with the administrators/write action of the resource provider.
  • For Microsoft Entra-only authentication on Azure SQL: Owner, Contributor or SQL Security Manager. Microsoft states that SQL Server Contributor and SQL Managed Instance Contributor cannot enable or disable it.
  • Network access to the server to connect to the databases afterwards.

Impact

Owner-level access to every database on the server for a principal the attacker controls: all data can be read and changed, and database users can be created for later use. A principal with that level inside Azure SQL can also work with the identity of the server, as described in the related research on managed identity tokens. Where SQL authentication is switched back on, the access no longer depends on any Microsoft Entra identity.

Detection rules

Microsoft Entra Administrator Set on an Azure Database Server

Detects a successful write of the Microsoft Entra administrator of an Azure SQL logical server or managed instance, an Azure Database for PostgreSQL or MySQL flexible server, or an Azure Synapse workspace. The administrator is assigned through Azure Resource Manager and has owner-level rights in the databases, so a principal that manages the server resource can give a principal it controls full access to the data. On Azure SQL the new administrator replaces the previous one. Microsoft does not document that the event names the new administrator, so read it from the server and compare it with the approved group.

LevelMediumStatusExperimentalLog sourceAzure Activity log
title: Microsoft Entra Administrator Set on an Azure Database Server
id: 8f5a74e6-fcc5-4580-aee2-922a236d51f7
status: experimental
description: >-
  Detects a successful write of the Microsoft Entra administrator of an Azure
  SQL logical server or managed instance, an Azure Database for PostgreSQL
  or MySQL flexible server, or an Azure Synapse workspace. The administrator
  is assigned through Azure Resource Manager and has owner-level rights in
  the databases, so a principal that manages the server resource can give a
  principal it controls full access to the data. On Azure SQL the new
  administrator replaces the previous one. Microsoft does not document that
  the event names the new administrator, so read it from the server and
  compare it with the approved group.
references:
  - https://attack.mitre.org/techniques/T1098/
  - https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-overview
  - https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-azure-ad-authentication
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/databases
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/analytics
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.SQL/SERVERS/ADMINISTRATORS/WRITE
      - MICROSOFT.SQL/MANAGEDINSTANCES/ADMINISTRATORS/WRITE
      - MICROSOFT.DBFORPOSTGRESQL/FLEXIBLESERVERS/ADMINISTRATORS/WRITE
      - MICROSOFT.DBFORMYSQL/FLEXIBLESERVERS/ADMINISTRATORS/WRITE
      - MICROSOFT.SYNAPSE/WORKSPACES/ADMINISTRATORS/WRITE
      - MICROSOFT.SYNAPSE/WORKSPACES/SQLADMINISTRATORS/WRITE
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - Provisioning of new servers, and infrastructure-as-code pipelines that set the administrator again on every deployment. Exclude the pipeline identity in a filter_ selection by Caller once confirmed.
  - Planned changes of the administrator group. Match each event to a request.
level: medium

False positives

  • Provisioning of new servers, and infrastructure-as-code pipelines that set the administrator again on every deployment. Exclude the pipeline identity in a filter_ selection by Caller once confirmed.
  • Planned changes of the administrator group. Match each event to a request.

Microsoft Entra-Only Authentication Setting Removed From an Azure SQL Server

Detects a successful deletion of the Microsoft Entra-only authentication object of an Azure SQL logical server or managed instance (Microsoft.Sql/servers/azureADOnlyAuthentications/delete and the managed instance equivalent). Microsoft Entra-only authentication disables SQL authentication for the server, including for the server administrator login. With the setting removed, logins with a SQL user name and password are accepted again, outside Conditional Access and multifactor authentication. Read the current setting of the server after the event.

LevelMediumStatusExperimentalLog sourceAzure Activity log
title: Microsoft Entra-Only Authentication Setting Removed From an Azure SQL Server
id: 7f20412e-d1e3-47b3-b28f-b0b24c2f18de
status: experimental
description: >-
  Detects a successful deletion of the Microsoft Entra-only authentication
  object of an Azure SQL logical server or managed instance
  (Microsoft.Sql/servers/azureADOnlyAuthentications/delete and the managed
  instance equivalent). Microsoft Entra-only authentication disables SQL
  authentication for the server, including for the server administrator
  login. With the setting removed, logins with a SQL user name and password
  are accepted again, outside Conditional Access and multifactor
  authentication. Read the current setting of the server after the event.
references:
  - https://attack.mitre.org/techniques/T1098/
  - https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-only-authentication
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/databases
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/DELETE
      - MICROSOFT.SQL/MANAGEDINSTANCES/AZUREADONLYAUTHENTICATIONS/DELETE
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - A planned return to SQL authentication for an application that cannot use Microsoft Entra ID, and migrations that need SQL logins for a time. Match each event to a request.
level: medium

False positives

  • A planned return to SQL authentication for an application that cannot use Microsoft Entra ID, and migrations that need SQL logins for a time. Match each event to a request.

Microsoft Entra-Only Authentication Setting Written on an Azure SQL Server

Detects a successful write of the Microsoft Entra-only authentication setting of an Azure SQL logical server, a managed instance or an Azure Synapse workspace (azureADOnlyAuthentications/write). The same operation enables the setting and disables it. The rule matches on the event only, because Microsoft does not document that the new value is part of the Activity log record, so its level is one step lower than the rule on the removal of the setting. The setting changes rarely on a given server, so read its current value after each event. A value of false means that SQL authentication with passwords is accepted again.

LevelLowStatusExperimentalLog sourceAzure Activity log
title: Microsoft Entra-Only Authentication Setting Written on an Azure SQL Server
id: 6cad5701-5273-4ae4-96fc-45bb5003af39
status: experimental
description: >-
  Detects a successful write of the Microsoft Entra-only authentication
  setting of an Azure SQL logical server, a managed instance or an Azure
  Synapse workspace (azureADOnlyAuthentications/write). The same operation
  enables the setting and disables it. The rule matches on the event only,
  because Microsoft does not document that the new value is part of the
  Activity log record, so its level is one step lower than the rule on the
  removal of the setting. The setting changes rarely on a given server, so
  read its current value after each event. A value of false means that SQL
  authentication with passwords is accepted again.
references:
  - https://attack.mitre.org/techniques/T1098/
  - https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-only-authentication
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/databases
  - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/analytics
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: azure
  service: activitylogs
detection:
  selection:
    OperationNameValue:
      - MICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/WRITE
      - MICROSOFT.SQL/MANAGEDINSTANCES/AZUREADONLYAUTHENTICATIONS/WRITE
      - MICROSOFT.SYNAPSE/WORKSPACES/AZUREADONLYAUTHENTICATIONS/WRITE
    ActivityStatusValue:
      - Success
      - Succeeded
  condition: selection
falsepositives:
  - Hardening work that enables Microsoft Entra-only authentication, provisioning of new servers and Azure Policy remediation. Exclude those identities in a filter_ selection by Caller once confirmed.
level: low

False positives

  • Hardening work that enables Microsoft Entra-only authentication, provisioning of new servers and Azure Policy remediation. Exclude those identities in a filter_ selection by Caller once confirmed.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Server administrator written and different from the approved administrator

Detection hypothesisCompares with an earlier valueNeeds your own lists

The write event is routine where templates set the administrator on every deployment. What separates an attack is the result: after the write, the administrator of the server is no longer the group the organization approved for it.

  1. Keep a list of the approved Microsoft Entra administrator, by object ID, for every database server.
  2. In the Azure Activity log, an administrator is written with status Success: for example MICROSOFT.SQL/SERVERS/ADMINISTRATORS/WRITE or MICROSOFT.DBFORPOSTGRESQL/FLEXIBLESERVERS/ADMINISTRATORS/WRITE. Take the server from the resource ID.
  3. Read the Microsoft Entra administrators of that server and compare their object IDs with the list. Alert on any administrator that is not approved.

EventsMICROSOFT.SQL/SERVERS/ADMINISTRATORS/WRITEMICROSOFT.SQL/MANAGEDINSTANCES/ADMINISTRATORS/WRITEMICROSOFT.DBFORPOSTGRESQL/FLEXIBLESERVERS/ADMINISTRATORS/WRITE

LimitsIt needs the list of approved administrators and read access to every server. An attacker who adds an account to the approved group instead of changing the server is not seen here and belongs to group membership monitoring. A change that is reverted before the comparison runs is seen only through the events.

Entra-only authentication removed and the server updated by the same caller shortly after

Detection hypothesisSequence of events

Removing Microsoft Entra-only authentication is only useful to somebody who then signs in with a password. An update of the server can set the password of its administrator login, so the removal followed by a server update by the same caller suggests that password access was prepared.

  1. In the Azure Activity log, the setting is removed or written with status Success: MICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/DELETE or MICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/WRITE. Keep the Caller and the server.
  2. Within 60 minutes the same Caller updates the same server: MICROSOFT.SQL/SERVERS/WRITE with status Success.
  3. Read the current Microsoft Entra-only authentication setting of the server, and review the database audit logs for logins with SQL authentication after that time.

EventsMICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/DELETEMICROSOFT.SQL/SERVERS/AZUREADONLYAUTHENTICATIONS/WRITEMICROSOFT.SQL/SERVERS/WRITE

LimitsThe server update event does not say which property changed, so a harmless update after a planned change of the setting looks the same. The 60 minutes are a starting point. An attacker who already knows a SQL login password needs no server update.

Triage

  • Identify the Caller, the caller's IP address and the server from the resource ID of the event, and whether this identity deploys or administers this server.
  • Read the current Microsoft Entra administrator of the server and compare it with the expected group. On Azure SQL a new administrator replaced the old one.
  • If the administrator is a group or an application, check who is a member or an owner of it and whether that changed recently.
  • For Microsoft Entra-only authentication, read the current setting, and look for an update of the server by the same caller around that time.
  • Review the database audit logs, if auditing is enabled, for connections by the new administrator or by the server administrator login after the change.

Response

Once the attack is confirmed:

  1. Set the Microsoft Entra administrator back to the approved group and enable Microsoft Entra-only authentication again.
  2. Contain the caller. Revoke its sessions, rotate its credentials and remove its role on the server until the change is explained.
  3. Change the password of the server administrator login if SQL authentication was available during the incident.
  4. Review the databases for what an owner could have left behind, such as new database users, role memberships and changed permissions, and remove what cannot be explained.
  5. Treat the data in the databases as read if the audit logs cannot show otherwise, and review credentials and external access configured inside the databases.

Mitigation

  • Set a Microsoft Entra group as the administrator of every server and control its membership with Privileged Identity Management, so that the administrator is changed in Microsoft Entra ID and not on the server.
  • Enable Microsoft Entra-only authentication on Azure SQL servers and managed instances, and enforce it with Azure Policy.
  • Limit Owner, Contributor and the server contributor roles on database servers, and keep the role that manages security settings separate from the role that manages the server, as Microsoft's role design intends.
  • Enable auditing on the servers and send the audit logs to your SIEM, so that connections by a new administrator can be seen.
  • Restrict network access to the servers with private endpoints and firewall rules.

Frequently asked questions

Why is the right to manage a database server enough to read its data?

The Microsoft Entra administrator is assigned through Azure Resource Manager, not from inside the database. Microsoft documents that the administrator account is a member of the db_owner role in every user database of an Azure SQL server. A principal that can write the administrator object can therefore name a principal it controls and connect with full rights.

Does the Activity log show who the new administrator is?

Microsoft does not document that the Activity log record contains the new administrator. The event gives the operation, the caller and the server. Read the administrator from the server afterwards. If you keep an inventory of the expected administrator per server, a comparison after each event tells you whether it changed.

What does removing Microsoft Entra-only authentication change?

Microsoft documents that Microsoft Entra-only authentication disables SQL authentication for the server, including connections by the server administrator login. Without the setting, SQL logins with passwords are accepted again, and those logins are not covered by Conditional Access or multifactor authentication.

Is there a public incident report for this technique?

No public incident report describes the administrator change at the audit event level as far as this page's sources go. The page is based on Microsoft's documentation of the Microsoft Entra administrator, of Microsoft Entra-only authentication and of the Resource Manager operations that change them.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.