在Microsoft Azure上过滤(搜索)API

问题描述:

我想通过传递手机号码或邮政编码来查询Microsoft Azure AD。我可以使用givenName使用startsWith()函数进行过滤,但无法使用移动/邮政编码进行搜索。在Microsoft Azure上过滤(搜索)API

我的要求是users?$filter=postalCode%20eq%20'560036'&api-version=1.6

,并得到响应:

{ 
    "odata.error": { 
    "code": "Request_UnsupportedQuery", 
    "message": { 
     "lang": "en", 
     "value": "Unsupported or invalid query filter clause specified for property 'postalCode' of resource 'User'." 
    } 
    } 
} 
+0

试图在图形浏览器也是如此,似乎是不支持的:\ – juunas

根据这个老post在微软开发人员可以添加或条款,如果您使用startsWith过滤多个字段()函数。

users?$filter=startswith(postalCode, '560036') OR startswith(mobileNumber, '123456')

当然,你仍然有编码等号,括号和空格