Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ var aiRelatedDnsZoneIndices = [
// ===================================================
@batchSize(5)
module avmPrivateDnsZones 'br/public:avm/res/network/private-dns-zone:0.7.1' = [
for (zone, i) in privateDnsZones: if (enablePrivateNetworking && (empty(existingFoundryProjectResourceId) || !contains(aiRelatedDnsZoneIndices, i))) {
for (zone, i) in privateDnsZones: if (enablePrivateNetworking) {
name: 'avm.res.network.private-dns-zone.${split(zone, '.')[1]}'
params: {
name: zone
Expand Down Expand Up @@ -1165,6 +1165,47 @@ resource existingAiFoundryAiServicesProject 'Microsoft.CognitiveServices/account
parent: existingAiFoundryAiServices
}

// ========== Private Endpoint for Existing AI Services ========== //
var shouldCreatePrivateEndpoint = useExistingAiFoundryAiProject && enablePrivateNetworking
module existingAiServicesPrivateEndpoint 'br/public:avm/res/network/private-endpoint:0.11.0' = if (shouldCreatePrivateEndpoint) {
name: take('module.private-endpoint.${existingAiFoundryAiServices.name}', 64)
params: {
name: 'pep-${existingAiFoundryAiServices.name}'
location: location
subnetResourceId: virtualNetwork!.outputs.pepsSubnetResourceId
customNetworkInterfaceName: 'nic-${existingAiFoundryAiServices.name}'
privateDnsZoneGroup: {
privateDnsZoneGroupConfigs: [
{
name: 'ai-services-dns-zone-cognitiveservices'
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.cognitiveServices]!.outputs.resourceId
}
{
name: 'ai-services-dns-zone-openai'
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.openAI]!.outputs.resourceId
}
{
name: 'ai-services-dns-zone-aiservices'
privateDnsZoneResourceId: avmPrivateDnsZones[dnsZoneIndex.aiServices]!.outputs.resourceId
}
]
}
privateLinkServiceConnections: [
{
name: 'pep-${existingAiFoundryAiServices.name}'
properties: {
groupIds: ['account']
privateLinkServiceId: existingAiFoundryAiServices.id
}
}
]
tags: tags
}
dependsOn: [
existingAiFoundryAiServices
avmPrivateDnsZones
]
}

var aiSearchName = 'srch-${solutionSuffix}'
module searchService 'br/public:avm/res/search/search-service:0.11.1' = {
Expand Down
2 changes: 1 addition & 1 deletion infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"azureOpenaiAPIVersion": {
"value": "${AZURE_ENV_MODEL_VERSION}"
},
"gptDeploymentCapacity": {
"gptModelCapacity": {
"value": "${AZURE_ENV_MODEL_CAPACITY}"
},
"embeddingModel": {
Expand Down
4 changes: 2 additions & 2 deletions infra/main.waf.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cosmosLocation": {
"value": "${AZURE_ENV_COSMOS_LOCATION}"
},
"deploymentType": {
"gptModelDeploymentType": {
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
},
"gptModelName": {
Expand All @@ -17,7 +17,7 @@
"azureOpenaiAPIVersion": {
"value": "${AZURE_ENV_MODEL_VERSION}"
},
"gptDeploymentCapacity": {
"gptModelCapacity": {
"value": "${AZURE_ENV_MODEL_CAPACITY}"
},
"embeddingModel": {
Expand Down
4 changes: 2 additions & 2 deletions infra/scripts/run_create_index_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ if [ -n "$managedIdentityClientId" ]; then
fi

# Determine the correct Python command
if command -v python3 &> /dev/null; then
if command -v python3 && python3 --version &> /dev/null; then
PYTHON_CMD="python3"
elif command -v python &> /dev/null; then
elif command -v python && python --version &> /dev/null; then
PYTHON_CMD="python"
else
echo "Python is not installed on this system. Or it is not added in the PATH."
Expand Down