Skip to content

Commit 9116b84

Browse files
adding queue networking config
1 parent 4393aca commit 9116b84

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

infra/app/storage-PrivateEndpoint.bicep

+64-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing
2323
}
2424

2525
var blobPrivateDNSZoneName = format('privatelink.blob.{0}', environment().suffixes.storage)
26-
var blobPrivateDnsZoneVirtualNetworkLinkName = format('{0}-link-{1}', resourceName, take(toLower(uniqueString(resourceName, virtualNetworkName)), 4))
26+
var blobPrivateDnsZoneVirtualNetworkLinkName = format('{0}-blob-link-{1}', resourceName, take(toLower(uniqueString(resourceName, virtualNetworkName)), 4))
27+
28+
var queuePrivateDNSZoneName = format('privatelink.queue.{0}', environment().suffixes.storage)
29+
var queuePrivateDnsZoneVirtualNetworkLinkName = format('{0}-queue-link-{1}', resourceName, take(toLower(uniqueString(resourceName, virtualNetworkName)), 4))
2730

2831
// Private DNS Zones
2932
resource blobPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
@@ -36,6 +39,16 @@ resource blobPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
3639
]
3740
}
3841

42+
resource queuePrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
43+
name: queuePrivateDNSZoneName
44+
location: 'global'
45+
tags: tags
46+
properties: {}
47+
dependsOn: [
48+
vnet
49+
]
50+
}
51+
3952
// Virtual Network Links
4053
resource blobPrivateDnsZoneVirtualNetworkLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = {
4154
parent: blobPrivateDnsZone
@@ -50,6 +63,19 @@ resource blobPrivateDnsZoneVirtualNetworkLink 'Microsoft.Network/privateDnsZones
5063
}
5164
}
5265

66+
resource queuePrivateDnsZoneVirtualNetworkLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = {
67+
parent: queuePrivateDnsZone
68+
name: queuePrivateDnsZoneVirtualNetworkLinkName
69+
location: 'global'
70+
tags: tags
71+
properties: {
72+
registrationEnabled: false
73+
virtualNetwork: {
74+
id: vnet.id
75+
}
76+
}
77+
}
78+
5379
// Private Endpoints
5480
resource blobPrivateEndpoint 'Microsoft.Network/privateEndpoints@2021-08-01' = {
5581
name: 'blob-private-endpoint'
@@ -87,3 +113,40 @@ resource blobPrivateDnsZoneGroupName 'Microsoft.Network/privateEndpoints/private
87113
]
88114
}
89115
}
116+
117+
resource queuePrivateEndpoint 'Microsoft.Network/privateEndpoints@2021-08-01' = {
118+
name: 'queue-private-endpoint'
119+
location: location
120+
tags: tags
121+
properties: {
122+
privateLinkServiceConnections: [
123+
{
124+
name: 'queuePrivateLinkConnection'
125+
properties: {
126+
privateLinkServiceId: storageAccount.id
127+
groupIds: [
128+
'queue'
129+
]
130+
}
131+
}
132+
]
133+
subnet: {
134+
id: '${vnet.id}/subnets/${subnetName}'
135+
}
136+
}
137+
}
138+
139+
resource queuePrivateDnsZoneGroupName 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2022-01-01' = {
140+
parent: queuePrivateEndpoint
141+
name: 'queuePrivateDnsZoneGroup'
142+
properties: {
143+
privateDnsZoneConfigs: [
144+
{
145+
name: 'storageQueueARecord'
146+
properties: {
147+
privateDnsZoneId: queuePrivateDnsZone.id
148+
}
149+
}
150+
]
151+
}
152+
}

0 commit comments

Comments
 (0)