通过 Web 活动从 Azure AD 获取组成员

问题描述 投票:0回答:1

我想通过 ADF 管道从 AD 安全组获取所有成员的列表

我遇到了这个API方法:https://graph.microsoft.com/v1.0/groups/{group id}/members

有人可以帮助我弄清楚如何通过 ADF 管道通过 Web 活动运行此 API。

还有运行此 API 之前我需要拥有的任何权限或访问权限。

感谢您的帮助和建议

azure azure-active-directory azure-data-factory azure-ad-graph-api
1个回答
3
投票

我尝试在我的环境中重现相同的结果,并得到如下结果:

我创建了一个 Azure AD 应用程序并授予了 API 权限,如下所示:

enter image description here

通过创建 Web 活动生成如下访问令牌:

  • 网址

    https://login.microsoftonline.com/TenantID/oauth2/v2.0/token

  • 方法:POST

  • 身体:

    grant_type=client_credentials&client_id=<client_id>&client_secret=<client_secret>&scope=https://graph.microsoft.com/.default

  • 标题:

    Content-Type:application/x-www-form-urlencoded

enter image description here

我成功生成了访问令牌,如下所示:

enter image description here

我创建了 Azure AD 安全组并添加了成员:

enter image description here

要从 Azure AD 安全组获取所有成员的列表,请使用 Web 活动 2 中的查询,如下所示:

https://graph.microsoft.com/v1.0/groups/GroupID/members

身份验证中,使用此动态内容

Bearer @{activity('Web1').output.access_token}

enter image description here

我能够成功从 Azure AD 安全组获取所有成员的列表,如下所示:

enter image description here

参考:

列出组成员 - Microsoft Graph v1.0 |微软学习

© www.soinside.com 2019 - 2024. All rights reserved.