Search code examples
azurepostmanazure-data-factory

Azure Data Factory API call details in POSTMAN


I am trying to use the WEB Activity from ADF to call an API. We used Postman to test this API that returns an AUTH TOKEN but I'm not sure how can I replicate the written Authorizations in ADF Web Activity.

enter image description here

I believe this is the same as the what is shown in ADF here. I'm not sure what is the corresponding Authentication I need to use here as the same as in Postman.

enter image description here

and as for the body it is formatted as x-wwww-form-urlencoded

enter image description here

If I'm going to convert this to JSON or type where I can put this in ADF Web activity Body field, is it the same as this?

{
     "client_id": "1234",
     "client_secret": "abcd123",
     "grant_type": "client_credentials"

}

Solution

  • As you have Client ID and Client Secret, you can generate the access token in ADF web activity like below.

    Give the URL like this:

    https://login.microsoftonline.com/<tenant-id>/oauth2/token
    

    Pass the body like this:

    grant_type=client_credentials&client_id=<your-client-id>&client_secret=<your-client-secret>
    

    Set the Authentication to None and start the web activity.

    enter image description here

    You can see that I am able to generate the access token.

    enter image description here

    You can use this access token later to get the data from your API.