Skip to content

Commit 2c4ecdb

Browse files
fabmasCopilot
authored andcommitted
fix: module avm/res/network/virtual-network-gateway (Azure#6471)
## Description Make domainNameLabelScope optional for VNG Public IP DNS settings (plus API/module reference updates). Fixes Azure#5733 Closes Azure#5733 ## Pipeline Reference [![avm.res.network.virtual-network-gateway](https://github.com/fabmas/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network-gateway.yml/badge.svg?branch=vng_5733)](https://github.com/fabmas/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network-gateway.yml) | Pipeline | | -------- | ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - Azure Verified Module updates: - [x] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [x] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [x] Breaking changes and I have bumped the MAJOR version in `version.json`. - [x] Update to documentation - [x] Update to CI Environment or utilities (Non-module affecting changes) ## Checklist - [x] I'm sure there are no other open Pull Requests for the same update/change - [x] I have run `Set-AVMModule` locally to generate the supporting module files. - [x] My corresponding pipelines / checks run clean and green without any errors or warnings - [x] I have updated the module's CHANGELOG.md file with an entry for the next version --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
1 parent 57b45a0 commit 2c4ecdb

File tree

9 files changed

+119
-47
lines changed

9 files changed

+119
-47
lines changed

avm/res/network/virtual-network-gateway/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
The latest version of the changelog can be found [here](https://github.com/Azure/bicep-registry-modules/blob/main/avm/res/network/virtual-network-gateway/CHANGELOG.md).
44

5+
## 0.10.1
6+
7+
### Changes
8+
9+
- Fixed hardcoded Public IP `dnsSettings.domainNameLabelScope` (preview feature) by making it optional/configurable to avoid deployment failures in regions where the feature isn't available.
10+
- Updated existing `Microsoft.Network/publicIPAddresses` API version to `2025-01-01`.
11+
- Updated referenced `br/public:avm/res/network/public-ip-address` module version to `0.10.0`.
12+
13+
### Breaking Changes
14+
15+
- None
16+
517
## 0.10.0
618

719
### Changes

avm/res/network/virtual-network-gateway/README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ For examples, please refer to the [Usage Examples](#usage-examples) section.
2727
| `Microsoft.Authorization/roleAssignments` | 2022-04-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.authorization_roleassignments.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments)</li></ul> |
2828
| `Microsoft.Insights/diagnosticSettings` | 2021-05-01-preview | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.insights_diagnosticsettings.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings)</li></ul> |
2929
| `Microsoft.Maintenance/configurationAssignments` | 2023-04-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.maintenance_configurationassignments.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Maintenance/2023-04-01/configurationAssignments)</li></ul> |
30-
| `Microsoft.Network/publicIPAddresses` | 2024-05-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.network_publicipaddresses.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2024-05-01/publicIPAddresses)</li></ul> |
31-
| `Microsoft.Network/virtualNetworkGateways` | 2024-05-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.network_virtualnetworkgateways.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2024-05-01/virtualNetworkGateways)</li></ul> |
32-
| `Microsoft.Network/virtualNetworkGateways/natRules` | 2024-05-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.network_virtualnetworkgateways_natrules.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2024-05-01/virtualNetworkGateways/natRules)</li></ul> |
30+
| `Microsoft.Network/publicIPAddresses` | 2025-01-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.network_publicipaddresses.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2025-01-01/publicIPAddresses)</li></ul> |
31+
| `Microsoft.Network/virtualNetworkGateways` | 2025-01-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.network_virtualnetworkgateways.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2025-01-01/virtualNetworkGateways)</li></ul> |
32+
| `Microsoft.Network/virtualNetworkGateways/natRules` | 2025-01-01 | <ul style="padding-left: 0px;"><li>[AzAdvertizer](https://www.azadvertizer.net/azresourcetypes/microsoft.network_virtualnetworkgateways_natrules.html)</li><li>[Template reference](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2025-01-01/virtualNetworkGateways/natRules)</li></ul> |
3333

3434
## Usage examples
3535

@@ -1505,6 +1505,7 @@ module virtualNetworkGateway 'br/public:avm/res/network/virtual-network-gateway:
15051505
domainNameLabel: [
15061506
'dm-nvgmax'
15071507
]
1508+
domainNameLabelScope: 'TenantReuse'
15081509
enableBgpRouteTranslationForNat: true
15091510
enablePrivateIpAddress: true
15101511
gatewayDefaultSiteLocalNetworkGatewayResourceId: '<gatewayDefaultSiteLocalNetworkGatewayResourceId>'
@@ -1647,6 +1648,9 @@ module virtualNetworkGateway 'br/public:avm/res/network/virtual-network-gateway:
16471648
"dm-nvgmax"
16481649
]
16491650
},
1651+
"domainNameLabelScope": {
1652+
"value": "TenantReuse"
1653+
},
16501654
"enableBgpRouteTranslationForNat": {
16511655
"value": true
16521656
},
@@ -1795,6 +1799,7 @@ param disableIPSecReplayProtection = true
17951799
param domainNameLabel = [
17961800
'dm-nvgmax'
17971801
]
1802+
param domainNameLabelScope = 'TenantReuse'
17981803
param enableBgpRouteTranslationForNat = true
17991804
param enablePrivateIpAddress = true
18001805
param gatewayDefaultSiteLocalNetworkGatewayResourceId = '<gatewayDefaultSiteLocalNetworkGatewayResourceId>'
@@ -2494,6 +2499,7 @@ param vpnType = 'RouteBased'
24942499
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
24952500
| [`disableIPSecReplayProtection`](#parameter-disableipsecreplayprotection) | bool | disableIPSecReplayProtection flag. Used for VPN Gateways. |
24962501
| [`domainNameLabel`](#parameter-domainnamelabel) | array | DNS name(s) of the Public IP resource(s). If you enabled Active-Active mode, you need to provide 2 DNS names, if you want to use this feature. A region specific suffix will be appended to it, e.g.: your-DNS-name.westeurope.cloudapp.azure.com. |
2502+
| [`domainNameLabelScope`](#parameter-domainnamelabelscope) | string | The domain name label scope for the Public IP DNS settings. This property is a preview feature and not available in all regions. If not specified, the property is omitted from the Public IP deployment. |
24972503
| [`enableBgpRouteTranslationForNat`](#parameter-enablebgproutetranslationfornat) | bool | EnableBgpRouteTranslationForNat flag. Can only be used when "natRules" are enabled on the Virtual Network Gateway. |
24982504
| [`enableDnsForwarding`](#parameter-enablednsforwarding) | bool | Whether DNS forwarding is enabled or not and is only supported for Express Route Gateways. The DNS forwarding feature flag must be enabled on the current subscription. |
24992505
| [`enablePrivateIpAddress`](#parameter-enableprivateipaddress) | bool | Whether private IP needs to be enabled on this gateway for connections or not. Used for configuring a Site-to-Site VPN connection over ExpressRoute private peering. |
@@ -3083,6 +3089,22 @@ DNS name(s) of the Public IP resource(s). If you enabled Active-Active mode, you
30833089
- Type: array
30843090
- Default: `[]`
30853091

3092+
### Parameter: `domainNameLabelScope`
3093+
3094+
The domain name label scope for the Public IP DNS settings. This property is a preview feature and not available in all regions. If not specified, the property is omitted from the Public IP deployment.
3095+
3096+
- Required: No
3097+
- Type: string
3098+
- Allowed:
3099+
```Bicep
3100+
[
3101+
'NoReuse'
3102+
'ResourceGroupReuse'
3103+
'SubscriptionReuse'
3104+
'TenantReuse'
3105+
]
3106+
```
3107+
30863108
### Parameter: `enableBgpRouteTranslationForNat`
30873109

30883110
EnableBgpRouteTranslationForNat flag. Can only be used when "natRules" are enabled on the Virtual Network Gateway.
@@ -3844,7 +3866,7 @@ This section gives you an overview of all local-referenced module files (i.e., o
38443866

38453867
| Reference | Type |
38463868
| :-- | :-- |
3847-
| `br/public:avm/res/network/public-ip-address:0.9.0` | Remote reference |
3869+
| `br/public:avm/res/network/public-ip-address:0.10.0` | Remote reference |
38483870
| `br/public:avm/utl/types/avm-common-types:0.5.1` | Remote reference |
38493871
| `br/public:avm/utl/types/avm-common-types:0.6.0` | Remote reference |
38503872

avm/res/network/virtual-network-gateway/main.bicep

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ param publicIpAvailabilityZones int[] = [
9898
@description('Optional. DNS name(s) of the Public IP resource(s). If you enabled Active-Active mode, you need to provide 2 DNS names, if you want to use this feature. A region specific suffix will be appended to it, e.g.: your-DNS-name.westeurope.cloudapp.azure.com.')
9999
param domainNameLabel array = []
100100

101+
@description('Optional. The domain name label scope for the Public IP DNS settings. This property is a preview feature and not available in all regions. If not specified, the property is omitted from the Public IP deployment.')
102+
param domainNameLabelScope ('NoReuse' | 'ResourceGroupReuse' | 'SubscriptionReuse' | 'TenantReuse')?
103+
101104
@description('Required. Specifies the gateway type. E.g. VPN, ExpressRoute.')
102105
@allowed([
103106
'Vpn'
@@ -471,23 +474,23 @@ var formattedRoleAssignments = [
471474
})
472475
]
473476

474-
resource primaryPublicIP 'Microsoft.Network/publicIPAddresses@2024-05-01' existing = if (!empty(existingPrimaryPublicIPResourceId)) {
477+
resource primaryPublicIP 'Microsoft.Network/publicIPAddresses@2025-01-01'existing = if (!empty(existingPrimaryPublicIPResourceId)) {
475478
name: last(split(existingPrimaryPublicIPResourceId, '/'))
476479
scope: resourceGroup(
477480
split(existingPrimaryPublicIPResourceId, '/')[2],
478481
split(existingPrimaryPublicIPResourceId, '/')[4]
479482
)
480483
}
481484

482-
resource secondaryPublicIP 'Microsoft.Network/publicIPAddresses@2024-05-01' existing = if (!empty(clusterSettings.?existingSecondaryPublicIPResourceId)) {
485+
resource secondaryPublicIP 'Microsoft.Network/publicIPAddresses@2025-01-01' existing = if (!empty(clusterSettings.?existingSecondaryPublicIPResourceId)) {
483486
name: last(split(clusterSettings.?existingSecondaryPublicIPResourceId, '/'))
484487
scope: resourceGroup(
485488
split(clusterSettings.?existingSecondaryPublicIPResourceId, '/')[2],
486489
split(clusterSettings.?existingSecondaryPublicIPResourceId, '/')[4]
487490
)
488491
}
489492

490-
resource tertiaryPublicIP 'Microsoft.Network/publicIPAddresses@2024-05-01' existing = if (!empty(clusterSettings.?existingTertiaryPublicIPResourceId)) {
493+
resource tertiaryPublicIP 'Microsoft.Network/publicIPAddresses@2025-01-01' existing = if (!empty(clusterSettings.?existingTertiaryPublicIPResourceId)) {
491494
name: last(split(clusterSettings.?existingTertiaryPublicIPResourceId, '/'))
492495
scope: resourceGroup(
493496
split(clusterSettings.?existingTertiaryPublicIPResourceId, '/')[2],
@@ -523,7 +526,7 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableT
523526

524527
// Public IPs
525528
@batchSize(1)
526-
module publicIPAddress 'br/public:avm/res/network/public-ip-address:0.9.0' = [
529+
module publicIPAddress 'br/public:avm/res/network/public-ip-address:0.10.0' = [
527530
for (virtualGatewayPublicIpName, index) in arrayPipNameVar: {
528531
name: virtualGatewayPublicIpName
529532
params: {
@@ -540,7 +543,8 @@ module publicIPAddress 'br/public:avm/res/network/public-ip-address:0.9.0' = [
540543
domainNameLabel: length(arrayPipNameVar) == length(domainNameLabel)
541544
? domainNameLabel[index]
542545
: virtualGatewayPublicIpName
543-
domainNameLabelScope: 'TenantReuse'
546+
547+
...(domainNameLabelScope != null ? { domainNameLabelScope: domainNameLabelScope } : {})
544548
}
545549
enableTelemetry: enableReferencedModulesTelemetry
546550
}
@@ -549,7 +553,7 @@ module publicIPAddress 'br/public:avm/res/network/public-ip-address:0.9.0' = [
549553

550554
// VNET Gateway
551555
// ============
552-
resource virtualNetworkGateway 'Microsoft.Network/virtualNetworkGateways@2024-05-01' = {
556+
resource virtualNetworkGateway 'Microsoft.Network/virtualNetworkGateways@2025-01-01' = {
553557
name: name
554558
location: location
555559
tags: tags
@@ -638,6 +642,7 @@ resource virtualNetworkGateway_lock 'Microsoft.Authorization/locks@2020-05-01' =
638642
scope: virtualNetworkGateway
639643
}
640644

645+
641646
resource virtualNetworkGateway_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = [
642647
for (diagnosticSetting, index) in (diagnosticSettings ?? []): {
643648
name: diagnosticSetting.?name ?? '${name}-diagnosticSettings'

0 commit comments

Comments
 (0)