'Postman auth service principal to azure database

I am testing some workflow in azure on which I have some web apps api connecting to a SQL Database using a service principle. Everything works fine and the web app is able to connect to the database using Managed identity. To test this approach, I also disabled (in the server => Azure Active Directory) the access using username and password and setting the admin group to be able to connect to my server using MFA. All this works just fine.

Once implemented this, I realise that my postman is not able anymore to perform any action. And if I try to send a GET or POST request to the api, I get the error

{
    "response": {
        "code": "unauthorized",
        "reason": "User is not authenticated."
    },
    "statusCode": "unauthorized"
}

Which is fully understandable as I removed the access using username and password and enable only Azure active directory.

Here is my question, and I hope you can help me with this.

How can I grant access to postman to query my service using a service principle and what is the best approach to achieve this?

Thank you very much for your help and please if you need more info just let me know



Solution 1:[1]

The familiar approach for this problem is performing "Get Azure AD tokens by using a service principal".

  1. Performing provisioning a service principal in Azure Portal.
  2. Get AD access tokens.
  3. Use the service principal’s Azure AD access token to access the Databricks REST API

Check the below documentation for step by step procedure.

https://docs.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/aad/service-prin-aad-token#main

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SairamTadepalli-MT