azure - 使用 ansible 创建 Azure 资源组,抛出“403 客户端错误”
问题描述
现在我正在使用 ansible playbooks 在 Centos 7.0 上创建 azure 资源组,我创建了一个这样的凭证文件:
[default]
subscription_id=my_subscription_id
client_id=<the application ID>
secret=<the password>
tenant=<my aad id>
它会抛出这样的错误:
{“changed”:false,“msg”:“检查名称 ansible-rg 是否存在时出错 - 403 客户端错误:禁止 url:https://management.azure.com/subscriptions/my_subscription_id/resourcegroups/ansible-rg? api版本=2017-05-10 “}
我知道可能是因为我没有订阅许可,但我不确定我应该怎么做。
解决方案
似乎您的服务主体没有创建资源组的权限。
尝试:在门户中导航到您的订阅 -> Access control (IAM)
-> Add
-> Add role assignment
-> 将您的服务主体添加为订阅中的角色(例如所有者)。
推荐阅读
- gradle - Why is this a receiver type mismatch when it seems to match what I see in the Gradle docs?
- javascript - 如何覆盖对象获取回退
- pyspark-dataframes - Optimized way for String length validation for the Pyspark
- node.js - Firebase function always timeout on large files?
- r - svyglm function how to change the catergoircal variable in the summary
- javascript - 使跨度的输出成为输入的值
- flutter - Iterator current is null, but why?
- firebase - Merging streams together to create paginated ListView
- r - 从R中的Word文档中提取项目符号
- batch-file - 如何精确选择数字的一部分作为简单字符并在 CMD 中排除所有其余部分?