From 5ab7da3a4e3f771db63cc72660e59d010b3db155 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 21:30:18 +0200 Subject: [PATCH 1/9] [Modules] Updated Compute/AvailabilitySets to new dependency approach --- .../workflows/ms.compute.availabilitysets.yml | 3 +- .../.test/default/dependencies.bicep | 27 +++++++ .../.test/default/deploy.test.bicep | 56 +++++++++++++ .../.test/min.parameters.json | 9 --- .../.test/min/deploy.test.bicep | 37 +++++++++ .../availabilitySets/.test/parameters.json | 25 ------ .../availabilitySets/readme.md | 80 +++++++++---------- utilities/tools/Set-ModuleReadMe.ps1 | 6 +- 8 files changed, 164 insertions(+), 79 deletions(-) create mode 100644 modules/Microsoft.Compute/availabilitySets/.test/default/dependencies.bicep create mode 100644 modules/Microsoft.Compute/availabilitySets/.test/default/deploy.test.bicep delete mode 100644 modules/Microsoft.Compute/availabilitySets/.test/min.parameters.json create mode 100644 modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.Compute/availabilitySets/.test/parameters.json diff --git a/.github/workflows/ms.compute.availabilitysets.yml b/.github/workflows/ms.compute.availabilitysets.yml index 95c38275e8..3e2241399c 100644 --- a/.github/workflows/ms.compute.availabilitysets.yml +++ b/.github/workflows/ms.compute.availabilitysets.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.Compute/availabilitySets/.test/default/dependencies.bicep b/modules/Microsoft.Compute/availabilitySets/.test/default/dependencies.bicep new file mode 100644 index 0000000000..e3a353b1a4 --- /dev/null +++ b/modules/Microsoft.Compute/availabilitySets/.test/default/dependencies.bicep @@ -0,0 +1,27 @@ +@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 + +@description('Required. The name of the Proximity Placement Group to create.') +param proximityPlacementGroupName string + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +resource proximityPlacementGroup 'Microsoft.Compute/proximityPlacementGroups@2022-03-01' = { + name: proximityPlacementGroupName + location: location +} + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + +@description('The resource ID of the created Managed Identity.') +output managedIdentityResourceId string = managedIdentity.id + +@description('The resource ID of the created Proximity Placement Group.') +output proximityPlacementGroupResourceId string = proximityPlacementGroup.id diff --git a/modules/Microsoft.Compute/availabilitySets/.test/default/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/default/deploy.test.bicep new file mode 100644 index 0000000000..1ce25928c8 --- /dev/null +++ b/modules/Microsoft.Compute/availabilitySets/.test/default/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.compute.availabilitysets-${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 = 'casdef' + +// =========== // +// 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}' + proximityPlacementGroupName: 'dep-<>-ppg-${serviceShort}' + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + lock: 'CanNotDelete' + proximityPlacementGroupId: resourceGroupResources.outputs.proximityPlacementGroupResourceId + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + } +} diff --git a/modules/Microsoft.Compute/availabilitySets/.test/min.parameters.json b/modules/Microsoft.Compute/availabilitySets/.test/min.parameters.json deleted file mode 100644 index 99d2414f76..0000000000 --- a/modules/Microsoft.Compute/availabilitySets/.test/min.parameters.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avs-min-001" - } - } -} diff --git a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..30e1c3cf5f --- /dev/null +++ b/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.compute.availabilitysets-${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 = 'casmin' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + } +} diff --git a/modules/Microsoft.Compute/availabilitySets/.test/parameters.json b/modules/Microsoft.Compute/availabilitySets/.test/parameters.json deleted file mode 100644 index f7d8be50c6..0000000000 --- a/modules/Microsoft.Compute/availabilitySets/.test/parameters.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-avs-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "proximityPlacementGroupId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001" - } - } -} diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 741a76e420..4d79ee62d9 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -158,17 +158,29 @@ 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: Min

+

Example 1: Default

via Bicep module ```bicep -module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-availabilitySets' +module Availabilitysets './Microsoft.Compute/Availabilitysets/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-casdef' params: { - name: '<>-az-avs-min-001' + // Required parameters + name: '<>casdef001' + // Non-required parameters + lock: 'CanNotDelete' + proximityPlacementGroupId: '' + roleAssignments: [ + { + principalIds: [ + '' + ] + roleDefinitionIdOrName: 'Reader' + } + ] } } ``` @@ -185,8 +197,26 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { + // Required parameters "name": { - "value": "<>-az-avs-min-001" + "value": "<>casdef001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "proximityPlacementGroupId": { + "value": "" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "" + ], + "roleDefinitionIdOrName": "Reader" + } + ] } } } @@ -195,29 +225,17 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = {

-

Example 2: Parameters

+

Example 2: Min

via Bicep module ```bicep -module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-availabilitySets' +module Availabilitysets './Microsoft.Compute/Availabilitysets/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-casmin' params: { - // Required parameters - name: '<>-az-avs-x-001' - // Non-required parameters - lock: 'CanNotDelete' - proximityPlacementGroupId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001' - roleAssignments: [ - { - principalIds: [ - '<>' - ] - roleDefinitionIdOrName: 'Reader' - } - ] + name: '<>casmin001' } } ``` @@ -234,26 +252,8 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { - // Required parameters "name": { - "value": "<>-az-avs-x-001" - }, - // Non-required parameters - "lock": { - "value": "CanNotDelete" - }, - "proximityPlacementGroupId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Compute/proximityPlacementGroups/adp-<>-az-ppg-x-001" - }, - "roleAssignments": { - "value": [ - { - "principalIds": [ - "<>" - ], - "roleDefinitionIdOrName": "Reader" - } - ] + "value": "<>casmin001" } } } 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 eb08d63eac9b2260e7604012e6f5fc3997f80dad Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 10:16:21 +0200 Subject: [PATCH 2/9] Update to latest --- .../availabilitySets/readme.md | 4 ++-- utilities/tools/Set-ModuleReadMe.ps1 | 23 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 4d79ee62d9..65d807115b 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -165,7 +165,7 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module Availabilitysets './Microsoft.Compute/Availabilitysets/deploy.bicep' = { +module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-casdef' params: { // Required parameters @@ -232,7 +232,7 @@ module Availabilitysets './Microsoft.Compute/Availabilitysets/deploy.bicep' = { via Bicep module ```bicep -module Availabilitysets './Microsoft.Compute/Availabilitysets/deploy.bicep' = { +module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-casmin' params: { name: '<>casmin001' 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 8fb17d576324d1e786eab2584885dfa079aa267e Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:33:14 +0200 Subject: [PATCH 3/9] Update to latest --- modules/Microsoft.Compute/availabilitySets/readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 04b99bc230..65d807115b 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -165,8 +165,8 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-AvailabilitySets' +module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-casdef' params: { // Required parameters name: '<>casdef001' @@ -232,8 +232,8 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { via Bicep module ```bicep -module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-AvailabilitySets' +module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-casmin' params: { name: '<>casmin001' } From 340a24af7e88fcc0ebf64e8fba5fdbdc1308a565 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 8 Sep 2022 18:58:10 +0200 Subject: [PATCH 4/9] Updated folder default to common. --- .../.test/{default => common}/dependencies.bicep | 0 .../.test/{default => common}/deploy.test.bicep | 0 modules/Microsoft.Compute/availabilitySets/readme.md | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename modules/Microsoft.Compute/availabilitySets/.test/{default => common}/dependencies.bicep (100%) rename modules/Microsoft.Compute/availabilitySets/.test/{default => common}/deploy.test.bicep (100%) diff --git a/modules/Microsoft.Compute/availabilitySets/.test/default/dependencies.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/dependencies.bicep similarity index 100% rename from modules/Microsoft.Compute/availabilitySets/.test/default/dependencies.bicep rename to modules/Microsoft.Compute/availabilitySets/.test/common/dependencies.bicep diff --git a/modules/Microsoft.Compute/availabilitySets/.test/default/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.Compute/availabilitySets/.test/default/deploy.test.bicep rename to modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 65d807115b..a7239aaff3 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -158,14 +158,14 @@ 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: Default

+

Example 1: Common

via Bicep module ```bicep -module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { +module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-casdef' params: { // Required parameters @@ -232,7 +232,7 @@ module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { via Bicep module ```bicep -module AvailabilitySets './Microsoft.Compute/AvailabilitySets/deploy.bicep' = { +module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-casmin' params: { name: '<>casmin001' From 8393e5d083b2cb47c3258cdbd3b258e629e3a5b5 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:50:03 +0200 Subject: [PATCH 5/9] Update to latest --- .../availabilitySets/.test/common/deploy.test.bicep | 4 ++-- .../availabilitySets/.test/min/deploy.test.bicep | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep index 1ce25928c8..e7a4ff4e6c 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep @@ -10,8 +10,8 @@ param resourceGroupName string = 'ms.compute.availabilitysets-${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 = 'casdef' +@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 = 'cascom' // =========== // // Deployments // diff --git a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep index 30e1c3cf5f..af2616bf1d 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.compute.availabilitysets-${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') +@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 = 'casmin' // =========== // From c51e8501ea1b1b1bf576bde934c338a9dee83a31 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:02:59 +0200 Subject: [PATCH 6/9] Update to latest --- .../availabilitySets/.test/common/deploy.test.bicep | 6 +++--- .../availabilitySets/.test/min/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep index e7a4ff4e6c..ac019374f2 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/common/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.compute.availabilitysets-${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 = 'cascom' // =========== // diff --git a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep index af2616bf1d..ee6ff93be3 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/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.compute.availabilitysets-${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 = 'casmin' // =========== // From 3df57cc16345e8eed5386e4d00803dd37c06bc71 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:26:38 +0200 Subject: [PATCH 7/9] Update to latest --- modules/Microsoft.Compute/availabilitySets/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 08ca177c94..1fba5f5889 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -167,10 +167,10 @@ The following module usage examples are retrieved from the content of the files ```bicep module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-casdef' + name: '${uniqueString(deployment().name)}-test-cascom' params: { // Required parameters - name: '<>casdef001' + name: '<>cascom001' // Non-required parameters lock: 'CanNotDelete' proximityPlacementGroupId: '' @@ -200,7 +200,7 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>casdef001" + "value": "<>cascom001" }, // Non-required parameters "lock": { From d45b9066aacd8eb12518c2ec4cd8b1b7e8d9d927 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 20:27:00 +0200 Subject: [PATCH 8/9] Apply suggestions from code review --- .../availabilitySets/.test/common/deploy.test.bicep | 2 +- .../availabilitySets/.test/min/deploy.test.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep index ac019374f2..aaf7da4602 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/common/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.compute.availabilitysets-${serviceShort}-rg' diff --git a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep index ee6ff93be3..6b41cf18ae 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/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.compute.availabilitysets-${serviceShort}-rg' From cfebd084b2c509196639bd2dc083843f0297c5c5 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 13 Oct 2022 17:13:13 +0200 Subject: [PATCH 9/9] Removed unused output --- .../availabilitySets/.test/common/dependencies.bicep | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/Microsoft.Compute/availabilitySets/.test/common/dependencies.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/dependencies.bicep index e3a353b1a4..2c78999e90 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/common/dependencies.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/common/dependencies.bicep @@ -20,8 +20,5 @@ resource proximityPlacementGroup 'Microsoft.Compute/proximityPlacementGroups@202 @description('The principal ID of the created Managed Identity.') output managedIdentityPrincipalId string = managedIdentity.properties.principalId -@description('The resource ID of the created Managed Identity.') -output managedIdentityResourceId string = managedIdentity.id - @description('The resource ID of the created Proximity Placement Group.') output proximityPlacementGroupResourceId string = proximityPlacementGroup.id