如何解决Azure 逻辑应用程序,使用时解析的 JSON 返回 Null
我正在尝试访问从两 (2) 个图形 API 调用中收到的 JSON 输出中的值,但每次尝试使用它们时,我都会收到此错误:
表达评估失败。模板操作'For_each' 的执行失败:'foreach' 表达式'@body('Parse_JSON_-_Managed_Devices')?['body']?['value']' 的评估结果是'Null' 类型。结果必须是一个有效的数组。
我已验证我的图形 API 调用格式正确,并且输出正是我期望从两个 API 调用返回的内容。每次尝试访问 Azure Runbook 中解析的 JSON 或任何其他逻辑应用任务时,我都会收到此错误。
我很想知道是否有人以前遇到过这种情况以及如何解决?
图形查询: https://graph.microsoft.com/beta/deviceManagement/managedDevices/?$select=id,emailAddress&$filter=operatingSystem eq 'windows'
受管设备的 JSON 架构
{
"properties": {
"body": {
"properties": {
"@@odata.context": {
"type": "string"
},"@@odata.count": {
"type": "integer"
},"@@odata.nextLink": {
"type": "string"
},"value": {
"items": {
"properties": {
"azureADDeviceId": {
"type": "string"
},"deviceName": {
"type": "string"
},"emailAddress": {
"type": "string"
},"id": {
"type": "string"
},"managedDeviceName": {
"type": "string"
},"userDisplayName": {
"type": "string"
},"userId": {
"type": "string"
}
},"required": [
"id","userId","deviceName","userDisplayName","azureADDeviceId","managedDeviceName","emailAddress"
],"type": "object"
},"type": "array"
}
},"type": "object"
}
},"type": "object"
}
图形查询: https://graph.microsoft.com/beta/users?$select=id,officeLocation&$filter=accountEnabled eq true