Please provide documentation on how to set a Service Principal as an AD Administrator

Abhay Gupta 71 Reputation points
2021-07-05T12:57:01.887+00:00

Hi

Please provide the steps/documentation on how to set service principal as the Azure AD admin for the postgresql server. I am trying to do all this through terraform. Once the service principal is AAD i want to run few create role commands on the postgresql.

Also can service principal be directly set as AAD admin without any user/group?

Azure Database for PostgreSQL
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,699 questions
0 comments No comments
{count} votes

Accepted answer
  1. KalyanChanumolu-MSFT 8,331 Reputation points
    2021-07-06T06:12:14.177+00:00

    @Abhay Gupta Thank you for reaching out.

    Yes, you can set a Service Principal as AAD admin using Azure CLI.

    az postgres server ad-admin create --server-name SERVERNAME -g RESOURCEGROUP --display-name YourServicePrincipalDisplayName --object-id YourServicePrincipalObjectID   
    

    More info the CLI commands is here

    However, for authentication using the SPN, you will need to add it to an AD Group and set the group as AD Admin.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.
    And if you have further questions or issues, please let us know.


0 additional answers

Sort by: Most helpful

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.