An Azure managed PostgreSQL database service for app development and deployment.
pgaadauth is not something to manually allow-list and install as a normal extension on Flexible Server.
Supported ways to create Microsoft Entra-linked PostgreSQL roles are:
- Create a role by Microsoft Entra principal name:
select * from pg_catalog.pgaadauth_create_principal(roleName text, isAdmin boolean, isMfa boolean)
-
roleNamemust match the Microsoft Entra principal. -
isAdmin = truecreates an admin user. -
isAdmin = falsecreates a regular PostgreSQL user.
- Create a role by Microsoft Entra object ID:
select * from pg_catalog.pgaadauth_create_principal_with_oid(roleName text, objectId text, objectType text, isAdmin boolean, isMfa boolean)
-
objectTypemust beuser,group, orservice.
- Enable Microsoft Entra authentication for an existing PostgreSQL role by assigning the security label:
SECURITY LABEL for "pgaadauth" on role "<roleName>" is 'aadauth,oid=<objectId>,type=<objectType>,admin';
-
objectTypemust beuser,group, orservice. - Include
adminonly when the role should manage other Microsoft Entra roles.
Important supported behavior from the documentation:
- Only a Microsoft Entra administrator can initially connect by using a Microsoft Entra account.
- That administrator can then configure subsequent Microsoft Entra database users.
- For managed identity scenarios,
pgaadauth_create_principalmust be run on thepostgresdatabase. If "No function matches..." appears, connect topostgres, not another database.
Based on the documented behavior, this is not described as a regional platform restriction or a requirement to manually allow-list pgaadauth in azure.extensions. The documented model is to use the built-in pgaadauth_* functions or the SECURITY LABEL mapping, not CREATE EXTENSION pgaadauth.
For the specific function pgaadauth_create_principal(...) does not exist error, the documented check is to ensure the session is connected to the postgres database before running the function.
References: