From 396b75f2a48ddce6db6f6da2dda9828bee999d81 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 22:03:30 +0200 Subject: [PATCH 01/11] [Modules] Updated Resources/DeploymentScripts to new dependency approach --- .../ms.resources.deploymentscripts.yml | 3 +- .../.test/cli.parameters.json | 35 ------------ .../.test/cli/dependencies.bicep | 13 +++++ .../.test/cli/deploy.test.bicep | 55 ++++++++++++++++++ .../.test/ps.parameters.json | 38 ------------- .../.test/ps/dependencies.bicep | 13 +++++ .../.test/ps/deploy.test.bicep | 56 +++++++++++++++++++ .../deploymentScripts/readme.md | 28 +++++----- 8 files changed, 152 insertions(+), 89 deletions(-) delete mode 100644 modules/Microsoft.Resources/deploymentScripts/.test/cli.parameters.json create mode 100644 modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep create mode 100644 modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep delete mode 100644 modules/Microsoft.Resources/deploymentScripts/.test/ps.parameters.json create mode 100644 modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep create mode 100644 modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep diff --git a/.github/workflows/ms.resources.deploymentscripts.yml b/.github/workflows/ms.resources.deploymentscripts.yml index c317b860ef..815ed47236 100644 --- a/.github/workflows/ms.resources.deploymentscripts.yml +++ b/.github/workflows/ms.resources.deploymentscripts.yml @@ -106,8 +106,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.Resources/deploymentScripts/.test/cli.parameters.json b/modules/Microsoft.Resources/deploymentScripts/.test/cli.parameters.json deleted file mode 100644 index e3e775a93d..0000000000 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli.parameters.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ds-cli-001" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "kind": { - "value": "AzureCLI" - }, - "azCliVersion": { - "value": "2.15.0" - }, - "scriptContent": { - "value": "echo \"Hello from inside the script\"" - }, - "retentionInterval": { - "value": "P1D" - }, - "runOnce": { - "value": false - }, - "cleanupPreference": { - "value": "Always" - }, - "timeout": { - "value": "PT30M" - } - } -} diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep new file mode 100644 index 0000000000..9e6423c31b --- /dev/null +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep @@ -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 resource ID of the created managed identity') +output managedIdentityResourceId string = managedIdentity.id diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep new file mode 100644 index 0000000000..a24368a562 --- /dev/null +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep @@ -0,0 +1,55 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.resources.deploymentscripts-${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 = 'rdscli' + +// =========== // +// 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-<>-msi-${serviceShort}' + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + azCliVersion: '2.15.0' + cleanupPreference: 'Always' + kind: 'AzureCLI' + retentionInterval: 'P1D' + runOnce: false + scriptContent: 'echo \'Hello from inside the script\'' + timeout: 'PT30M' + userAssignedIdentities: { + '${resourceGroupResources.outputs.managedIdentityResourceId}': {} + } + } +} diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps.parameters.json b/modules/Microsoft.Resources/deploymentScripts/.test/ps.parameters.json deleted file mode 100644 index accc14b0b0..0000000000 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps.parameters.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-ds-ps-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "kind": { - "value": "AzurePowerShell" - }, - "azPowerShellVersion": { - "value": "3.0" - }, - "scriptContent": { - "value": "Write-Host 'Running PowerShell from template'" - }, - "retentionInterval": { - "value": "P1D" - }, - "runOnce": { - "value": false - }, - "cleanupPreference": { - "value": "Always" - }, - "timeout": { - "value": "PT30M" - } - } -} diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep new file mode 100644 index 0000000000..9e6423c31b --- /dev/null +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep @@ -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 resource ID of the created managed identity') +output managedIdentityResourceId string = managedIdentity.id diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep new file mode 100644 index 0000000000..3d6c4b2ee6 --- /dev/null +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/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.resources.deploymentscripts-${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 = 'rdsps' + +// =========== // +// 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-<>-msi-${serviceShort}' + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + azPowerShellVersion: '3.0' + cleanupPreference: 'Always' + kind: 'AzurePowerShell' + lock: 'CanNotDelete' + retentionInterval: 'P1D' + runOnce: false + scriptContent: 'Write-Host \'Running PowerShell from template\'' + timeout: 'PT30M' + userAssignedIdentities: { + '${resourceGroupResources.outputs.managedIdentityResourceId}': {} + } + } +} diff --git a/modules/Microsoft.Resources/deploymentScripts/readme.md b/modules/Microsoft.Resources/deploymentScripts/readme.md index 76e9181725..0aae74643b 100644 --- a/modules/Microsoft.Resources/deploymentScripts/readme.md +++ b/modules/Microsoft.Resources/deploymentScripts/readme.md @@ -157,11 +157,11 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-deploymentScripts' +module Deploymentscripts './Microsoft.Resources/Deploymentscripts/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-rdscli' params: { // Required parameters - name: '<>-az-ds-cli-001' + name: '<>rdscli001' // Non-required parameters azCliVersion: '2.15.0' cleanupPreference: 'Always' @@ -171,7 +171,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' scriptContent: 'echo \'Hello from inside the script\'' timeout: 'PT30M' userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + '': {} } } } @@ -191,7 +191,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' "parameters": { // Required parameters "name": { - "value": "<>-az-ds-cli-001" + "value": "<>rdscli001" }, // Non-required parameters "azCliVersion": { @@ -217,7 +217,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' }, "userAssignedIdentities": { "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + "": {} } } } @@ -234,11 +234,11 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' via Bicep module ```bicep -module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-deploymentScripts' +module Deploymentscripts './Microsoft.Resources/Deploymentscripts/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-rdsps' params: { // Required parameters - name: '<>-az-ds-ps-001' + name: '<>rdsps001' // Non-required parameters azPowerShellVersion: '3.0' cleanupPreference: 'Always' @@ -246,10 +246,10 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' lock: 'CanNotDelete' retentionInterval: 'P1D' runOnce: false - scriptContent: 'Write-Host 'Running PowerShell from template'' + scriptContent: 'Write-Host \'Running PowerShell from template\'' timeout: 'PT30M' userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + '': {} } } } @@ -269,7 +269,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' "parameters": { // Required parameters "name": { - "value": "<>-az-ds-ps-001" + "value": "<>rdsps001" }, // Non-required parameters "azPowerShellVersion": { @@ -291,14 +291,14 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' "value": false }, "scriptContent": { - "value": "Write-Host 'Running PowerShell from template'" + "value": "Write-Host \"Running PowerShell from template\"" }, "timeout": { "value": "PT30M" }, "userAssignedIdentities": { "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + "": {} } } } From a667e6381dab1bc7d251591118965aff625068f1 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:37:11 +0200 Subject: [PATCH 02/11] Update to latest --- modules/Microsoft.Resources/deploymentScripts/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/readme.md b/modules/Microsoft.Resources/deploymentScripts/readme.md index 6b646d77ce..1fcd6369fb 100644 --- a/modules/Microsoft.Resources/deploymentScripts/readme.md +++ b/modules/Microsoft.Resources/deploymentScripts/readme.md @@ -157,8 +157,8 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-DeploymentScripts' +module DeploymentScripts './Microsoft.Resources/DeploymentScripts/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-rdscli' params: { // Required parameters name: '<>rdscli001' @@ -234,8 +234,8 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' via Bicep module ```bicep -module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-DeploymentScripts' +module DeploymentScripts './Microsoft.Resources/DeploymentScripts/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-rdsps' params: { // Required parameters name: '<>rdsps001' From 0e51d962330b1553a07b123fac5f08cddea732ec Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:52:18 +0200 Subject: [PATCH 03/11] Update to latest --- .../deploymentScripts/.test/cli/deploy.test.bicep | 2 +- .../deploymentScripts/.test/ps/deploy.test.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep index a24368a562..5b6f0ed52a 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.resources.deploymentscripts-${serviceShort} @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 = 'rdscli' // =========== // diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep index 3d6c4b2ee6..325c1a6d71 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.resources.deploymentscripts-${serviceShort} @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 = 'rdsps' // =========== // From b7495a2332407dd37e3bd5d9c513111d4be748c2 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:05:34 +0200 Subject: [PATCH 04/11] Update to latest --- .../deploymentScripts/.test/cli/deploy.test.bicep | 6 +++--- .../deploymentScripts/.test/ps/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep index 5b6f0ed52a..dc36af442f 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/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.resources.deploymentscripts-${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 = 'rdscli' // =========== // diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep index 325c1a6d71..2698014828 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/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.resources.deploymentscripts-${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 = 'rdsps' // =========== // From 7495331c7d54869f3ff13e37a47e4b468f040ec8 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:59:55 +0200 Subject: [PATCH 05/11] Update to latest --- modules/Microsoft.Resources/deploymentScripts/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/readme.md b/modules/Microsoft.Resources/deploymentScripts/readme.md index 8ec909e883..d29cb1336b 100644 --- a/modules/Microsoft.Resources/deploymentScripts/readme.md +++ b/modules/Microsoft.Resources/deploymentScripts/readme.md @@ -158,7 +158,7 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module DeploymentScripts './Microsoft.Resources/DeploymentScripts/deploy.bicep' = { +module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-rdscli' params: { // Required parameters @@ -235,7 +235,7 @@ module DeploymentScripts './Microsoft.Resources/DeploymentScripts/deploy.bicep' via Bicep module ```bicep -module DeploymentScripts './Microsoft.Resources/DeploymentScripts/deploy.bicep' = { +module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-rdsps' params: { // Required parameters From da5ec108f9c06f495956fe7ba48741bd6913eeb8 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:40:27 +0200 Subject: [PATCH 06/11] Update modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep --- .../deploymentScripts/.test/cli/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep index dc36af442f..537b844334 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/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.resources.deploymentscripts-${serviceShort}-rg' From d1134bfecb5758699e2877acbcd7562335266065 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:40:54 +0200 Subject: [PATCH 07/11] Update modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep --- .../deploymentScripts/.test/ps/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep index 2698014828..2d7d4b5700 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/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.resources.deploymentscripts-${serviceShort}-rg' From 750cb17bdbc06ab41d795f4fcc3ab5c4ca667f7e Mon Sep 17 00:00:00 2001 From: MrMCake Date: Wed, 5 Oct 2022 21:40:14 +0200 Subject: [PATCH 08/11] Update to latest --- .../deploymentScripts/.test/cli/dependencies.bicep | 2 +- .../deploymentScripts/.test/ps/dependencies.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep index 9e6423c31b..eb82ada472 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/dependencies.bicep @@ -9,5 +9,5 @@ resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018- location: location } -@description('The resource ID of the created managed identity') +@description('The resource ID of the created managed identity.') output managedIdentityResourceId string = managedIdentity.id diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep index 9e6423c31b..eb82ada472 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/dependencies.bicep @@ -9,5 +9,5 @@ resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018- location: location } -@description('The resource ID of the created managed identity') +@description('The resource ID of the created managed identity.') output managedIdentityResourceId string = managedIdentity.id From 69e51ca7dea6acf72f864d11bec2416ed12946b0 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Thu, 13 Oct 2022 17:14:58 +0200 Subject: [PATCH 09/11] Update modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../deploymentScripts/.test/ps/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep index 2d7d4b5700..c8d78ef5c9 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep @@ -41,7 +41,7 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { name: '<>${serviceShort}001' - azPowerShellVersion: '3.0' + azPowerShellVersion: '8.0' cleanupPreference: 'Always' kind: 'AzurePowerShell' lock: 'CanNotDelete' From 391bff81d35e329560b791e7ac0272fa3ee5e2e7 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Thu, 13 Oct 2022 17:15:05 +0200 Subject: [PATCH 10/11] Update modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../deploymentScripts/.test/cli/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep index 537b844334..215eb1fa1f 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep @@ -41,7 +41,7 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { name: '<>${serviceShort}001' - azCliVersion: '2.15.0' + azCliVersion: '2.41.0' cleanupPreference: 'Always' kind: 'AzureCLI' retentionInterval: 'P1D' From 4324a1e8b11d29d69c4734567b0c83c80f74b014 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 13 Oct 2022 17:21:08 +0200 Subject: [PATCH 11/11] Several small updates --- .../.test/cli/deploy.test.bicep | 2 +- .../deploymentScripts/.test/ps/deploy.test.bicep | 2 +- .../deploymentScripts/readme.md | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep index 215eb1fa1f..5472d7d541 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/cli/deploy.test.bicep @@ -46,7 +46,7 @@ module testDeployment '../../deploy.bicep' = { kind: 'AzureCLI' retentionInterval: 'P1D' runOnce: false - scriptContent: 'echo \'Hello from inside the script\'' + scriptContent: 'echo \'echo echo echo\'' timeout: 'PT30M' userAssignedIdentities: { '${resourceGroupResources.outputs.managedIdentityResourceId}': {} diff --git a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep index c8d78ef5c9..96e4d6bb5a 100644 --- a/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep +++ b/modules/Microsoft.Resources/deploymentScripts/.test/ps/deploy.test.bicep @@ -47,7 +47,7 @@ module testDeployment '../../deploy.bicep' = { lock: 'CanNotDelete' retentionInterval: 'P1D' runOnce: false - scriptContent: 'Write-Host \'Running PowerShell from template\'' + scriptContent: 'Write-Host \'The cake is a lie!\'' timeout: 'PT30M' userAssignedIdentities: { '${resourceGroupResources.outputs.managedIdentityResourceId}': {} diff --git a/modules/Microsoft.Resources/deploymentScripts/readme.md b/modules/Microsoft.Resources/deploymentScripts/readme.md index 96d2794852..44d9d1aeb4 100644 --- a/modules/Microsoft.Resources/deploymentScripts/readme.md +++ b/modules/Microsoft.Resources/deploymentScripts/readme.md @@ -167,12 +167,12 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' // Required parameters name: '<>rdscli001' // Non-required parameters - azCliVersion: '2.15.0' + azCliVersion: '2.41.0' cleanupPreference: 'Always' kind: 'AzureCLI' retentionInterval: 'P1D' runOnce: false - scriptContent: 'echo \'Hello from inside the script\'' + scriptContent: 'echo \'echo echo echo\'' timeout: 'PT30M' userAssignedIdentities: { '': {} @@ -199,7 +199,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' }, // Non-required parameters "azCliVersion": { - "value": "2.15.0" + "value": "2.41.0" }, "cleanupPreference": { "value": "Always" @@ -214,7 +214,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' "value": false }, "scriptContent": { - "value": "echo \"Hello from inside the script\"" + "value": "echo \"echo echo echo\"" }, "timeout": { "value": "PT30M" @@ -244,13 +244,13 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' // Required parameters name: '<>rdsps001' // Non-required parameters - azPowerShellVersion: '3.0' + azPowerShellVersion: '8.0' cleanupPreference: 'Always' kind: 'AzurePowerShell' lock: 'CanNotDelete' retentionInterval: 'P1D' runOnce: false - scriptContent: 'Write-Host \'Running PowerShell from template\'' + scriptContent: 'Write-Host \'The cake is a lie!\'' timeout: 'PT30M' userAssignedIdentities: { '': {} @@ -277,7 +277,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' }, // Non-required parameters "azPowerShellVersion": { - "value": "3.0" + "value": "8.0" }, "cleanupPreference": { "value": "Always" @@ -295,7 +295,7 @@ module deploymentScripts './Microsoft.Resources/deploymentScripts/deploy.bicep' "value": false }, "scriptContent": { - "value": "Write-Host \"Running PowerShell from template\"" + "value": "Write-Host \"The cake is a lie!\"" }, "timeout": { "value": "PT30M"