如何使用 alerts/powershell/cli 获取 Azure 活动日志摘要?

问题描述

我目前正在尝试监控订阅示例中发生的任何 RBAC 更改:John.Doe 添加了 Sue.Jones 作为 Resource Group rg-test 的读者。有没有什么可以使用powershell/cli/rest来实现我想要的。根据我的尝试和研究,事实并非如此。

查看活动日志,对于 Write RoleAssignments 操作,摘要包含我需要的所有输出,但是在使用 powershell/cli 时,您无法获得分配了什么角色或分配给谁。在摘要中,您会得到:

操作名称

编写角色分配

时间戳

周三(东部夏令时)

活动发起人:John.Doe

与“Sue.Jones分享的消息。

角色:读者

范围资源组:'rg-test'

使用 powershell/cli/alerts 获得

活动日志警报alert-iamtesting 时间 2021 年 5 月 19 日 15:29 UTC 类别 行政 操作名称 Microsoft.Authorization/roleAssignments/write

相关 ID 0000000-000000000-000000000

级别信息

资源 ID /subscriptions/0000000-000000000-000000000/resourceGroups/rg-test/providers/Microsoft.Authorization/roleAssignments/0000000-000000000-000000000

来电者 John.Doe

属性 {"statusCode":"Created","serviceRequestId":"0000000-000000000-000000000","eventCategory":"Administrative","entity":"/subscriptions/000000000000000000000000000000 -test/providers/Microsoft.Authorization/roleAssignments/00000000000000000

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)