-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Describe the bug
We changed the name of a Microsoft.Authorization/roleAssignments@2022-04-01 from name: guid(keyVaultName, roleName, identity.name, subscription().subscriptionId, env) to name: guid(kv.id, roleIdToAssign, identity.principalId) and noticed that the old role assignment is not deleted. This then results in this error:
{
"code": "RoleAssignmentExists",
"message": "The role assignment already exists."
}
To Reproduce
- Deploy a roleassignment using a deployment stack
- Change name of roleassignment
- Notice the old assignment is nog deleted and you get an error due to duplicate role assignments
Additional context
This is the part of the build that invokes bicep:
- task: AzureCLI@2
displayName: "Deploy Bicep stack template in ${{ parameters.location }}"
inputs:
connectedServiceNameARM: ${{ variables.azureSubscription }}
scriptType: "pscore"
scriptLocation: "inlineScript"
inlineScript: |
az stack sub create `
--location ${{ parameters.location }} `
--name ${{ variables.deploymentStackName }} `
--template-file ${{ variables.templateFilePath }} `
--action-on-unmanage deleteAll `
--deny-settings-mode none `
$(deploymentArguments) `
--verbose
AlexKeySmith
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo