diff --git a/.github/actions/templates/avm-validateModuleDeployment/action.yml b/.github/actions/templates/avm-validateModuleDeployment/action.yml index 7fec4c6374..a62a0abdfe 100644 --- a/.github/actions/templates/avm-validateModuleDeployment/action.yml +++ b/.github/actions/templates/avm-validateModuleDeployment/action.yml @@ -30,7 +30,7 @@ description: "Deploy module" inputs: modulePath: - descriptio: "The path to the module file directory used to determine the resource location" + description: "The path to the module file directory used to determine the resource location" required: true templateFilePath: description: "The path to the template file to use for deployment" diff --git a/avm/res/network/network-manager/README.md b/avm/res/network/network-manager/README.md index b6ebc1f608..bf2aee8932 100644 --- a/avm/res/network/network-manager/README.md +++ b/avm/res/network/network-manager/README.md @@ -9,6 +9,7 @@ This module deploys a Network Manager. - [Parameters](#Parameters) - [Outputs](#Outputs) - [Cross-referenced modules](#Cross-referenced-modules) +- [Notes](#Notes) - [Data Collection](#Data-Collection) ## Resource Types @@ -127,7 +128,7 @@ module networkManager 'br/public:avm/res/network/network-manager:' = { ] networkManagerScopes: { managementGroups: [ - '/providers/Microsoft.Management/managementGroups/#_ARM_MGMTGROUP_ID_#' + '/providers/Microsoft.Management/managementGroups/#_managementGroupId_#' ] } // Non-required parameters @@ -354,7 +355,7 @@ module networkManager 'br/public:avm/res/network/network-manager:' = { "networkManagerScopes": { "value": { "managementGroups": [ - "/providers/Microsoft.Management/managementGroups/#_ARM_MGMTGROUP_ID_#" + "/providers/Microsoft.Management/managementGroups/#_managementGroupId_#" ] } }, @@ -678,7 +679,7 @@ module networkManager 'br/public:avm/res/network/network-manager:' = { | Parameter | Type | Description | | :-- | :-- | :-- | | [`connectivityConfigurations`](#parameter-connectivityconfigurations) | array | Connectivity Configurations to create for the network manager. Network manager must contain at least one network group in order to define connectivity configurations. | -| [`description`](#parameter-description) | string | A description of the network manager. | +| [`description`](#parameter-description) | string | A description of the Network Manager. | | [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. | | [`location`](#parameter-location) | string | Location for all resources. | | [`lock`](#parameter-lock) | object | The lock settings of the service. | @@ -726,7 +727,7 @@ Connectivity Configurations to create for the network manager. Network manager m ### Parameter: `description` -A description of the network manager. +A description of the Network Manager. - Required: No - Type: string @@ -910,6 +911,10 @@ Tags of the resource. _None_ +## Notes + +In order to deploy a Network Manager with the `networkManagerScopes` property set to `managementGroups`, you need to register the `Microsoft.Network` resource provider at the Management Group first ([ref](https://learn.microsoft.com/en-us/rest/api/resources/providers/register-at-management-group-scope)). + ## Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. diff --git a/avm/res/network/network-manager/main.bicep b/avm/res/network/network-manager/main.bicep index 47ccc12aa6..21b3090ac4 100644 --- a/avm/res/network/network-manager/main.bicep +++ b/avm/res/network/network-manager/main.bicep @@ -20,7 +20,7 @@ param roleAssignments roleAssignmentType param tags object? @maxLength(500) -@sys.description('Optional. A description of the network manager.') +@sys.description('Optional. A description of the Network Manager.') param description string = '' @sys.description('Required. Scope Access. String array containing any of "Connectivity", "SecurityAdmin". The connectivity feature allows you to create network topologies at scale. The security admin feature lets you create high-priority security rules, which take precedence over NSGs.') diff --git a/avm/res/network/network-manager/main.json b/avm/res/network/network-manager/main.json index b8f1c34717..f5f2ad12ec 100644 --- a/avm/res/network/network-manager/main.json +++ b/avm/res/network/network-manager/main.json @@ -145,7 +145,7 @@ "defaultValue": "", "maxLength": 500, "metadata": { - "description": "Optional. A description of the network manager." + "description": "Optional. A description of the Network Manager." } }, "networkManagerScopeAccesses": { diff --git a/avm/res/network/network-manager/tests/e2e/max/main.test.bicep b/avm/res/network/network-manager/tests/e2e/max/main.test.bicep index 7fd628e30d..d6a524f1ba 100644 --- a/avm/res/network/network-manager/tests/e2e/max/main.test.bicep +++ b/avm/res/network/network-manager/tests/e2e/max/main.test.bicep @@ -84,7 +84,8 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' ] networkManagerScopes: { managementGroups: [ - '/providers/Microsoft.Management/managementGroups/#_ARM_MGMTGROUP_ID_#' + // Note: Required the `Microsoft.Network` provider to be registered at management group level via `az provider register --namespace Microsoft.Network -m ''` + '/providers/Microsoft.Management/managementGroups/#_managementGroupId_#' ] } networkGroups: [ @@ -260,4 +261,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem' Role: 'DeploymentValidation' } } + dependsOn: [ + nestedDependencies + ] }] diff --git a/avm/utilities/tools/Test-ModuleLocally.ps1 b/avm/utilities/tools/Test-ModuleLocally.ps1 index dac32938e7..c4595eb892 100644 --- a/avm/utilities/tools/Test-ModuleLocally.ps1 +++ b/avm/utilities/tools/Test-ModuleLocally.ps1 @@ -221,6 +221,12 @@ function Test-ModuleLocally { # Add other template files as they may contain the 'moduleVersion' $tokenConfiguration.FilePathList += (Get-ChildItem -Path $moduleRoot -Recurse -File).FullName | Where-Object { $_ -match '.+(main.json|main.bicep)$' } + # Default tokens + $tokenConfiguration.Tokens += @{ + subscriptionId = $ValidateOrDeployParameters.SubscriptionId + managementGroupId = $ValidateOrDeployParameters.ManagementGroupId + } + # Add Other Parameter File Tokens (For Testing) $AdditionalTokens.Keys | ForEach-Object { $tokenConfiguration.Tokens[$PSItem] = $AdditionalTokens.$PSItem