[Utilities] Fixing Update-NestedRoleAssignmentList.ps1 script to support 'Microsoft.Authorization/roleAssignments' module #2369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The PR resolves #2292 and fixes the script
Update-NestedRoleAssignmentList.ps1
to also update the built-in roles in the 'Microsoft.Authorization/roleAssignments' and its sub-modules.Background:
Unlike all other modules, the list of built-in roles in the module 'Microsoft.Authorization/roleAssignments' is not stored in the file
.bicep/nested_roleAssignments.bicep
, but in thedeploy.bicep
files of the child-modules. This caused that the old logic of theUpdate-NestedRoleAssignmentList.ps1
was not able to find and update the roles there.Details:
Get-RoleAssignmentList.ps1
Update-NestedRoleAssignmentList.ps1
and its functions: removing "Nested" from the name:Update-RoleAssignmentList.ps1
Update-RoleAssignmentList.ps1
to cover the special case of the module 'Microsoft.Authorization/roleAssignments'builtInRoleNamesVar
tobuiltInRoleNames
in the child modules of 'Microsoft.Authorization/roleAssignments'. This aligns the name of this variable to match all other modules, which simplifies the update process.Update-RoleAssignmentList.ps1
)Pipeline references
Type of Change
Checklist