From beecd132ab1e7464528e31054d370bfdfaa011a7 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sun, 4 Sep 2022 14:54:38 +0200 Subject: [PATCH 1/7] Updated NSG to new dependency approach --- .../ms.network.networksecuritygroups.yml | 3 +- .../.test/default/dependencies.bicep | 24 +++ .../.test/default/deploy.test.bicep | 138 ++++++++++++++++++ .../.test/min.parameters.json | 9 -- .../.test/min/deploy.test.bicep | 37 +++++ .../.test/parameters.json | 103 ------------- .../networkSecurityGroups/readme.md | 110 +++++++------- 7 files changed, 255 insertions(+), 169 deletions(-) create mode 100644 modules/Microsoft.Network/networkSecurityGroups/.test/default/dependencies.bicep create mode 100644 modules/Microsoft.Network/networkSecurityGroups/.test/default/deploy.test.bicep delete mode 100644 modules/Microsoft.Network/networkSecurityGroups/.test/min.parameters.json create mode 100644 modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.Network/networkSecurityGroups/.test/parameters.json diff --git a/.github/workflows/ms.network.networksecuritygroups.yml b/.github/workflows/ms.network.networksecuritygroups.yml index 9535e97e90..53175de1ad 100644 --- a/.github/workflows/ms.network.networksecuritygroups.yml +++ b/.github/workflows/ms.network.networksecuritygroups.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.Network/networkSecurityGroups/.test/default/dependencies.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/default/dependencies.bicep new file mode 100644 index 0000000000..a57e2a9868 --- /dev/null +++ b/modules/Microsoft.Network/networkSecurityGroups/.test/default/dependencies.bicep @@ -0,0 +1,24 @@ +@description('Optional. The location to deploy 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 Application Security Group to create.') +param applicationSecurityGroupName string + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +resource applicationSecurityGroup 'Microsoft.Network/applicationSecurityGroups@2022-01-01' = { + name: applicationSecurityGroupName + location: location +} + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + +@description('The resource ID of the created Application Security Group.') +output applicationSecurityGroupResourceId string = applicationSecurityGroup.id diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/default/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/default/deploy.test.bicep new file mode 100644 index 0000000000..9420a279bc --- /dev/null +++ b/modules/Microsoft.Network/networkSecurityGroups/.test/default/deploy.test.bicep @@ -0,0 +1,138 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.network.networksecuritygroups-${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 = 'nnsgdef' + +// =========== // +// 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}' + applicationSecurityGroupName: 'dep-<>-asg-${serviceShort}' + } +} + +// Diagnostics +// =========== +module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' + params: { + storageAccountName: 'dep<>diasa${serviceShort}01' + logAnalyticsWorkspaceName: 'dep-<>-law-${serviceShort}' + eventHubNamespaceEventHubName: 'dep-<>-evh-${serviceShort}' + eventHubNamespaceName: 'dep-<>-evhns-${serviceShort}' + location: location + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + securityRules: [ + { + name: 'Specific' + properties: { + access: 'Allow' + description: 'Tests specific IPs and ports' + destinationAddressPrefix: '*' + destinationPortRange: '8080' + direction: 'Inbound' + priority: 100 + protocol: '*' + sourceAddressPrefix: '*' + sourcePortRange: '*' + } + } + { + name: 'Ranges' + properties: { + access: 'Allow' + description: 'Tests Ranges' + destinationAddressPrefixes: [ + '10.2.0.0/16' + '10.3.0.0/16' + ] + destinationPortRanges: [ + '90' + '91' + ] + direction: 'Inbound' + priority: 101 + protocol: '*' + sourceAddressPrefixes: [ + '10.0.0.0/16' + '10.1.0.0/16' + ] + sourcePortRanges: [ + '80' + '81' + ] + } + } + { + name: 'Port_8082' + properties: { + access: 'Allow' + description: 'Allow inbound access on TCP 8082' + destinationApplicationSecurityGroups: [ + { + id: resourceGroupResources.outputs.applicationSecurityGroupResourceId + } + ] + destinationPortRange: '8082' + direction: 'Inbound' + priority: 102 + protocol: '*' + sourceApplicationSecurityGroups: [ + { + id: resourceGroupResources.outputs.applicationSecurityGroupResourceId + } + ] + sourcePortRange: '*' + } + } + ] + } +} diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/min.parameters.json b/modules/Microsoft.Network/networkSecurityGroups/.test/min.parameters.json deleted file mode 100644 index b07946467a..0000000000 --- a/modules/Microsoft.Network/networkSecurityGroups/.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-nsg-min-001" - } - } -} diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..7ffb7a63d3 --- /dev/null +++ b/modules/Microsoft.Network/networkSecurityGroups/.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.network.networksecuritygroups-${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 = 'nnsgmin' + +// =========== // +// 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.Network/networkSecurityGroups/.test/parameters.json b/modules/Microsoft.Network/networkSecurityGroups/.test/parameters.json deleted file mode 100644 index 26cbb1eb56..0000000000 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/parameters.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-nsg-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "securityRules": { - "value": [ - { - "name": "Specific", - "properties": { - "description": "Tests specific IPs and ports", - "protocol": "*", - "sourcePortRange": "*", - "destinationPortRange": "8080", - "sourceAddressPrefix": "*", - "destinationAddressPrefix": "*", - "access": "Allow", - "priority": 100, - "direction": "Inbound" - } - }, - { - "name": "Ranges", - "properties": { - "description": "Tests Ranges", - "protocol": "*", - "access": "Allow", - "priority": 101, - "direction": "Inbound", - "sourcePortRanges": [ - "80", - "81" - ], - "destinationPortRanges": [ - "90", - "91" - ], - "sourceAddressPrefixes": [ - "10.0.0.0/16", - "10.1.0.0/16" - ], - "destinationAddressPrefixes": [ - "10.2.0.0/16", - "10.3.0.0/16" - ] - } - }, - { - "name": "Port_8082", - "properties": { - "description": "Allow inbound access on TCP 8082", - "protocol": "*", - "sourcePortRange": "*", - "destinationPortRange": "8082", - "access": "Allow", - "priority": 102, - "direction": "Inbound", - "sourceApplicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ], - "destinationApplicationSecurityGroups": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" - } - ] - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - } - } -} diff --git a/modules/Microsoft.Network/networkSecurityGroups/readme.md b/modules/Microsoft.Network/networkSecurityGroups/readme.md index e65327e397..8df28f5158 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/readme.md +++ b/modules/Microsoft.Network/networkSecurityGroups/readme.md @@ -164,7 +164,7 @@ 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

@@ -172,58 +172,21 @@ The following module usage examples are retrieved from the content of the files ```bicep module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-NetworkSecurityGroups' - params: { - name: '<>-az-nsg-min-001' - } -} -``` - -
-

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-nsg-min-001" - } - } -} -``` - -
-

- -

Example 2: Parameters

- -
- -via Bicep module - -```bicep -module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-NetworkSecurityGroups' + name: '${uniqueString(deployment().name)}-test-nnsgdef' params: { // Required parameters - name: '<>-az-nsg-x-001' + name: '<>nnsgdef001' // Non-required parameters - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + diagnosticEventHubAuthorizationRuleId: '' + diagnosticEventHubName: '' diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + diagnosticStorageAccountId: '' + diagnosticWorkspaceId: '' lock: 'CanNotDelete' roleAssignments: [ { principalIds: [ - '<>' + '' ] roleDefinitionIdOrName: 'Reader' } @@ -276,7 +239,7 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b description: 'Allow inbound access on TCP 8082' destinationApplicationSecurityGroups: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' + id: '' } ] destinationPortRange: '8082' @@ -285,7 +248,7 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b protocol: '*' sourceApplicationSecurityGroups: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001' + id: '' } ] sourcePortRange: '*' @@ -310,23 +273,23 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b "parameters": { // Required parameters "name": { - "value": "<>-az-nsg-x-001" + "value": "<>nnsgdef001" }, // Non-required parameters "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + "value": "" }, "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "value": "" }, "diagnosticLogsRetentionInDays": { "value": 7 }, "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "value": "" }, "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + "value": "" }, "lock": { "value": "CanNotDelete" @@ -335,7 +298,7 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b "value": [ { "principalIds": [ - "<>" + "" ], "roleDefinitionIdOrName": "Reader" } @@ -390,7 +353,7 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b "description": "Allow inbound access on TCP 8082", "destinationApplicationSecurityGroups": [ { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" + "id": "" } ], "destinationPortRange": "8082", @@ -399,7 +362,7 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b "protocol": "*", "sourceApplicationSecurityGroups": [ { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/applicationSecurityGroups/adp-<>-az-asg-x-001" + "id": "" } ], "sourcePortRange": "*" @@ -413,3 +376,40 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b

+ +

Example 2: Min

+ +
+ +via Bicep module + +```bicep +module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-nnsgmin' + params: { + name: '<>nnsgmin001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>nnsgmin001" + } + } +} +``` + +
+

From 7ec94e414e77e53e0691d444113765b169d05073 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 8 Sep 2022 19:15:30 +0200 Subject: [PATCH 2/7] Updated folder default to common. --- .../.test/{default => common}/dependencies.bicep | 0 .../.test/{default => common}/deploy.test.bicep | 0 modules/Microsoft.Network/networkSecurityGroups/readme.md | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename modules/Microsoft.Network/networkSecurityGroups/.test/{default => common}/dependencies.bicep (100%) rename modules/Microsoft.Network/networkSecurityGroups/.test/{default => common}/deploy.test.bicep (100%) diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/default/dependencies.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/common/dependencies.bicep similarity index 100% rename from modules/Microsoft.Network/networkSecurityGroups/.test/default/dependencies.bicep rename to modules/Microsoft.Network/networkSecurityGroups/.test/common/dependencies.bicep diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/default/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.Network/networkSecurityGroups/.test/default/deploy.test.bicep rename to modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep diff --git a/modules/Microsoft.Network/networkSecurityGroups/readme.md b/modules/Microsoft.Network/networkSecurityGroups/readme.md index 8df28f5158..d6c0ec56e4 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/readme.md +++ b/modules/Microsoft.Network/networkSecurityGroups/readme.md @@ -164,7 +164,7 @@ 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

From 44bf2061772e43a3830b9484bb57127ac8ea8468 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:52:05 +0200 Subject: [PATCH 3/7] Update to latest --- .../networkSecurityGroups/.test/common/deploy.test.bicep | 4 ++-- .../networkSecurityGroups/.test/min/deploy.test.bicep | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep index 9420a279bc..fdbe135b82 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep @@ -10,8 +10,8 @@ param resourceGroupName string = 'ms.network.networksecuritygroups-${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') -param serviceShort string = 'nnsgdef' +@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 = 'nnsgcom' // =========== // // Deployments // diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep index 7ffb7a63d3..cf1af8e392 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.network.networksecuritygroups-${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 = 'nnsgmin' // =========== // From c481151fa0084f8af9e8cf0da7a7ff7d7d294004 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:05:17 +0200 Subject: [PATCH 4/7] Update to latest --- .../networkSecurityGroups/.test/common/deploy.test.bicep | 6 +++--- .../networkSecurityGroups/.test/min/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep index fdbe135b82..6652f63d51 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/networkSecurityGroups/.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.network.networksecuritygroups-${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 = 'nnsgcom' // =========== // diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep index cf1af8e392..552d90285b 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/networkSecurityGroups/.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.network.networksecuritygroups-${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 = 'nnsgmin' // =========== // From 1d1f755b10a3635de929a10144dfd71a263cff39 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:58:25 +0200 Subject: [PATCH 5/7] Update to latest --- modules/Microsoft.Network/networkSecurityGroups/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.Network/networkSecurityGroups/readme.md b/modules/Microsoft.Network/networkSecurityGroups/readme.md index 05ab3eccf4..9436f5a75d 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/readme.md +++ b/modules/Microsoft.Network/networkSecurityGroups/readme.md @@ -173,10 +173,10 @@ The following module usage examples are retrieved from the content of the files ```bicep module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-nnsgdef' + name: '${uniqueString(deployment().name)}-test-nnsgcom' params: { // Required parameters - name: '<>nnsgdef001' + name: '<>nnsgcom001' // Non-required parameters diagnosticEventHubAuthorizationRuleId: '' diagnosticEventHubName: '' @@ -274,7 +274,7 @@ module networkSecurityGroups './Microsoft.Network/networkSecurityGroups/deploy.b "parameters": { // Required parameters "name": { - "value": "<>nnsgdef001" + "value": "<>nnsgcom001" }, // Non-required parameters "diagnosticEventHubAuthorizationRuleId": { From e04cda52878ec72cb3bfb57ea8b8fd06ce8641dc Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:08:21 +0200 Subject: [PATCH 6/7] Update modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep --- .../networkSecurityGroups/.test/common/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep index 6652f63d51..cdba107916 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/networkSecurityGroups/.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.network.networksecuritygroups-${serviceShort}-rg' From aeedce8cdb67b1fb924d98251f1cb4723d923169 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:08:35 +0200 Subject: [PATCH 7/7] Update modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep --- .../networkSecurityGroups/.test/min/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep b/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep index 552d90285b..2bee352bdd 100644 --- a/modules/Microsoft.Network/networkSecurityGroups/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/networkSecurityGroups/.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.network.networksecuritygroups-${serviceShort}-rg'