Azure授权失败

2024-09-28 03:12:21 发布

您现在位置:Python中文网/ 问答频道 /正文

当我运行python脚本来管理azure环境上的vm时,由于AuthorizationFailed消息,它将失败。以下异常将与错误消息一起打印

云错误("对象id为“bdafca09-d426-4924-b63c-dff61c034187”的客户端“bdafca09-d426-4924-b63c-dff61c034187”无权执行操作“Microsoft.Resources/subscriptions/resourcegroups/write'over scope'/subscriptions/49ec57ce-8a6f-4cdf-95bf-8163b231edf6/resourcegroups/azure示例组虚拟机”,或者作用域无效。I如果最近已授予访问权限,请刷新您的凭据。“)


Tags: 对象脚本id消息环境subscriptions错误vm
1条回答
网友
1楼 · 发布于 2024-09-28 03:12:21

您需要为您在门户网站的Azure AD中创建的应用程序添加Contributor角色

  1. 在订阅中选择您的订阅(搜索订阅 在顶部栏中)

enter image description here

  1. 在访问控制中添加角色分配

enter image description here

  1. 选择并添加应用程序的参与者角色

enter image description here

  1. 如果添加成功,您将在角色分配列表中看到您的应用程序

enter image description here

相关问题 更多 >

    热门问题