Skip to content

Commit 5a6c793

Browse files
added dns for existing project to access
1 parent 279c5a1 commit 5a6c793

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

infra/main.bicep

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ var aiRelatedDnsZoneIndices = [
535535
// ===================================================
536536
@batchSize(5)
537537
module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
538-
for (zone, i) in privateDnsZones: if (enablePrivateNetworking && (empty(existingFoundryProjectResourceId) || !contains(aiRelatedDnsZoneIndices, i))) {
538+
for (zone, i) in privateDnsZones: if (enablePrivateNetworking) {
539539
name: 'avm.res.network.private-dns-zone.${split(zone, '.')[1]}'
540540
params: {
541541
name: zone
@@ -1165,6 +1165,47 @@ resource existingAiFoundryAiServicesProject 'Microsoft.CognitiveServices/account
11651165
parent: existingAiFoundryAiServices
11661166
}
11671167

1168+
// ========== Private Endpoint for Existing AI Services ========== //
1169+
var shouldCreatePrivateEndpoint = useExistingAiFoundryAiProject && enablePrivateNetworking
1170+
module existingAiServicesPrivateEndpoint 'br/public:avm/res/network/private-endpoint:0.11.0' = if (shouldCreatePrivateEndpoint) {
1171+
name: take('module.private-endpoint.${existingAiFoundryAiServices.name}', 64)
1172+
params: {
1173+
name: 'pep-${existingAiFoundryAiServices.name}'
1174+
location: location
1175+
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
1176+
customNetworkInterfaceName: 'nic-${existingAiFoundryAiServices.name}'
1177+
privateDnsZoneGroup: {
1178+
privateDnsZoneGroupConfigs: [
1179+
{
1180+
name: 'ai-services-dns-zone-cognitiveservices'
1181+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.cognitiveServices]!.outputs.resourceId
1182+
}
1183+
{
1184+
name: 'ai-services-dns-zone-openai'
1185+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.openAI]!.outputs.resourceId
1186+
}
1187+
{
1188+
name: 'ai-services-dns-zone-aiservices'
1189+
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.aiServices]!.outputs.resourceId
1190+
}
1191+
]
1192+
}
1193+
privateLinkServiceConnections: [
1194+
{
1195+
name: 'pep-${existingAiFoundryAiServices.name}'
1196+
properties: {
1197+
groupIds: ['account']
1198+
privateLinkServiceId: existingAiFoundryAiServices.id
1199+
}
1200+
}
1201+
]
1202+
tags: tags
1203+
}
1204+
dependsOn: [
1205+
existingAiFoundryAiServices
1206+
avmPrivateDnsZones
1207+
]
1208+
}
11681209

11691210
var aiSearchName = 'srch-${solutionSuffix}'
11701211
module searchService 'br/public:avm/res/search/search-service:0.11.1' = {

infra/main.parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"azureOpenaiAPIVersion": {
1818
"value": "${AZURE_ENV_MODEL_VERSION}"
1919
},
20-
"gptDeploymentCapacity": {
20+
"gptModelCapacity": {
2121
"value": "${AZURE_ENV_MODEL_CAPACITY}"
2222
},
2323
"embeddingModel": {

infra/main.waf.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"cosmosLocation": {
99
"value": "${AZURE_ENV_COSMOS_LOCATION}"
1010
},
11-
"deploymentType": {
11+
"gptModelDeploymentType": {
1212
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
1313
},
1414
"gptModelName": {
@@ -17,7 +17,7 @@
1717
"azureOpenaiAPIVersion": {
1818
"value": "${AZURE_ENV_MODEL_VERSION}"
1919
},
20-
"gptDeploymentCapacity": {
20+
"gptModelCapacity": {
2121
"value": "${AZURE_ENV_MODEL_CAPACITY}"
2222
},
2323
"embeddingModel": {

infra/scripts/run_create_index_scripts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ if [ -n "$managedIdentityClientId" ]; then
170170
fi
171171

172172
# Determine the correct Python command
173-
if command -v python3 &> /dev/null; then
173+
if command -v python3 && python3 --version &> /dev/null; then
174174
PYTHON_CMD="python3"
175-
elif command -v python &> /dev/null; then
175+
elif command -v python && python --version &> /dev/null; then
176176
PYTHON_CMD="python"
177177
else
178178
echo "Python is not installed on this system. Or it is not added in the PATH."

0 commit comments

Comments
 (0)