如何使用 Azure 数据工厂管道调用 REST API? [英] How to call a REST API using Azure Data Factory Pipelines?

查看:35
本文介绍了如何使用 Azure 数据工厂管道调用 REST API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 ADF 管道通过 oauth 身份验证执行 REST API.如果没有 oauth2,我可以调用任何 REST API.所以我的问题是,这个 ADF 管道是否支持带有 oauth2 身份验证的 REST API?如果是.请提供解决方案

正在尝试的 API,你可以从这个 URL 找到

在门户中导航到您的订阅或 ADFv2 -> 访问控制 (IAM) -> Add -> 添加角色分配 ->搜索您的 ADFv2 的名称并将其添加为订阅中的 Owner/Contributor 角色.然后你的 ADFv2 的 MSI 就可以调用其余的 api.

例如,我的 ADFv2 名为 joyfactory,只需添加与 OwnerContributor 同名的 MSI.

添加后,在Role assignments中查看,应该是下图.

有关更多详细信息,请查看此类似问题.

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

解决方案

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.

这篇关于如何使用 Azure 数据工厂管道调用 REST API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆