问题
I would like to execute a REST API with oauth authentication using ADF Pipeline. Without oauth2, I could call any REST APIs. So here my question is, does this ADF pipeline support REST APis with oauth2 authentication ? if yes. Please provide a solution
The API which is am trying, you can find from this URL https://docs.microsoft.com/en-us/rest/api/datafactory/pipelineruns/querybyfactory
Thanks
Binu
回答1:
You could call the REST API with a Web activity in the pipeline, select the Authentication with MSI
in the web activity.
Navigate to your subscription or ADFv2 in the portal -> Access control (IAM)
-> Add
-> Add role assignment
-> search for the name of your ADFv2 and add it as an Owner/Contributor
role in the subscription. Then the MSI of your ADFv2 will be able to call the rest api.
For exampple, my ADFv2 named joyfactory
, just add the MSI with the same name as an Owner
or Contributor
.
After adding it, check it in the Role assignments
, it should be like below.
For more details, check this similar issue.
来源:https://stackoverflow.com/questions/58956627/how-to-call-a-rest-api-using-azure-data-factory-pipelines