gpt4 book ai didi

azure - 通过 Azure Rest API 查询流日志状态时授权失败

转载 作者:行者123 更新时间:2023-12-03 00:29:32 25 4
gpt4 key购买 nike

我正在尝试根据此处的文档查询 NSG 的流日志状态: https://learn.microsoft.com/en-us/azure/network-watcher/network-watcher-nsg-flow-logging-rest

但我遇到了这个异常:

{
"error": {
"code": "AuthorizationFailed",
"message": "The client '4eabxxxx-xxxx-4713-8c17-695fd78e7747' with object id '4eabxxxx-xxxx-4713-8c17-695fd78e7747' does not have authorization to perform action 'Microsoft.Network/networkWatchers/queryFlowLogStatus/action' over scope '/subscriptions/fe57c71a-xxxx-xxxx-b007-65ae3645bda1/ResourceGroups/networkwatcherrg/providers/Microsoft.Network/networkWatchers/NetworkWatcher_westcentralus'."
}
}

我的应用程序具有“READER”角色(也尝试过“MONITORING READER”角色)

我也尝试过打

POST https://management.azure.com/subscriptions/{{subscriptionId}}/providers/Microsoft.Insights/register?api-version=2016-09-01

注册了Insights.Provider(在上面的文档中提到),但仍然是同样的错误。

获取流日志状态需要什么权限?

最佳答案

What are the permissions required to get the flow logs status?

您需要网络观察器中的查询流日志状态权限。

此权限位于贡献者权限操作中。

enter image description here

解决方案:

  1. 您可以为您的应用程序分配网络贡献者角色。

  2. 您可以创建一个自定义角色,其中包含权限和其他足够的权限。然后您可以将此角色分配给您的应用程序。

关于azure - 通过 Azure Rest API 查询流日志状态时授权失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48879171/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com