From 580c70fc16ede0330da41c609d9017b33cffb5ee Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 21:21:07 +0200 Subject: [PATCH 01/10] [Modules] Updated Authorization/RoleDefinitions to new dependency approach --- .../ms.authorization.roledefinitions.yml | 3 +- .../.test/mg.min.parameters.json | 15 -- .../.test/mg.min/deploy.test.bicep | 22 ++ .../roleDefinitions/.test/mg.parameters.json | 43 ---- .../.test/mg/deploy.test.bicep | 31 +++ .../.test/rg.min.parameters.json | 21 -- .../.test/rg.min/deploy.test.bicep | 41 ++++ .../roleDefinitions/.test/rg.parameters.json | 46 ---- .../.test/rg/deploy.test.bicep | 56 +++++ .../.test/sub.min.parameters.json | 18 -- .../.test/sub.min/deploy.test.bicep | 23 ++ .../roleDefinitions/.test/sub.parameters.json | 43 ---- .../.test/sub/deploy.test.bicep | 37 ++++ .../roleDefinitions/readme.md | 208 +++++++----------- utilities/tools/Set-ModuleReadMe.ps1 | 6 +- 15 files changed, 298 insertions(+), 315 deletions(-) delete mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/mg.min.parameters.json create mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep delete mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/mg.parameters.json create mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep delete mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/rg.min.parameters.json create mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep delete mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/rg.parameters.json create mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep delete mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/sub.min.parameters.json create mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep delete mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/sub.parameters.json create mode 100644 modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep diff --git a/.github/workflows/ms.authorization.roledefinitions.yml b/.github/workflows/ms.authorization.roledefinitions.yml index d4f169b1fb..957107deb5 100644 --- a/.github/workflows/ms.authorization.roledefinitions.yml +++ b/.github/workflows/ms.authorization.roledefinitions.yml @@ -109,8 +109,7 @@ jobs: - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' uses: ./.github/actions/templates/validateModuleDeployment with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' location: '${{ env.location }}' resourceGroupName: '${{ env.resourceGroupName }}' subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min.parameters.json b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min.parameters.json deleted file mode 100644 index c4a88ba9e8..0000000000 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min.parameters.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-mg-min" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/read", - "Microsoft.Compute/galleries/images/read" - ] - } - } -} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep new file mode 100644 index 0000000000..a4c5effdf3 --- /dev/null +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep @@ -0,0 +1,22 @@ +targetScope = 'managementGroup' + +// ========== // +// Parameters // +// ========== // +@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 = 'ardmgmin' + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../managementGroup/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + roleName: '<>-testRole-${serviceShort}' + actions: [ + 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' + ] + } +} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.parameters.json b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.parameters.json deleted file mode 100644 index d49ce1cae3..0000000000 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.parameters.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-mg" - }, - "description": { - "value": "Test Custom Role Definition Standard (management group scope)" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/*", - "Microsoft.Network/virtualNetworks/read" - ] - }, - "notActions": { - "value": [ - "Microsoft.Compute/images/write", - "Microsoft.Compute/images/delete", - "Microsoft.Network/virtualNetworks/subnets/join/action" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" - ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] - }, - "assignableScopes": { - "value": [ - "/providers/Microsoft.Management/managementGroups/<>" - ] - }, - "managementGroupId": { - "value": "<>" - } - } -} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep new file mode 100644 index 0000000000..ecc59bd033 --- /dev/null +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep @@ -0,0 +1,31 @@ +targetScope = 'managementGroup' + +// ========== // +// Parameters // +// ========== // +@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 = 'ardmg' + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../managementGroup/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + roleName: '<>-testRole-${serviceShort}' + actions: [ + 'Microsoft.Compute/galleries/*' + 'Microsoft.Network/virtualNetworks/read' + ] + assignableScopes: [ + managementGroup().id + ] + description: 'Test Custom Role Definition Standard (management group scope)' + notActions: [ + 'Microsoft.Compute/images/delete' + 'Microsoft.Compute/images/write' + 'Microsoft.Network/virtualNetworks/subnets/join/action' + ] + } +} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min.parameters.json b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min.parameters.json deleted file mode 100644 index cf6825cc02..0000000000 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min.parameters.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-rg-min" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/read", - "Microsoft.Compute/galleries/images/read" - ] - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } - } -} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep new file mode 100644 index 0000000000..e1bf4e52e2 --- /dev/null +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep @@ -0,0 +1,41 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.authorization.roledefinitions-${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 = 'ardrgmin' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../resourceGroup/deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + roleName: '<>-testRole-${serviceShort}' + actions: [ + 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' + ] + } +} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.parameters.json b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.parameters.json deleted file mode 100644 index c27ff2f862..0000000000 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.parameters.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-rg" - }, - "description": { - "value": "Test Custom Role Definition Standard (resource group scope)" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/*", - "Microsoft.Network/virtualNetworks/read" - ] - }, - "notActions": { - "value": [ - "Microsoft.Compute/images/write", - "Microsoft.Compute/images/delete", - "Microsoft.Network/virtualNetworks/subnets/join/action" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" - ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] - }, - "assignableScopes": { - "value": [ - "/subscriptions/<>/resourceGroups/<>" - ] - }, - "subscriptionId": { - "value": "<>" - }, - "resourceGroupName": { - "value": "<>" - } - } -} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep new file mode 100644 index 0000000000..afb6fa4831 --- /dev/null +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep @@ -0,0 +1,56 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.authorization.roledefinitions-${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 = 'ardrg' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../resourceGroup/deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + roleName: '<>-testRole-${serviceShort}' + actions: [ + 'Microsoft.Compute/galleries/*' + 'Microsoft.Network/virtualNetworks/read' + ] + assignableScopes: [ + resourceGroup.id + ] + dataActions: [ + 'Microsoft.Storage/storageAccounts/blobServices/*/read' + ] + description: 'Test Custom Role Definition Standard (resource group scope)' + notActions: [ + 'Microsoft.Compute/images/delete' + 'Microsoft.Compute/images/write' + 'Microsoft.Network/virtualNetworks/subnets/join/action' + ] + notDataActions: [ + 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' + ] + } +} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min.parameters.json b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min.parameters.json deleted file mode 100644 index 87bbbc20b7..0000000000 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min.parameters.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-sub-min" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/read", - "Microsoft.Compute/galleries/images/read" - ] - }, - "subscriptionId": { - "value": "<>" - } - } -} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep new file mode 100644 index 0000000000..51b5a4583c --- /dev/null +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep @@ -0,0 +1,23 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@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 = 'ardsubmin' + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../subscription/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + roleName: '<>-testRole-${serviceShort}' + actions: [ + 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' + ] + subscriptionId: subscription().subscriptionId + } +} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.parameters.json b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.parameters.json deleted file mode 100644 index 62e03ca98d..0000000000 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.parameters.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "roleName": { - "value": "<>-az-testRole-sub" - }, - "description": { - "value": "Test Custom Role Definition Standard (subscription scope)" - }, - "actions": { - "value": [ - "Microsoft.Compute/galleries/*", - "Microsoft.Network/virtualNetworks/read" - ] - }, - "notActions": { - "value": [ - "Microsoft.Compute/images/write", - "Microsoft.Compute/images/delete", - "Microsoft.Network/virtualNetworks/subnets/join/action" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" - ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] - }, - "assignableScopes": { - "value": [ - "/subscriptions/<>" - ] - }, - "subscriptionId": { - "value": "<>" - } - } -} diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep new file mode 100644 index 0000000000..945d0ca743 --- /dev/null +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@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 = 'ardsub' + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../subscription/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + roleName: '<>-testRole-${serviceShort}' + actions: [ + 'Microsoft.Compute/galleries/*' + 'Microsoft.Network/virtualNetworks/read' + ] + assignableScopes: [ + subscription().id + ] + dataActions: [ + 'Microsoft.Storage/storageAccounts/blobServices/*/read' + ] + description: 'Test Custom Role Definition Standard (subscription scope)' + notActions: [ + 'Microsoft.Compute/images/delete' + 'Microsoft.Compute/images/write' + 'Microsoft.Network/virtualNetworks/subnets/join/action' + ] + notDataActions: [ + 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' + ] + } +} diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index 331c5db066..42a9cbc5d2 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -180,90 +180,32 @@ The following module usage examples are retrieved from the content of the files >**Note**: The name of each example is based on the name of the file from which it is taken. >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Mg Min

+

Example 1: Mg

via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-roleDefinitions' +module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardmg' params: { // Required parameters - roleName: '<>-az-testRole-mg-min' - // Non-required parameters - actions: [ - 'Microsoft.Compute/galleries/images/read' - 'Microsoft.Compute/galleries/read' - ] - } -} -``` - -
-

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - // Required parameters - "roleName": { - "value": "<>-az-testRole-mg-min" - }, - // Non-required parameters - "actions": { - "value": [ - "Microsoft.Compute/galleries/images/read", - "Microsoft.Compute/galleries/read" - ] - } - } -} -``` - -
-

- -

Example 2: Mg

- -
- -via Bicep module - -```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-roleDefinitions' - params: { - // Required parameters - roleName: '<>-az-testRole-mg' + roleName: '<>-testRole-ardmg' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' 'Microsoft.Network/virtualNetworks/read' ] assignableScopes: [ - '/providers/Microsoft.Management/managementGroups/<>' - ] - dataActions: [ - 'Microsoft.Storage/storageAccounts/blobServices/*/read' + '' ] description: 'Test Custom Role Definition Standard (management group scope)' - managementGroupId: '<>' notActions: [ 'Microsoft.Compute/images/delete' 'Microsoft.Compute/images/write' 'Microsoft.Network/virtualNetworks/subnets/join/action' ] - notDataActions: [ - 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' - ] } } ``` @@ -282,7 +224,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-az-testRole-mg" + "value": "<>-testRole-ardmg" }, // Non-required parameters "actions": { @@ -293,31 +235,18 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' }, "assignableScopes": { "value": [ - "/providers/Microsoft.Management/managementGroups/<>" - ] - }, - "dataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/*/read" + "" ] }, "description": { "value": "Test Custom Role Definition Standard (management group scope)" }, - "managementGroupId": { - "value": "<>" - }, "notActions": { "value": [ "Microsoft.Compute/images/delete", "Microsoft.Compute/images/write", "Microsoft.Network/virtualNetworks/subnets/join/action" ] - }, - "notDataActions": { - "value": [ - "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" - ] } } } @@ -326,25 +255,23 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 3: Rg Min

+

Example 2: Mg.Min

via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-roleDefinitions' +module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardmgmin' params: { // Required parameters - roleName: '<>-az-testRole-rg-min' + roleName: '<>-testRole-ardmgmin' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/images/read' 'Microsoft.Compute/galleries/read' ] - resourceGroupName: '<>' - subscriptionId: '<>' } } ``` @@ -363,7 +290,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-az-testRole-rg-min" + "value": "<>-testRole-ardmgmin" }, // Non-required parameters "actions": { @@ -371,12 +298,6 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "Microsoft.Compute/galleries/images/read", "Microsoft.Compute/galleries/read" ] - }, - "resourceGroupName": { - "value": "<>" - }, - "subscriptionId": { - "value": "<>" } } } @@ -385,25 +306,25 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 4: Rg

+

Example 3: Rg

via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-roleDefinitions' +module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardrg' params: { // Required parameters - roleName: '<>-az-testRole-rg' + roleName: '<>-testRole-ardrg' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' 'Microsoft.Network/virtualNetworks/read' ] assignableScopes: [ - '/subscriptions/<>/resourceGroups/<>' + '' ] dataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/*/read' @@ -417,8 +338,6 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' notDataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' ] - resourceGroupName: '<>' - subscriptionId: '<>' } } ``` @@ -437,7 +356,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-az-testRole-rg" + "value": "<>-testRole-ardrg" }, // Non-required parameters "actions": { @@ -448,7 +367,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' }, "assignableScopes": { "value": [ - "/subscriptions/<>/resourceGroups/<>" + "" ] }, "dataActions": { @@ -470,12 +389,6 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "value": [ "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" ] - }, - "resourceGroupName": { - "value": "<>" - }, - "subscriptionId": { - "value": "<>" } } } @@ -484,24 +397,23 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 5: Sub Min

+

Example 4: Rg.Min

via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-roleDefinitions' +module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardrgmin' params: { // Required parameters - roleName: '<>-az-testRole-sub-min' + roleName: '<>-testRole-ardrgmin' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/images/read' 'Microsoft.Compute/galleries/read' ] - subscriptionId: '<>' } } ``` @@ -520,7 +432,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-az-testRole-sub-min" + "value": "<>-testRole-ardrgmin" }, // Non-required parameters "actions": { @@ -528,9 +440,6 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "Microsoft.Compute/galleries/images/read", "Microsoft.Compute/galleries/read" ] - }, - "subscriptionId": { - "value": "<>" } } } @@ -539,25 +448,25 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 6: Sub

+

Example 5: Sub

via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-roleDefinitions' +module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardsub' params: { // Required parameters - roleName: '<>-az-testRole-sub' + roleName: '<>-testRole-ardsub' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' 'Microsoft.Network/virtualNetworks/read' ] assignableScopes: [ - '/subscriptions/<>' + '' ] dataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/*/read' @@ -571,7 +480,6 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' notDataActions: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' ] - subscriptionId: '<>' } } ``` @@ -590,7 +498,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-az-testRole-sub" + "value": "<>-testRole-ardsub" }, // Non-required parameters "actions": { @@ -601,7 +509,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' }, "assignableScopes": { "value": [ - "/subscriptions/<>" + "" ] }, "dataActions": { @@ -623,9 +531,61 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "value": [ "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read" ] + } + } +} +``` + +
+

+ +

Example 6: Sub.Min

+ +
+ +via Bicep module + +```bicep +module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardsubmin' + params: { + // Required parameters + roleName: '<>-testRole-ardsubmin' + // Non-required parameters + actions: [ + 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/read' + ] + subscriptionId: '' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "roleName": { + "value": "<>-testRole-ardsubmin" + }, + // Non-required parameters + "actions": { + "value": [ + "Microsoft.Compute/galleries/images/read", + "Microsoft.Compute/galleries/read" + ] }, "subscriptionId": { - "value": "<>" + "value": "" } } } diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index a1074fed21..6b922d65e8 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -883,9 +883,10 @@ function Set-DeploymentExamplesSection { '' ) + $TextInfo = (Get-Culture -Name 'en-US').TextInfo $moduleRoot = Split-Path $TemplateFilePath -Parent - $resourceTypeIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - $resourceType = $resourceTypeIdentifier.Split('/')[1] + $resourceTypeIdentifier = $TextInfo.ToTitleCase($moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/')) + $resourceType = $TextInfo.ToTitleCase($resourceTypeIdentifier.Split('/')[1]) $testFilePaths = Get-ModuleTestFileList -ModulePath $moduleRoot | ForEach-Object { Join-Path $moduleRoot $_ } $RequiredParametersList = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object @@ -906,7 +907,6 @@ function Set-DeploymentExamplesSection { } else { $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' } - $TextInfo = (Get-Culture -Name 'en-US').TextInfo $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) $SectionContent += @( '

Example {0}: {1}

' -f $pathIndex, $exampleTitle From ee0c57d6268ea080ed2177eea16ae63e43d0ce83 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 10:14:46 +0200 Subject: [PATCH 02/10] Update to latest --- .../roleDefinitions/readme.md | 12 +++++----- utilities/tools/Set-ModuleReadMe.ps1 | 23 ++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index 42a9cbc5d2..f0a1929023 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -187,7 +187,7 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardmg' params: { // Required parameters @@ -262,7 +262,7 @@ module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' via Bicep module ```bicep -module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardmgmin' params: { // Required parameters @@ -313,7 +313,7 @@ module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' via Bicep module ```bicep -module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardrg' params: { // Required parameters @@ -404,7 +404,7 @@ module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' via Bicep module ```bicep -module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardrgmin' params: { // Required parameters @@ -455,7 +455,7 @@ module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' via Bicep module ```bicep -module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardsub' params: { // Required parameters @@ -546,7 +546,7 @@ module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' via Bicep module ```bicep -module Roledefinitions './Microsoft.Authorization/Roledefinitions/deploy.bicep' = { +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardsubmin' params: { // Required parameters diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index 6b922d65e8..25d22f3fff 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -51,7 +51,7 @@ function Set-ResourceTypesSection { $RelevantResourceTypeObjects = Get-NestedResourceList $TemplateFileContent | Where-Object { $_.type -notin $ResourceTypesToExclude -and $_ - } | Select-Object 'Type', 'ApiVersion' -Unique | Sort-Object Type -Culture en-US + } | Select-Object 'Type', 'ApiVersion' -Unique | Sort-Object Type -Culture 'en-US' foreach ($resourceTypeObject in $RelevantResourceTypeObjects) { $ProviderNamespace, $ResourceType = $resourceTypeObject.Type -split '/', 2 @@ -280,7 +280,7 @@ function Set-OutputsSection { '| Output Name | Type | Description |', '| :-- | :-- | :-- |' ) - foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture en-US)) { + foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture 'en-US')) { $output = $TemplateFileContent.outputs[$outputName] $description = $output.metadata.description.Replace("`r`n", '

').Replace("`n", '

') $SectionContent += ("| ``{0}`` | {1} | {2} |" -f $outputName, $output.type, $description) @@ -290,7 +290,7 @@ function Set-OutputsSection { '| Output Name | Type |', '| :-- | :-- |' ) - foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture en-US)) { + foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture 'en-US')) { $output = $TemplateFileContent.outputs[$outputName] $SectionContent += ("| ``{0}`` | {1} |" -f $outputName, $output.type) } @@ -883,10 +883,16 @@ function Set-DeploymentExamplesSection { '' ) - $TextInfo = (Get-Culture -Name 'en-US').TextInfo $moduleRoot = Split-Path $TemplateFilePath -Parent - $resourceTypeIdentifier = $TextInfo.ToTitleCase($moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/')) - $resourceType = $TextInfo.ToTitleCase($resourceTypeIdentifier.Split('/')[1]) + $fullIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') + + # Get resource type and make first letter upper case. Requires manual handling as ToTitleCase lowercases everything but the first letter + $providerNamespace = ($fullIdentifier.Split('/')[0] -split '\.' | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }) -join '.' + $resourceType = $fullIdentifier.Split('/')[1] + $resourceTypeUpper = $resourceType.Substring(0, 1).ToUpper() + $resourceType.Substring(1) + + $resourceTypeIdentifier = "$providerNamespace/$resourceType" + $testFilePaths = Get-ModuleTestFileList -ModulePath $moduleRoot | ForEach-Object { Join-Path $moduleRoot $_ } $RequiredParametersList = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object @@ -907,7 +913,8 @@ function Set-DeploymentExamplesSection { } else { $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' } - $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) + $textInfo = (Get-Culture -Name 'en-US').TextInfo + $exampleTitle = $textInfo.ToTitleCase($exampleTitle) $SectionContent += @( '

Example {0}: {1}

' -f $pathIndex, $exampleTitle ) @@ -1138,7 +1145,7 @@ function Set-DeploymentExamplesSection { '```bicep', $extendedKeyVaultReferences, "module $resourceType './$resourceTypeIdentifier/deploy.bicep' = {" - " name: '`${uniqueString(deployment().name)}-$resourceType'" + " name: '`${uniqueString(deployment().name)}-$resourceTypeUpper'" ' params: {' $bicepExample.TrimEnd(), ' }' From 59f259d6113eda9cc5eb640c815f3cc769246161 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:31:32 +0200 Subject: [PATCH 03/10] Update to latest --- .../roleDefinitions/readme.md | 73 +++---------------- 1 file changed, 11 insertions(+), 62 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index a284e1e586..f0a1929023 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -187,62 +187,11 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-RoleDefinitions' - params: { - // Required parameters - roleName: '<>-az-testRole-mg-min' - // Non-required parameters - actions: [ - 'Microsoft.Compute/galleries/images/read' - 'Microsoft.Compute/galleries/read' - ] - } -} -``` - -
-

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - // Required parameters - "roleName": { - "value": "<>-az-testRole-mg-min" - }, - // Non-required parameters - "actions": { - "value": [ - "Microsoft.Compute/galleries/images/read", - "Microsoft.Compute/galleries/read" - ] - } - } -} -``` - -
-

- -

Example 2: Mg

- -
- -via Bicep module - -```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-RoleDefinitions' +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardmg' params: { // Required parameters - roleName: '<>-az-testRole-mg' + roleName: '<>-testRole-ardmg' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' @@ -313,8 +262,8 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-RoleDefinitions' +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardmgmin' params: { // Required parameters roleName: '<>-testRole-ardmgmin' @@ -364,8 +313,8 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-RoleDefinitions' +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardrg' params: { // Required parameters roleName: '<>-testRole-ardrg' @@ -455,8 +404,8 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-RoleDefinitions' +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardrgmin' params: { // Required parameters roleName: '<>-testRole-ardrgmin' @@ -506,8 +455,8 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' via Bicep module ```bicep -module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-RoleDefinitions' +module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-ardsub' params: { // Required parameters roleName: '<>-testRole-ardsub' From ce7552a88820fb3f571a0bde0b4eb42806e568a5 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 8 Sep 2022 18:50:04 +0200 Subject: [PATCH 04/10] Updated folder default to common. --- .../roleDefinitions/readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index f0a1929023..c604fac317 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -187,7 +187,7 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { +module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardmg' params: { // Required parameters @@ -262,7 +262,7 @@ module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' via Bicep module ```bicep -module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { +module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardmgmin' params: { // Required parameters @@ -313,7 +313,7 @@ module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' via Bicep module ```bicep -module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { +module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardrg' params: { // Required parameters @@ -404,7 +404,7 @@ module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' via Bicep module ```bicep -module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { +module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardrgmin' params: { // Required parameters @@ -455,7 +455,7 @@ module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' via Bicep module ```bicep -module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { +module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardsub' params: { // Required parameters @@ -546,7 +546,7 @@ module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' via Bicep module ```bicep -module RoleDefinitions './Microsoft.Authorization/RoleDefinitions/deploy.bicep' = { +module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-ardsubmin' params: { // Required parameters From df329d3aa6ab8e1795f6b5fdf7783b5a8216d29f Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:49:31 +0200 Subject: [PATCH 05/10] Update to latest --- .../roleDefinitions/.test/mg.min/deploy.test.bicep | 2 +- .../roleDefinitions/.test/mg/deploy.test.bicep | 2 +- .../roleDefinitions/.test/rg.min/deploy.test.bicep | 2 +- .../roleDefinitions/.test/rg/deploy.test.bicep | 2 +- .../roleDefinitions/.test/sub.min/deploy.test.bicep | 2 +- .../roleDefinitions/.test/sub/deploy.test.bicep | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep index a4c5effdf3..6c05cfadc1 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'managementGroup' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@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 = 'ardmgmin' // ============== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep index ecc59bd033..7e0a5a0684 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'managementGroup' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@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 = 'ardmg' // ============== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep index e1bf4e52e2..d6339134c7 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShor @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') +@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 = 'ardrgmin' // =========== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep index afb6fa4831..4fb36749ad 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShor @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') +@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 = 'ardrg' // =========== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep index 51b5a4583c..31b2dd17c3 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@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 = 'ardsubmin' // ============== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep index 945d0ca743..bb3c64242e 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@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 = 'ardsub' // ============== // From b9565cbf5aaaebb001c23e78d4ce2c7f452d6bbf Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:02:25 +0200 Subject: [PATCH 06/10] Update to latest --- .../roleDefinitions/.test/mg.min/deploy.test.bicep | 2 +- .../roleDefinitions/.test/mg/deploy.test.bicep | 2 +- .../roleDefinitions/.test/rg.min/deploy.test.bicep | 6 +++--- .../roleDefinitions/.test/rg/deploy.test.bicep | 6 +++--- .../roleDefinitions/.test/sub.min/deploy.test.bicep | 2 +- .../roleDefinitions/.test/sub/deploy.test.bicep | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep index 6c05cfadc1..ae775efdd0 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'managementGroup' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@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 = 'ardmgmin' // ============== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep index 7e0a5a0684..6b498a9368 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'managementGroup' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@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 = 'ardmg' // ============== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep index d6339134c7..2b8685486a 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@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') +@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 = 'ardrgmin' // =========== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep index 4fb36749ad..4dd277113b 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@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') +@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 = 'ardrg' // =========== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep index 31b2dd17c3..a07bf12786 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@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 = 'ardsubmin' // ============== // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep index bb3c64242e..601fb5304b 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@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 = 'ardsub' // ============== // From 988c4137e72b1be6bc3774231e14f3a8b5bc40bd Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sun, 18 Sep 2022 23:14:49 +0200 Subject: [PATCH 07/10] Update to latest --- .../roleDefinitions/.test/rg.min/deploy.test.bicep | 2 +- .../roleDefinitions/.test/rg/deploy.test.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep index 2b8685486a..905c662c79 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShort}-rg' diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep index 4dd277113b..20c9cfbe61 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShort}-rg' From 6442f796fadd1f6b69566694b1c94fe01c57f429 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 22 Oct 2022 13:10:19 +0200 Subject: [PATCH 08/10] Rnamed folders --- .../.test/{mg => mg.common}/deploy.test.bicep | 0 .../.test/{rg => rg.common}/deploy.test.bicep | 0 .../.test/{sub => sub.common}/deploy.test.bicep | 0 modules/Microsoft.Authorization/roleDefinitions/readme.md | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename modules/Microsoft.Authorization/roleDefinitions/.test/{mg => mg.common}/deploy.test.bicep (100%) rename modules/Microsoft.Authorization/roleDefinitions/.test/{rg => rg.common}/deploy.test.bicep (100%) rename modules/Microsoft.Authorization/roleDefinitions/.test/{sub => sub.common}/deploy.test.bicep (100%) diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.Authorization/roleDefinitions/.test/mg/deploy.test.bicep rename to modules/Microsoft.Authorization/roleDefinitions/.test/mg.common/deploy.test.bicep diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.Authorization/roleDefinitions/.test/rg/deploy.test.bicep rename to modules/Microsoft.Authorization/roleDefinitions/.test/rg.common/deploy.test.bicep diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.Authorization/roleDefinitions/.test/sub/deploy.test.bicep rename to modules/Microsoft.Authorization/roleDefinitions/.test/sub.common/deploy.test.bicep diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index 29f3977ee0..b10c5b47f9 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -181,7 +181,7 @@ The following module usage examples are retrieved from the content of the files >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Mg

+

Example 1: Mg.Common

@@ -307,7 +307,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 3: Rg

+

Example 3: Rg.Common

@@ -449,7 +449,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep'

-

Example 5: Sub

+

Example 5: Sub.Common

From da04595a8079e670fa453392cb1f9d9499d000d3 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 24 Oct 2022 08:56:48 +0200 Subject: [PATCH 09/10] Update to latest --- .../roleDefinitions/.test/mg.common/deploy.test.bicep | 2 +- .../roleDefinitions/.test/rg.common/deploy.test.bicep | 2 +- .../roleDefinitions/.test/sub.common/deploy.test.bicep | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.common/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.common/deploy.test.bicep index 6b498a9368..2803a12203 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/mg.common/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/mg.common/deploy.test.bicep @@ -4,7 +4,7 @@ targetScope = 'managementGroup' // Parameters // // ========== // @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 = 'ardmg' +param serviceShort string = 'ardmgcom' // ============== // // Test Execution // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.common/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.common/deploy.test.bicep index 20c9cfbe61..e4004b87fe 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/rg.common/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/rg.common/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.authorization.roledefinitions-${serviceShor 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 = 'ardrg' +param serviceShort string = 'ardrgcom' // =========== // // Deployments // diff --git a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.common/deploy.test.bicep b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.common/deploy.test.bicep index 601fb5304b..e9bb5500fb 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/.test/sub.common/deploy.test.bicep +++ b/modules/Microsoft.Authorization/roleDefinitions/.test/sub.common/deploy.test.bicep @@ -4,7 +4,7 @@ targetScope = 'subscription' // Parameters // // ========== // @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 = 'ardsub' +param serviceShort string = 'ardsubcom' // ============== // // Test Execution // From 08b38532141e156c2c79188a167ade16f0901fc2 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 24 Oct 2022 08:57:33 +0200 Subject: [PATCH 10/10] Update to latest --- .../roleDefinitions/readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/Microsoft.Authorization/roleDefinitions/readme.md b/modules/Microsoft.Authorization/roleDefinitions/readme.md index b10c5b47f9..bc1f4fde5d 100644 --- a/modules/Microsoft.Authorization/roleDefinitions/readme.md +++ b/modules/Microsoft.Authorization/roleDefinitions/readme.md @@ -189,10 +189,10 @@ The following module usage examples are retrieved from the content of the files ```bicep module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-ardmg' + name: '${uniqueString(deployment().name)}-test-ardmgcom' params: { // Required parameters - roleName: '<>-testRole-ardmg' + roleName: '<>-testRole-ardmgcom' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' @@ -225,7 +225,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-testRole-ardmg" + "value": "<>-testRole-ardmgcom" }, // Non-required parameters "actions": { @@ -315,10 +315,10 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' ```bicep module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-ardrg' + name: '${uniqueString(deployment().name)}-test-ardrgcom' params: { // Required parameters - roleName: '<>-testRole-ardrg' + roleName: '<>-testRole-ardrgcom' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' @@ -357,7 +357,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-testRole-ardrg" + "value": "<>-testRole-ardrgcom" }, // Non-required parameters "actions": { @@ -457,10 +457,10 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' ```bicep module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-ardsub' + name: '${uniqueString(deployment().name)}-test-ardsubcom' params: { // Required parameters - roleName: '<>-testRole-ardsub' + roleName: '<>-testRole-ardsubcom' // Non-required parameters actions: [ 'Microsoft.Compute/galleries/*' @@ -499,7 +499,7 @@ module roleDefinitions './Microsoft.Authorization/roleDefinitions/deploy.bicep' "parameters": { // Required parameters "roleName": { - "value": "<>-testRole-ardsub" + "value": "<>-testRole-ardsubcom" }, // Non-required parameters "actions": {