0

I am going through below documentation which shows various ways to authenticate Azure PostgreSQL database with Azure Entra ID

https://learn.microsoft.com/en-us/azure/postgresql/single-server/how-to-configure-sign-in-azure-ad-authentication#creating-microsoft-entra-users-in-azure-database-for-postgresql

In section named "Creating Microsoft Entra users in Azure Database for PostgreSQL" it suggest to run below command but I am getting an error that "azure_ad_user" does not exists.

CREATE USER "[email protected]" IN ROLE azure_ad_user;

Am I missing something? Is this group is supposed to be there or am I supposed to create this group?

2
  • Have you already enabled Entra admin on the DB as described here? learn.microsoft.com/en-us/azure/postgresql/single-server/…. Then have you logged in with the Entra admin using the token as described here "learn.microsoft.com/en-us/azure/postgresql/single-server/…" ? If you have followed the steps correctly, you do not need to create a separate role for azure_ad_user. It should already be there. Commented Nov 9, 2023 at 3:40
  • @AnupamChand I am using "Azure Database for PostgreSQL flexible server" and I don't see the option. Is there a different way to set this for flexible server? Commented Nov 13, 2023 at 14:09

2 Answers 2

0

You can use the code below to add Entra ID authentication to your PostgreSQL database:

CREATE USER "<EntraId>" WITH LOGIN;

enter image description here

This will add Entra ID login to the PostgreSQL database. Alternatively, you can add it via the portal by following this procedure: Go to Authentication, click on Add Microsoft Entra Admin, and select Entra ID as shown below:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

The admin account is already added.
Did you try with CREATE USER "<EntraId>" WITH LOGIN with admin account have you got any issue?
-1

I was looking for the same problem and I've found this in GitHub issue. Seems to be related, someone from Microsoft is investigating it (no solution yet as of 1st December 2023): https://github.com/MicrosoftDocs/azure-docs/issues/116898

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.