Azure management api in Data Factory

Viewed 151

I am trying to get response back from Azure management api in Data Factory for instance use this api (https://docs.microsoft.com/en-us/rest/api/resources/resource-groups/list) to get the resource group name in my pipeline. I am able to get the response back in Postman but not sure how to replicate it in Data Factory. I tried using the POST method by passing in the Client ID & Client Credentials like below and no luck. But, Not sure how to achieve this is Data Factory. What am I missing here.

$cmd = { .\curl.exe -X POST https://login.microsoftonline.com/common/oauth2/authorize  -F grant_type=client_credentials  -F resource=https://management.core.windows.net/ -F client_id=$client_id -F client_secret=$client_secret };
$responseToken = Invoke-Command -scriptblock $cmd;
$accessToken = (ConvertFrom-Json $responseToken).access_token;

(ConvertFrom-Json $responseToken)

ADF Snippet

Older api version

Updated api version

Thank you.

1 Answers

I am confused what is the API you are refering to ? Can you please share the Azure docs about that ? . I see that there is a subscriptionid which needs to be put forward as part of the API call .

Here is how the normal flow goes , get the bearer token ( make sure that the you pass the right SCOPE ) , once you have the a bearer token you can use that to call the azure API , bearer token should also be part of the parameter with other parameter( if any ) .

Related