-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Updated Authorization/RoleAssignments to new dependency approach #1816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexanderSehr
merged 38 commits into
main
from
users/alsehr/1791_Authorization_RoleAssignments
Oct 24, 2022
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
2805960
[Modules] Updated Authorization/RoleAssignments to new dependency app…
AlexanderSehr 2cc6133
Update to latest
AlexanderSehr a28c8e8
Merge branch 'main' into users/alsehr/1791_Authorization_RoleAssignments
AlexanderSehr 7f1a59f
Update to latest
AlexanderSehr 12fbae2
Merge branch 'main' into users/alsehr/1791_Authorization_RoleAssignments
AlexanderSehr 4ed81c0
Updated folder default to common.
AlexanderSehr 4095c21
Merge branch 'main' into users/alsehr/1791_Authorization_RoleAssignments
AlexanderSehr 609412e
Update to latest
AlexanderSehr e44c837
Update to latest
AlexanderSehr 98a1638
Merge branch 'main' into users/alsehr/1791_Authorization_RoleAssignments
AlexanderSehr 934ad89
Update to latest
AlexanderSehr 631e92b
Update to latest
AlexanderSehr 87f57e3
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/depen…
AlexanderSehr 5f47919
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/i…
AlexanderSehr 4cf4e1e
Update modules/Microsoft.Authorization/roleAssignments/.test/sub/depe…
AlexanderSehr c781b00
Update modules/Microsoft.Authorization/roleAssignments/.test/sub/depe…
AlexanderSehr b1b0e08
Update modules/Microsoft.Authorization/roleAssignments/.test/sub.min/…
AlexanderSehr 8d6c0d1
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/inter…
AlexanderSehr fb272c0
Update modules/Microsoft.Authorization/roleAssignments/.test/sub.min/…
AlexanderSehr c127527
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/inter…
AlexanderSehr 0a9f071
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/i…
AlexanderSehr 05f4505
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/d…
AlexanderSehr d034d95
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/d…
AlexanderSehr 20a3612
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/i…
AlexanderSehr 839cd85
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/i…
AlexanderSehr afb32eb
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/depen…
AlexanderSehr 1a0abd0
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/inter…
AlexanderSehr a0c06a4
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/inter…
AlexanderSehr 3db19f3
Update modules/Microsoft.Authorization/roleAssignments/.test/rg.min/d…
AlexanderSehr c0409d8
Update modules/Microsoft.Authorization/roleAssignments/.test/rg/depen…
AlexanderSehr 474192c
Update modules/Microsoft.Authorization/roleAssignments/.test/rg/depen…
AlexanderSehr 0b9696c
Update modules/Microsoft.Authorization/roleAssignments/.test/mg.min/d…
AlexanderSehr 8752598
Update modules/Microsoft.Authorization/roleAssignments/.test/mg/deplo…
AlexanderSehr 52152b3
Renamed files to patch comment
AlexanderSehr 2fc2ab2
Renamed folders
AlexanderSehr dfdf18f
Update modules/Microsoft.Authorization/roleAssignments/.test/rg.min/d…
AlexanderSehr ebde0ae
Update modules/Microsoft.Authorization/roleAssignments/.test/rg.min/d…
AlexanderSehr 66713cb
Updated nameprefix
AlexanderSehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
modules/Microsoft.Authorization/roleAssignments/.test/mg.common/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
45 changes: 45 additions & 0 deletions
45
modules/Microsoft.Authorization/roleAssignments/.test/mg.common/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| targetScope = 'managementGroup' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.authorization.roleassignments-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
| param serviceShort string = 'aramgcom' | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| module resourceGroupResources 'interim.dependencies.bicep' = { | ||
| scope: subscription('<<subscriptionId>>') | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| resourceGroupName: resourceGroupName | ||
| location: location | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../managementGroup/deploy.bicep' = { | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| principalId: resourceGroupResources.outputs.managedIdentityPrincipalId | ||
| roleDefinitionIdOrName: 'Backup Reader' | ||
| description: 'Role Assignment (management group scope)' | ||
| managementGroupId: last(split(managementGroup().id, '/')) | ||
| principalType: 'ServicePrincipal' | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
modules/Microsoft.Authorization/roleAssignments/.test/mg.common/interim.dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Required. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: managedIdentityName | ||
| } | ||
| } | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = resourceGroupResources.outputs.managedIdentityPrincipalId | ||
12 changes: 0 additions & 12 deletions
12
modules/Microsoft.Authorization/roleAssignments/.test/mg.min.parameters.json
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
modules/Microsoft.Authorization/roleAssignments/.test/mg.min/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
42 changes: 42 additions & 0 deletions
42
modules/Microsoft.Authorization/roleAssignments/.test/mg.min/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| targetScope = 'managementGroup' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.authorization.roleassignments-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
| param serviceShort string = 'aramgmin' | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| module resourceGroupResources 'interim.dependencies.bicep' = { | ||
| scope: subscription('<<subscriptionId>>') | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| resourceGroupName: resourceGroupName | ||
| location: location | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../managementGroup/deploy.bicep' = { | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| principalId: resourceGroupResources.outputs.managedIdentityPrincipalId | ||
| roleDefinitionIdOrName: 'Storage Queue Data Reader' | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
modules/Microsoft.Authorization/roleAssignments/.test/mg.min/interim.dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Required. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string | ||
|
|
||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: managedIdentityName | ||
| } | ||
| } | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = resourceGroupResources.outputs.managedIdentityPrincipalId |
21 changes: 0 additions & 21 deletions
21
modules/Microsoft.Authorization/roleAssignments/.test/mg.parameters.json
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
modules/Microsoft.Authorization/roleAssignments/.test/rg.common/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
50 changes: 50 additions & 0 deletions
50
modules/Microsoft.Authorization/roleAssignments/.test/rg.common/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.authorization.roleassignments-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
| param serviceShort string = 'arargcom' | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../resourceGroup/deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| principalId: resourceGroupResources.outputs.managedIdentityPrincipalId | ||
| roleDefinitionIdOrName: 'Backup Reader' | ||
| description: 'Role Assignment (resource group scope)' | ||
| principalType: 'ServicePrincipal' | ||
| resourceGroupName: resourceGroup.name | ||
| subscriptionId: subscription().subscriptionId | ||
| } | ||
| } |
18 changes: 0 additions & 18 deletions
18
modules/Microsoft.Authorization/roleAssignments/.test/rg.min.parameters.json
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
modules/Microsoft.Authorization/roleAssignments/.test/rg.min/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| @description('Required. The name of the Managed Identity to create.') | ||
| param managedIdentityName string | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { | ||
| name: managedIdentityName | ||
| location: location | ||
| } | ||
|
|
||
| @description('The principal ID of the created Managed Identity.') | ||
| output managedIdentityPrincipalId string = managedIdentity.properties.principalId |
48 changes: 48 additions & 0 deletions
48
modules/Microsoft.Authorization/roleAssignments/.test/rg.min/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.authorization.roleassignments-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
| param serviceShort string = 'arargmin' | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| managedIdentityName: 'dep-<<namePrefix>>-msi-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../resourceGroup/deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| principalId: resourceGroupResources.outputs.managedIdentityPrincipalId | ||
| roleDefinitionIdOrName: 'Storage Queue Data Reader' | ||
| resourceGroupName: resourceGroup.name | ||
| subscriptionId: subscription().subscriptionId | ||
| } | ||
| } |
24 changes: 0 additions & 24 deletions
24
modules/Microsoft.Authorization/roleAssignments/.test/rg.parameters.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.