admin管理员组文章数量:1122846
Im trying to assing the AD group to my storage account as contributor and also storage blob data contributor using the Servicie principal that is owner at sub level.
param storageAccountName string
param roleId array
param adGroup string
param principalType string = 'Group'
// reference to storage account
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' existing = {
name: storageAccountName
}
resource roleAssignment1 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleId in roleId: {
name: guid(subscription().subscriptionId, resourceGroup().name, storageAccountName, roleId, adGroup)
scope: storageAccount
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleId)
principalId: adGroup
principalType: principalType
}
}
]
I get this error
code":"GroupTypeNotSupported","message":"Only security-enabled groups can be used in role assignments."}
Im trying to assing the AD group to my storage account as contributor and also storage blob data contributor using the Servicie principal that is owner at sub level.
param storageAccountName string
param roleId array
param adGroup string
param principalType string = 'Group'
// reference to storage account
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' existing = {
name: storageAccountName
}
resource roleAssignment1 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleId in roleId: {
name: guid(subscription().subscriptionId, resourceGroup().name, storageAccountName, roleId, adGroup)
scope: storageAccount
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleId)
principalId: adGroup
principalType: principalType
}
}
]
I get this error
code":"GroupTypeNotSupported","message":"Only security-enabled groups can be used in role assignments."}
Share
Improve this question
edited Nov 21, 2024 at 19:18
Thomas
29.3k6 gold badges98 silver badges139 bronze badges
Recognized by Microsoft Azure Collective
asked Nov 21, 2024 at 18:34
play_something_goodplay_something_good
1311 silver badge11 bronze badges
4
|
1 Answer
Reset to default 1Only MS Entra group of Type Security
can be assigned. You can check the group type in MS Entra.
Once you've updated the group type, it should work.
Note: if you've created manually the role assignment, a random guid was assigned so when running your bicep file, it will try to create a new role assignment with a different name (guid(subscription().subscriptionId, resourceGroup().name, storageAccountName, roleId, adGroup)
. Delete the existing role assignment first and create it again using bicep.
本文标签: azureRBAC with bicepStack Overflow
版权声明:本文标题:azure - RBAC with bicep - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736308038a1933518.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
guid(subscription().subscriptionId, resourceGroup().name, storageAccountName, roleId, adGroup)
. Delete the existing role assignment first and create it again using bicep. – Thomas Commented Nov 21, 2024 at 19:11