azure - 将/groups/{id}/members 上的 $filter 查询参数与 Azure B2C 租户的 Graph API 结合使用

标签 azure microsoft-graph-api azure-ad-b2c

执行following HTTP request to the Microsoft Graph API:

GET https://graph.microsoft.com/v1.0/groups/{id}/members?$count=true&$filter=startswith(displayName, 'a')
ConsistencyLevel: eventual

向用户查询 Azure B2C 租户时会产生以下响应:

{
    "error": {
        "code":"Request_UnsupportedQuery",
        "message":"The specified filter to the reference property query is currently not supported.",
        "innerError":{
            "date":"2022-12-11T18:02:40",
            "request-id":"50ddfd29-3937-4bff-b84e-121a33149996",
            "client-request-id":"50ddfd29-3937-4bff-b84e-121a33149996"
        }
    }
}

根据this Microsoft documentation article 、 $count 查询参数以及 ConsistencyLevel header 和 $count 称为高级查询参数。根据同一篇文章,高级查询功能目前不适用于 Azure AD B2C 租户。

我的问题是如何在 Azure B2C 租户上使用 $filter 并使用 MS Graph API 对组成员执行其他查询?

我可以在/users 端点上执行相同的查询,没有任何问题,因为它不需要 ConsistencyLevel header 或 $count 查询参数。

最佳答案

我尝试在我的环境中重现相同的情况,但得到了如下相同的错误:

enter image description here

当我在 Azure AD 租户中运行相同的查询时,我成功获得了结果:

enter image description here

Note that: $count parameter is currently not available in Azure AD B2C tenants and the advance query you are trying to achieve is also not supported as Azure AD B2C doesn't support group management.

您可以通过运行以下查询来获取 Azure AD B2C 组的成员:

GET
https://graph.microsoft.com/v1.0/groups/GroupID/members?$select=displayName

enter image description here

关于azure - 将/groups/{id}/members 上的 $filter 查询参数与 Azure B2C 租户的 Graph API 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74763398/

相关文章:

microsoft-graph-api - Microsoft Graph 获取今天发生的日历条目(在时间范围内到达)

Java : Update a docx file on Sharepoint online with Graph API

Azure B2C - 在 Azure 中为不同用户类型设置多个登录的单一应用程序

c# - 将函数定义作为 CI 流程的一部分导入 API 管理

azure - azure 中的 Multi-Tenancy 网站

node.js - 下载 azure blob 流到 zip nodejs

azure - 在 Azure AD B2C 中启用电子邮件地址或电话号码作为用户标识符

azure - Azure Cosmos DB Gremlin 是否支持存储过程或自定义函数

Azure Functions/Microsoft Graph 绑定(bind)未获取 token (clientCredentials)

azure-ad-b2c - 在 Azure AD B2C 中,短信验证码的有效期是多长?