是否可以在 spark 代码中获取 Azure AD 用户和组?

Is it possible to fetch Azure AAD users and groups in spark code?

我在 Azure Synapse 中有一个 pyspark 笔记本,我需要在其中获取所有 Azure AAD 组及其中的用户。有办法实现吗?

Microsoft Graph API 将使用以下端点为您提供 AAD 组和组成员的列表:

https://docs.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0&tabs=http https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http

我构建了类似的东西,但在 Synapse 中使用这些数据之前,我使用 Azure 数据工厂将组和组成员列表提取到存储帐户中。

如果您更喜欢在 spark 中实现数据摄取,您可以遵循此 link: https://towardsdatascience.com/querying-microsoft-graph-api-with-python-269118e8180c

Unfortunately, it is not possible to fetch Azure AAD users and groups in Spark Code.

注意:您可以使用 Graph APIAzure CLIAzure AD PowerShell 获取 Azure AAD 用户和组。

详情请参考Azure Active Directory - Reference section