Skip to content

Commit 33763ed

Browse files
refactor: update parameter names and improve subnet delegation in Bicep files
1 parent 1787c64 commit 33763ed

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
--template-file infra/main.bicep \
141141
--parameters \
142142
solutionName="${{ env.SOLUTION_PREFIX }}" \
143-
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
143+
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
144144
capacity=${{ env.GPT_MIN_CAPACITY }} \
145145
imageVersion="${IMAGE_TAG}" \
146146
createdBy="Pipeline" \

infra/main.bicep

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ var privateDnsZones = [
245245
'privatelink.documents.azure.com'
246246
'privatelink.vaultcore.azure.net'
247247
'privatelink.blob.${environment().suffixes.storage}'
248-
'privatelink.queue.${environment().suffixes.storage}'
248+
'privatelink.file.${environment().suffixes.storage}'
249249
]
250250

251251
// DNS Zone Index Constants
@@ -256,7 +256,7 @@ var dnsZoneIndex = {
256256
cosmosDB: 3
257257
keyVault: 4
258258
storageBlob: 5
259-
storageQueue: 6
259+
storageFile: 6
260260
}
261261

262262
// ===================================================
@@ -267,7 +267,7 @@ var dnsZoneIndex = {
267267
@batchSize(5)
268268
module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
269269
for (zone, i) in privateDnsZones: if (enablePrivateNetworking) {
270-
name: 'avm.res.network.private-dns-zone.${split(zone, '.')[1]}.${solutionSuffix}'
270+
name: take('avm.res.network.private-dns-zone.${split(zone, '.')[1]}.${solutionSuffix}', 64)
271271
params: {
272272
name: zone
273273
tags: allTags
@@ -403,7 +403,7 @@ module aiServices 'modules/ai-foundry/aifoundry.bicep' = {
403403
managedIdentities: {
404404
systemAssigned: true
405405
}
406-
publicNetworkAccess: 'Enabled'
406+
publicNetworkAccess: 'Disabled'
407407
networkAcls: {
408408
bypass: 'AzureServices'
409409
defaultAction: 'Allow'
@@ -448,7 +448,7 @@ module storageAccount 'modules/storageAccount.bicep' = {
448448
virtualNetworkResourceId: virtualNetwork!.outputs.resourceId
449449
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
450450
blobPrivateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.storageBlob]!.outputs.resourceId
451-
filePrivateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.storageQueue]!.outputs.resourceId
451+
filePrivateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.storageFile]!.outputs.resourceId
452452
}
453453
: null
454454
containers: [

infra/modules/virtualNetwork.bicep

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Networking - NSGs, VNET and Subnets. Each subnet has its own NSG
33
/****************************************************************************************************************************/
44
@description('Name of the virtual network.')
5-
param name string
5+
param name string
66

77
@description('Azure region to deploy resources.')
88
param location string = resourceGroup().location
@@ -15,7 +15,7 @@ param subnets subnetType[] = [
1515
{
1616
name: 'web'
1717
addressPrefixes: ['10.0.0.0/23'] // /23 (10.0.0.0 - 10.0.1.255), 512 addresses
18-
delegation: 'Microsoft.Web/serverFarms'
18+
delegation: 'Microsoft.App/environments'
1919
networkSecurityGroup: {
2020
name: 'nsg-web'
2121
securityRules: [
@@ -41,8 +41,8 @@ param subnets subnetType[] = [
4141
protocol: '*'
4242
sourcePortRange: '*'
4343
destinationPortRange: '*'
44-
sourceAddressPrefixes: ['10.0.0.0/23']
45-
destinationAddressPrefixes: ['10.0.0.0/23']
44+
sourceAddressPrefixes: ['10.0.0.0/23'] // From same subnet
45+
destinationAddressPrefixes: ['10.0.0.0/23'] // To same subnet
4646
}
4747
}
4848
{
@@ -280,10 +280,18 @@ output subnets subnetOutputType[] = [
280280
]
281281

282282
// Dynamic outputs for individual subnets for backward compatibility
283-
output webSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'web') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'web')] : ''
284-
output pepsSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'peps') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'peps')] : ''
285-
output bastionSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'AzureBastionSubnet') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'AzureBastionSubnet')] : ''
286-
output jumpboxSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'jumpbox') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'jumpbox')] : ''
283+
output webSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'web')
284+
? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'web')]
285+
: ''
286+
output pepsSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'peps')
287+
? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'peps')]
288+
: ''
289+
output bastionSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'AzureBastionSubnet')
290+
? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'AzureBastionSubnet')]
291+
: ''
292+
output jumpboxSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'jumpbox')
293+
? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'jumpbox')]
294+
: ''
287295

288296
@export()
289297
@description('Custom type definition for subnet resource information as output')
@@ -307,8 +315,8 @@ type subnetType = {
307315
@description('Required. The Name of the subnet resource.')
308316
name: string
309317

310-
@description('Required. Prefixes for the subnet.') // Required to ensure at least one prefix is provided
311-
addressPrefixes: string[]
318+
@description('Required. Prefixes for the subnet.') // Required to ensure at least one prefix is provided
319+
addressPrefixes: string[]
312320

313321
@description('Optional. The delegation to enable on the subnet.')
314322
delegation: string?

0 commit comments

Comments
 (0)