How to enable Azure Active Directory Authentication for Azure Database for PostgreSQL flexible server

2024-01-02T16:06:48.44+00:00

How to enable Azure Active Directory Authentication for Azure Database for PostgreSQL flexible server?

Azure Database for PostgreSQL
0 comments No comments
{count} votes

Answer accepted by question author
  1. GeethaThatipatri-MSFT 29,587 Reputation points Microsoft Employee Moderator
    2024-01-02T21:30:54.75+00:00

    Hi @Naveen Kumar Kakarla (Quadrant Resource)

    Here is the document to configure Azure Postgres with Entra ID

    https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-configure-sign-in-azure-ad-authentication

    If you have already had Postgres created, then you can configure to switch to Entra ID by selecting Postgres and Microsoft Entra authentication under security Authentication and Save the changes.

    User's image

    Regards

    Geetha


1 additional answer

Sort by: Most helpful
  1. Rakshitha R 0 Reputation points
    2024-01-02T16:19:48.9966667+00:00
    1. Go to Azure Portal:
    2. Find Your PostgreSQL Flexible Server:
      • Locate and select the Azure Database for PostgreSQL flexible server you want to configure.
    3. Configure Authentication:
      • In the left menu, navigate to "Settings" and then click "Authentication."
        • Choose "Azure Active Directory" as the authentication method.
    4. Set Azure AD Admin:
      • Specify an Azure AD admin for the server. This admin will have superuser privileges on the PostgreSQL server.
        • You can use an existing Azure AD user or create a new one.
    5. Save Changes:
      • Save your changes to apply the Azure AD authentication settings.
    6. Restart Server (if needed):
      • Depending on the changes, you may need to restart the PostgreSQL server for the new settings to take effect.
    7. Connect Using Azure AD Credentials:
      • When connecting to the PostgreSQL server, use your Azure AD credentials for authentication. This typically involves providing the Azure AD username and password.

    Or if you prefer using the CLI

    Log in to Azure

    az login

    Set your subscription

    az account set --subscription <your-subscription-id>

    Set the admin user for Azure AD authentication

    az postgres flexible-server update --resource-group <your-resource-group> --name <your-server-name> --admin-user <azure-ad-admin-username>

    Enable Azure AD authentication

    az postgres flexible-server update --resource-group <your-resource-group> --name <your-server-name> --authentication-mode "AzureADOnly"

    Replace placeholders like <your-subscription-id>, <your-resource-group>, <your-server-name>, and <azure-ad-admin-username> with your actual details.

    0 comments No comments

Your answer

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