我的服务负责人在整个资源组中扮演以下两个角色游乐场
我正在尝试运行以下命令
az login --service-principal --username="ca85199a-7e86-40eb-b6c8-a774a9edc010" --password="<pwd>" --tenant="<tenant-id>"
az cdn endpoint purge -n mopar --profile-name mopar-poc --content-paths "/*" --resource-group Playgroud --no-wait
我收到以下错误。
AuthorizationFailed: The client 'acd5dfea-f69a-4178-812c-4204963c6959' with object id 'acd5dfea-f69a-4178-812c-4204963c6959' does not have authorization to perform action 'Microsoft.Cdn/profiles/endpoints/purge/action' over scope '/subscriptions/b19669be-bfa2-4e86-b7d4-f1b4d98dd2a5/resourceGroups/Playgroud/providers/Microsoft.Cdn/profiles/mopar-poc/endpoints/mopar' or the scope is invalid. If access was recently granted, please refresh your credentials.
我在这里遗漏了什么?
答案 0 :(得分:0)
两个角色就够了,我这边命令没问题,请按照以下步骤排查。
1.在 azure 门户中仔细检查 RBAC 角色,确保正确的服务主体在正确的范围内具有正确的角色。
2.先运行 az account clear
,然后再次登录以确保您使用的是正确的服务主体。
3.确保您登录的是正确的订阅,登录后使用az account set --subscription <subscription-id>
进行设置即可。
答案 1 :(得分:0)
该错误具有误导性。
原来我在下面的命令中拼错了 Playground。
az cdn endpoint purge -n mopar --profile-name mopar-poc --content-paths "/*" --resource-group Playgroud --no-wait