在ARM模板中设置IAM规则

时间:2018-11-14 14:10:18

标签: azure arm-template

我有一个用于部署服务总线的ARM模板。模板是在这里找到的模板:https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-resource-manager-overview

我正在尝试将特定的用户组添加为贡献者,并且不确定如何进行此操作。

谢谢

1 个答案:

答案 0 :(得分:0)

您需要阅读this文章。基本上,这是您感兴趣的代码段:

{
  "type": "Microsoft.Authorization/roleAssignments",
  "apiVersion": "2017-05-01",
  "name": "[parameters('roleNameGuid')]", << generate a guid for this value
  "properties": {
    "roleDefinitionId": "[variables(parameters('builtInRoleType'))]", << role id
    "principalId": "[parameters('principalId')]", << need to pass in group objectId
    "scope": "[variables('scope')]" << your scope
  }
}

参与者角色定义"Contributor": "[concat(subscription().Id, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]",