简体   繁体   English

如何使用 Azure 数据工厂管道调用 REST API?

[英]How to call a REST API using Azure Data Factory Pipelines?

I would like to execute a REST API with oauth authentication using ADF Pipeline.我想使用 ADF 管道执行 REST API 和 oauth 身份验证。 Without oauth2, I could call any REST APIs.如果没有 oauth2,我可以调用任何 REST API。 So here my question is, does this ADF pipeline support REST APis with oauth2 authentication?所以我的问题是,这个 ADF 管道是否支持带有 oauth2 身份验证的 REST API? 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正在尝试的 API,你可以从这个 URL https://docs.microsoft.com/en-runs/rest/api/datafactory/

Thanks谢谢
Binu比努

You could call the REST API with a Web activity in the pipeline, select the Authentication with MSI in the web activity. 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.在门户中导航到您的订阅或 ADFv2 -> Access control (IAM) -> Add -> Add role assignment -> 搜索您的 ADFv2 的名称并将其添加为订阅中的Owner/Contributor参与者角色。 Then the MSI of your ADFv2 will be able to call the rest api.然后您的 ADFv2 的 MSI 将能够调用 rest api。

For exampple, my ADFv2 named joyfactory , just add the MSI with the same name as an Owner or Contributor .例如,我的 ADFv2 名为joyfactory ,只需添加与OwnerContributor同名的 MSI。

在此处输入图像描述

After adding it, check it in the Role assignments , it should be like below.添加后,在Role assignments中检查它,它应该如下所示。

在此处输入图像描述

For more details, check this similar issue .有关更多详细信息,请查看此类似问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM