您如何使用Microsoft Graph查询为最近24小时内创建的数据建立查询?

时间:2020-04-08 23:20:00

标签: azure datetime graph filter active-directory

尝试仅通过查询过去24小时内创建的日期来筛选Azure AD审核事件:

例如:https://graph.microsoft.com/v1.0/auditLogs/signIns?$ dateTime,-24

我该怎么做?

2 个答案:

答案 0 :(得分:1)

我们可以从当前时间中减去24小时并将其设置为查询过滤器。例如,如果当前时间是2020-04-09T07:00:00Z,那么减去24小时的时间就是2020-04-08T07:00:00Z。然后我们可以在图形API中使用过滤器:

https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=createdDateTime ge 2020-04-08T07:00:00Z

答案 1 :(得分:0)

我试图在Azure逻辑应用程序中执行此操作,必须1)创建一个参数“ startTime” 2)为startDateTime和endDateTime创建2个变量3)然后在Graph API调用中使用它们。

Two variables HTTP GET Call