Skip to content

Commit f4fb45c

Browse files
authored
Make OpenAI deployment optional (#1777)
1 parent 7374ee5 commit f4fb45c

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

infra/main.bicep

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,17 @@ module isolation 'network-isolation.bicep' = {
715715
}
716716

717717
var environmentData = environment()
718-
var privateEndpointConnections = usePrivateEndpoint ? [
718+
719+
var openAiPrivateEndpointConnection = (isAzureOpenAiHost && deployAzureOpenAi) ? [{
720+
groupId: 'account'
721+
dnsZoneName: 'privatelink.openai.azure.com'
722+
resourceIds: concat(
723+
[ openAi.outputs.id ],
724+
useGPT4V ? [ computerVision.outputs.id ] : [],
725+
!useLocalPdfParser ? [ documentIntelligence.outputs.id ] : []
726+
)
727+
}] : []
728+
var otherPrivateEndpointConnections = usePrivateEndpoint ? [
719729
{
720730
groupId: 'blob'
721731
dnsZoneName: 'privatelink.blob.${environmentData.suffixes.storage}'
@@ -724,15 +734,6 @@ var privateEndpointConnections = usePrivateEndpoint ? [
724734
useUserUpload ? [ userStorage.outputs.id ] : []
725735
)
726736
}
727-
{
728-
groupId: 'account'
729-
dnsZoneName: 'privatelink.openai.azure.com'
730-
resourceIds: concat(
731-
[ openAi.outputs.id ],
732-
useGPT4V ? [ computerVision.outputs.id ] : [],
733-
!useLocalPdfParser ? [ documentIntelligence.outputs.id ] : []
734-
)
735-
}
736737
{
737738
groupId: 'searchService'
738739
dnsZoneName: 'privatelink.search.windows.net'
@@ -745,6 +746,9 @@ var privateEndpointConnections = usePrivateEndpoint ? [
745746
}
746747
] : []
747748

749+
750+
var privateEndpointConnections = concat(otherPrivateEndpointConnections, openAiPrivateEndpointConnection)
751+
748752
module privateEndpoints 'private-endpoints.bicep' = if (usePrivateEndpoint) {
749753
name: 'privateEndpoints'
750754
scope: resourceGroup

0 commit comments

Comments
 (0)