使用Azure Automation Account移动订阅至管理组时遇权限错误
问题分析与解决
错误信息(翻译后)
客户端X(对象ID为X)无权在范围
/providers/Microsoft.Management/managementGroups/tenant/root/students/subscriptions/Y上执行操作Microsoft.Management/managementGroups/root/subscriptions/write
原因
你的Automation Account虽然在租户根组有Owner权限、在管理组有Contributor权限,但Contributor角色不包含移动订阅至管理组的权限,且根组的Owner权限不会自动向下继承到子管理组students(默认管理组权限是独立配置的)。移动订阅要求在**目标管理组(students)**上拥有可执行Microsoft.Management/managementGroups/subscriptions/write操作的权限,比如Owner角色。
解决步骤
- 给Automation Account对应的服务主体(对象ID X)在
tenant/root/students管理组上分配Owner角色,或者创建仅包含Microsoft.Management/managementGroups/subscriptions/write操作的自定义角色并分配给该主体 - 等待权限生效(通常5-10分钟)后重新执行移动订阅的脚本
- 检查目标管理组是否存在权限拒绝策略,确认没有阻止该服务主体执行订阅移动操作
内容的提问来源于stack exchange,提问作者user30057956
相关产品推荐
相关产品推荐

