# Use Microsoft Entra ID authentication for Identity Server database connections

Starting with Identity Server 9, you can authenticate database connections using Microsoft Entra ID (formerly Azure Active Directory).

To configure Entra ID authentication, follow the instructions for your preferred authentication mode in the Microsoft documentation: [Azure Active Directory authentication with SqlClient](https://learn.microsoft.com/en-us/sql/connect/ado-net/sql/azure-active-directory-authentication?view=sql-server-ver16)

## Example: Service Principal Authentication

1. Go to `<identity-server-root>\Config\production`.
2. Open `Sitecore.IdentityServer.Host.xml`.
3. Update the database connection string by appending:

```text
Authentication=Active Directory Service Principal;User ID=<AppId>;Password=<secret-value>
```

> [!note]
> In Identity Server 9, the following modes have been tested:
> - Service principal
> - Managed identity (user-assigned and system-assigned)