为资源 'User' 的 属性 'mobilePhone' 指定的查询过滤器子句不受支持或无效。在 Azure AD 中通过图形查询访问
Unsupported or invalid query filter clause specified for property 'mobilePhone' of resource 'User'. in Azure AD access via graph query
我正在尝试从 azure AD 基于某些 属性(移动 phone)访问用户,但出现上述错误
我什至尝试添加 ConcistencyLevel header 和 count = true 查询参数但没有成功
我的代码如下
try
{
ClientSecretCredential authProvider = new ClientSecretCredential("*******", "********", "*********");
List<Option> options = new List<Option>
{
//new QueryOption("count", "true"),
//new HeaderOption("ConsistencyLevel","eventual")
};
var graphClient = new GraphServiceClient(authProvider);
var user = await graphClient.Users.Request(options).Filter("mobilePhone eq '1111222223333'").GetAsync();
}
catch (Exception ex)
{
}
请让我知道我错过了什么
我能够通过在计数参数中添加 $ 来进行过滤
我的工作代码是
try
{
ClientSecretCredential authProvider = new ClientSecretCredential("*******", "********", "*********");
List<Option> options = new List<Option>
{
new QueryOption("$count", "true"),
new HeaderOption("ConsistencyLevel","eventual")
};
var graphClient = new GraphServiceClient(authProvider);
var user = await graphClient.Users.Request(options).Filter("mobilePhone eq '1111222223333'").GetAsync();
}
catch (Exception ex)
{
}
我正在尝试从 azure AD 基于某些 属性(移动 phone)访问用户,但出现上述错误 我什至尝试添加 ConcistencyLevel header 和 count = true 查询参数但没有成功 我的代码如下
try
{
ClientSecretCredential authProvider = new ClientSecretCredential("*******", "********", "*********");
List<Option> options = new List<Option>
{
//new QueryOption("count", "true"),
//new HeaderOption("ConsistencyLevel","eventual")
};
var graphClient = new GraphServiceClient(authProvider);
var user = await graphClient.Users.Request(options).Filter("mobilePhone eq '1111222223333'").GetAsync();
}
catch (Exception ex)
{
}
请让我知道我错过了什么
我能够通过在计数参数中添加 $ 来进行过滤
我的工作代码是
try
{
ClientSecretCredential authProvider = new ClientSecretCredential("*******", "********", "*********");
List<Option> options = new List<Option>
{
new QueryOption("$count", "true"),
new HeaderOption("ConsistencyLevel","eventual")
};
var graphClient = new GraphServiceClient(authProvider);
var user = await graphClient.Users.Request(options).Filter("mobilePhone eq '1111222223333'").GetAsync();
}
catch (Exception ex)
{
}