question

RamZ-5436 avatar image
0 Votes"
RamZ-5436 asked JamesHamil-MSFT edited

Connecting to Azure Database for PostgreSQL using Azure AD

we are trying to connect to azure postgres DB using AD & followed the instructions provided in the below documentation url https://docs.microsoft.com/en-us/azure/postgresql/howto-configure-sign-in-aad-authentication

Getting below error while connecting to postgres DB. I Manually validated the object id & tenant id of the user & tenant id of token we got using this "az account get-access-token --resource https://ossrdbms-aad.database.windows.net" command. both seems fine. still getting below error.

Azure AD access token not valid for role xxxxx@tenant.onmicrosoft.com (oid or appid claim does not match 9d8b7b0a-9139-4c86-a5f1-ed39134b8699)
HINT: Did you specify the correct user name and access token?

azure-active-directoryazure-database-postgresql
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ramz-5436. Can you share your connection string? Is it using the proper Azure AD user? Has a PostgreSQL role been created for the later and linked to the azure_ad_user role?

0 Votes 0 ·

Hi, do you still require assistance?

Thank you,
James

0 Votes 0 ·

0 Answers