azure - 对象 ID '87c92100-.....' 的客户端 '87c92100....' 无权执行操作

标签 azure azure-active-directory

Rukmini,SP 在订阅上具有贡献者角色,不确定为什么会出错,并且在将其添加为读者角色后可以正常工作吗? 这是一个快照 enter image description here

我正在尝试从 az cli(terraform 命令) 进行一些操作,但出现以下错误:

The client '87c92100-.....' with object id '87c92100....' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/f151ee3f-4725-......../resourcegroups/tfmainrg' or the scope is invalid

我到处搜索,RG、AAD、存储帐户...无法找到该对象或客户端的所在位置。你能告诉我如何找到这是什么物体吗?谢谢

最佳答案

我尝试在我的环境中重现相同的情况,但得到了如下相同的错误:

enter image description here

如果用户没有读取资源组的访问权限/角色,通常会出现“授权失败”错误。

要解决该错误,请确保为订阅级别的用户分配读者角色,如下所示:

转至 Azure 门户 -> 订阅 -> 选择订阅 -> 访问控制 (IAM) -> 添加角色分配 -> 选择读者

enter image description here

您还可以使用 az cli 通过以下命令将 Reader 角色分配给用户:

The Owner or User administrator role is required to assign any role. So, use another tenant level Owner to assign the role.

az role assignment create --assignee-object-id UserObjectID --scope subscriptions/SubscriptionID --role reader

enter image description here

读者角色已成功授予用户,如下所示:

enter image description here

分配角色后,我能够成功读取资源组:

az group show -n ResourceGroupName

enter image description here

根据您的进一步要求,您可以引用以下MsDoc分配角色:

Azure built-in roles - Azure RBAC

关于azure - 对象 ID '87c92100-.....' 的客户端 '87c92100....' 无权执行操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74775325/

相关文章:

node.js - Azure DB 断开连接和连接超时

azure - Azure 中的 App Engine 等效项

php - 使用 Microsoft Azure AD 保护应用程序

typescript - 如何使用 Azure AD 传递不记名 token ?

azure - 使用 Azure AD 进行 React-Native 身份验证

python - 无法使用 Key Vault Secret 从 Python 连接 Azure SQL 数据库

python - Azure 上带有 Windows Docker 容器的 Django Web 应用程序 : Invalid HTTP_HOST header: '10.40.0.7:30015' . 您可能需要将 '10.40.0.7' 添加到 ALLOWED_HOSTS

azure - 将我的 Breeze 应用程序部署到 Azure 网站,元数据查询失败

azure - 无法访问 onedrive

azure - 如何让启用 MSI 的 Function App 访问 Key Vault?