Microsoft Entra authentication is a mechanism of connecting to Azure Database for PostgreSQL by using identities defined in Microsoft Entra ID. With Microsoft Entra authentication, you can manage database user identities and other Microsoft services in a central location, which simplifies permission management.
Benefits of using Microsoft Entra ID include:
The following high-level diagram summarizes how authentication works when you use Microsoft Entra authentication with Azure Database for PostgreSQL. The arrows indicate communication pathways.
For the steps to configure Microsoft Entra ID with Azure Database for PostgreSQL, see Configure and sign in with Microsoft Entra ID for Azure Database for PostgreSQL.
Differences between a PostgreSQL administrator and a Microsoft Entra administratorWhen you turn on Microsoft Entra authentication for your Microsoft Entra principal as a Microsoft Entra administrator, the account:
The PostgreSQL administrator can create only local password-based users. But the Microsoft Entra administrator has the authority to manage both Microsoft Entra users and local password-based users.
The Microsoft Entra administrator can be a Microsoft Entra user, Microsoft Entra group, service principal, or managed identity. Using a group account as an administrator enhances manageability. It permits the centralized addition and removal of group members in Microsoft Entra ID without changing the users or permissions within the Azure Database for PostgreSQL instance.
You can configure multiple Microsoft Entra administrators concurrently. You can deactivate password authentication to an Azure Database for PostgreSQL instance for enhanced auditing and compliance requirements.
Microsoft Entra administrators that you create via the Azure portal, an API, or SQL have the same permissions as the regular admin user that you created during server provisioning. You manage database permissions for nonadmin Microsoft Entra roles similarly to regular roles.
Connection with Microsoft Entra identitiesMicrosoft Entra authentication supports the following methods for connecting to a database by using Microsoft Entra identities:
After you authenticate against Active Directory, you retrieve a token. This token acts as your password for signing in.
To configure Microsoft Entra ID with Azure Database for PostgreSQL, follow the steps in Configure and sign in with Microsoft Entra ID for Azure Database for PostgreSQL.
Other considerationsWhen you use Microsoft Entra authentication with Azure Database for PostgreSQL, keep the following points in mind:
Note
The deleted Microsoft Entra user can still sign in until the token expires (up to 60 minutes from token issuing). If you also remove the user from Azure Database for PostgreSQL, this access is revoked immediately.
What authentication modes are available in Azure Database for PostgreSQL?
Azure Database for PostgreSQL supports three authentication modes: PostgreSQL authentication only, Microsoft Entra authentication only, and both PostgreSQL and Microsoft Entra authentication.
Can I configure multiple Microsoft Entra administrators on my server?
Yes. You can configure multiple Microsoft Entra administrators on your server. During provisioning, you can set only a single Microsoft Entra administrator. After the server is created, you can set as many Microsoft Entra administrators as you want by going to the Authentication pane.
Is a Microsoft Entra administrator just a Microsoft Entra user?
No. A Microsoft Entra administrator can be a user, group, service principal, or managed identity.
Can a Microsoft Entra administrator create local password-based users?
Yes. A Microsoft Entra administrator can manage both Microsoft Entra users and local password-based users.
What happens when I enable Microsoft Entra authentication on my server?
When you set Microsoft Entra authentication at the server level, the PGAadAuth extension is enabled and the server restarts.
How do I sign in by using Microsoft Entra authentication?
You can use client tools like psql or pgAdmin to sign in to your server. Use your Microsoft Entra user ID as the username and your Microsoft Entra token as your password.
How do I generate my token?
Use az login
to generate the token. For more information, see Retrieve the Microsoft Entra access token.
What's the difference between group authentication and individual authentication?
The only difference between signing in as a Microsoft Entra group member and signing in as an individual Microsoft Entra user lies in the username. Signing in as an individual user requires an individual Microsoft Entra user ID. Signing in as a group member requires the group name. In both scenarios, you use the same individual Microsoft Entra token as the password.
What's the token lifetime?
User tokens are valid for up to 1 hour. Tokens for system-assigned managed identities are valid for up to 24 hours.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4