Skip to content

Commit 4ab83b1

Browse files
Fix A Recordset
1 parent d2edc9b commit 4ab83b1

File tree

2 files changed

+120
-4
lines changed

2 files changed

+120
-4
lines changed

scenarios/Agents/setup/network-secured-agent/azuredeploy.json

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.33.93.31351",
8-
"templateHash": "13610358180001906492"
8+
"templateHash": "11320135796736030975"
99
}
1010
},
1111
"parameters": {
@@ -1289,7 +1289,7 @@
12891289
"_generator": {
12901290
"name": "bicep",
12911291
"version": "0.33.93.31351",
1292-
"templateHash": "9138892518815799182"
1292+
"templateHash": "6718468015645700202"
12931293
}
12941294
},
12951295
"parameters": {
@@ -1338,6 +1338,28 @@
13381338
]
13391339
}
13401340
},
1341+
{
1342+
"type": "Microsoft.Network/privateEndpoints",
1343+
"apiVersion": "2024-05-01",
1344+
"name": "[format('{0}-openAi-private-endpoint', parameters('aiServicesName'))]",
1345+
"location": "[resourceGroup().location]",
1346+
"properties": {
1347+
"subnet": {
1348+
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('cxSubnetName'))]"
1349+
},
1350+
"privateLinkServiceConnections": [
1351+
{
1352+
"name": "[format('{0}-openAi-private-link-service-connection', parameters('aiServicesName'))]",
1353+
"properties": {
1354+
"privateLinkServiceId": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('aiServicesName'))]",
1355+
"groupIds": [
1356+
"account"
1357+
]
1358+
}
1359+
}
1360+
]
1361+
}
1362+
},
13411363
{
13421364
"type": "Microsoft.Network/privateEndpoints",
13431365
"apiVersion": "2024-05-01",
@@ -1388,6 +1410,12 @@
13881410
"name": "privatelink.azureml.ms",
13891411
"location": "global"
13901412
},
1413+
{
1414+
"type": "Microsoft.Network/privateDnsZones",
1415+
"apiVersion": "2020-06-01",
1416+
"name": "privatelink.openai.azure.com",
1417+
"location": "global"
1418+
},
13911419
{
13921420
"type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks",
13931421
"apiVersion": "2024-06-01",
@@ -1403,6 +1431,21 @@
14031431
"[resourceId('Microsoft.Network/privateDnsZones', 'privatelink.azureml.ms')]"
14041432
]
14051433
},
1434+
{
1435+
"type": "Microsoft.Network/privateDnsZones/virtualNetworkLinks",
1436+
"apiVersion": "2024-06-01",
1437+
"name": "[format('{0}/{1}', 'privatelink.openai.azure.com', format('aiServicesOpenAI-{0}-link', parameters('suffix')))]",
1438+
"location": "global",
1439+
"properties": {
1440+
"virtualNetwork": {
1441+
"id": "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]"
1442+
},
1443+
"registrationEnabled": false
1444+
},
1445+
"dependsOn": [
1446+
"[resourceId('Microsoft.Network/privateDnsZones', 'privatelink.openai.azure.com')]"
1447+
]
1448+
},
14061449
{
14071450
"type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
14081451
"apiVersion": "2024-05-01",
@@ -1422,6 +1465,25 @@
14221465
"[resourceId('Microsoft.Network/privateEndpoints', format('{0}-private-endpoint', parameters('aiServicesName')))]"
14231466
]
14241467
},
1468+
{
1469+
"type": "Microsoft.Network/privateEndpoints/privateDnsZoneGroups",
1470+
"apiVersion": "2024-05-01",
1471+
"name": "[format('{0}/{1}', format('{0}-openAi-private-endpoint', parameters('aiServicesName')), format('{0}-openAi-dns-group', parameters('aiServicesName')))]",
1472+
"properties": {
1473+
"privateDnsZoneConfigs": [
1474+
{
1475+
"name": "[format('{0}-openAi-dns-config', parameters('aiServicesName'))]",
1476+
"properties": {
1477+
"privateDnsZoneId": "[resourceId('Microsoft.Network/privateDnsZones', 'privatelink.openai.azure.com')]"
1478+
}
1479+
}
1480+
]
1481+
},
1482+
"dependsOn": [
1483+
"[resourceId('Microsoft.Network/privateEndpoints', format('{0}-openAi-private-endpoint', parameters('aiServicesName')))]",
1484+
"[resourceId('Microsoft.Network/privateDnsZones', 'privatelink.openai.azure.com')]"
1485+
]
1486+
},
14251487
{
14261488
"type": "Microsoft.Network/privateDnsZones",
14271489
"apiVersion": "2020-06-01",

scenarios/Agents/setup/network-secured-agent/modules-network-secured/private-endpoint-and-dns.bicep

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Security Benefits:
2626
*/
2727

2828
// Resource names and identifiers
29-
param aiServicesName string
30-
param aiSearchName string
29+
param aiServicesName string
30+
param aiSearchName string
3131
param storageName string
3232
param vnetName string
3333
param cxSubnetName string
@@ -82,6 +82,27 @@ resource aiServicesPrivateEndpoint 'Microsoft.Network/privateEndpoints@2024-05-0
8282
}
8383
}
8484

85+
resource aiServiceOpenAiPrivateEndpoint 'Microsoft.Network/privateEndpoints@2024-05-01' = {
86+
name: '${aiServicesName}-openAi-private-endpoint'
87+
location: resourceGroup().location
88+
properties: {
89+
subnet: {
90+
id: cxSubnet.id // Deploy in customer hub subnet
91+
}
92+
privateLinkServiceConnections: [
93+
{
94+
name: '${aiServicesName}-openAi-private-link-service-connection'
95+
properties: {
96+
privateLinkServiceId: aiServices.id
97+
groupIds: [
98+
'account' // Target AI Services account
99+
]
100+
}
101+
}
102+
]
103+
}
104+
}
105+
85106
/* -------------------------------------------- AI Search Private Endpoint -------------------------------------------- */
86107

87108
// Private endpoint for AI Search
@@ -143,6 +164,11 @@ resource aiServicesPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01'
143164
location: 'global'
144165
}
145166

167+
resource openAiPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {
168+
name: 'privatelink.openai.azure.com'
169+
location: 'global'
170+
}
171+
146172
// Link AI Services DNS Zone to VNet
147173
resource aiServicesLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2024-06-01' = {
148174
parent: aiServicesPrivateDnsZone
@@ -156,6 +182,18 @@ resource aiServicesLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2
156182
}
157183
}
158184

185+
resource aiOpenAILink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2024-06-01' = {
186+
parent: openAiPrivateDnsZone
187+
location: 'global'
188+
name: 'aiServicesOpenAI-${suffix}-link'
189+
properties: {
190+
virtualNetwork: {
191+
id: vnet.id // Link to specified VNet
192+
}
193+
registrationEnabled: false // Don't auto-register VNet resources
194+
}
195+
}
196+
159197
// DNS Zone Group for AI Services
160198
resource aiServicesDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2024-05-01' = {
161199
parent: aiServicesPrivateEndpoint
@@ -172,6 +210,22 @@ resource aiServicesDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGr
172210
}
173211
}
174212

213+
// DNS Zone Group for Azure OpenAI
214+
resource aiOpenAIDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2024-05-01' = {
215+
parent: aiServiceOpenAiPrivateEndpoint
216+
name: '${aiServicesName}-openAi-dns-group'
217+
properties: {
218+
privateDnsZoneConfigs: [
219+
{
220+
name: '${aiServicesName}-openAi-dns-config'
221+
properties: {
222+
privateDnsZoneId: openAiPrivateDnsZone.id
223+
}
224+
}
225+
]
226+
}
227+
}
228+
175229
// Private DNS Zone for AI Search
176230
// - Enables custom DNS resolution for AI Search private endpoint
177231
resource aiSearchPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = {

0 commit comments

Comments
 (0)