Azure Postgresql Flexi -How to add Microsoft Entra Non admin users via Portal

subhash-DBA 105 Reputation points
2024-07-26T04:23:40.0566667+00:00

HI Team

We provision the PostgreSQL flexi instance using Terraform or via Azure Portal. While adding the Microsoft Entra admins to PostgreSQL - it defaults add them with 'Create DB' , 'Create Role' and 'azure_pg_admin' roles assigned to it. Is there a way we can add MS Entra user to Postgres (from portal or Terraform) without 'Create DB' , 'Create Role' and 'azure_pg_admin' privilleges? We just need to add an Entra/AAD user with minimum privilege's (for example a monitoring user who can read the states of the database/stats).

Note: We know how to do this via Postgresql commands via - pgaadauth_create_principal

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 15,421 Reputation points
    2024-07-26T08:07:20.19+00:00

    Hi subhash-DBA •,

    Welcome to Microsoft Q&A forum.

    As I understand, you want to add Microsoft Entra Non-Admin Users via Portal.

    When you set Microsoft Entra authentication at the server level, the PGAadAuth extension is enabled and the server restarts.

    Only a Microsoft Entra administrator for PostgreSQL can initially connect to the Azure Database for PostgreSQL flexible server instance by using a Microsoft Entra account.

    The Active Directory administrator can configure subsequent Microsoft Entra database users.

    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. Database permissions for non-admin Microsoft Entra roles are managed similarly to regular roles.

    Follow to create user/role:

    https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-manage-azure-ad-users#create-a-userrole-using-microsoft-entra-principal-name

    Let us know if this helps or you have a different query.

    Thanks


1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.