diff --git a/infra/main.bicep b/infra/main.bicep index 64820a7d..a94bb90f 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -565,7 +565,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6 } { name: 'Application:Services:AzureAISearch:Endpoint' - value: 'https://${avmSearchSearchServices.outputs.name}.search.windows.net' + value: 'https://${avmSearchSearchServices.name}.search.windows.net' } { name: 'KernelMemory:Services:AzureAIDocIntel:Auth' @@ -581,7 +581,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6 } { name: 'KernelMemory:Services:AzureAISearch:Endpoint' - value: 'https://${avmSearchSearchServices.outputs.name}.search.windows.net' + value: 'https://${avmSearchSearchServices.name}.search.windows.net' } { name: 'KernelMemory:Services:AzureBlobs:Account' @@ -744,8 +744,17 @@ module avmStorageAccount 'br/public:avm/res/storage/storage-account:0.20.0' = { // ========== AI Foundry: AI Search ========== // var aiSearchName = 'srch-${solutionSuffix}' -module avmSearchSearchServices 'br/public:avm/res/search/search-service:0.11.1' = { - name: take('avm.res.cognitive-search-services.${aiSearchName}', 64) +resource avmSearchSearchServices 'Microsoft.Search/searchServices@2024-06-01-preview' = { + name: aiSearchName + location: solutionLocation + sku: { + name: enableScalability ? 'standard' : 'basic' + } +} + +// Separate module for Search Service to enable managed identity and update other properties, as this reduces deployment time +module avmSearchSearchServicesUpdate 'br/public:avm/res/search/search-service:0.11.1' = { + name: take('avm.res.search-services-identity.${aiSearchName}', 64) params: { name: aiSearchName tags: tags @@ -790,6 +799,9 @@ module avmSearchSearchServices 'br/public:avm/res/search/search-service:0.11.1' ] : [] } + dependsOn: [ + avmSearchSearchServices + ] } // ========== Cognitive Services - OpenAI module ========== // @@ -1042,7 +1054,7 @@ output AZURE_COGNITIVE_SERVICE_NAME string = documentIntelligence.outputs.name output AZURE_COGNITIVE_SERVICE_ENDPOINT string = documentIntelligence.outputs.endpoint @description('Contains Azure Search Service Name.') -output AZURE_SEARCH_SERVICE_NAME string = avmSearchSearchServices.outputs.name +output AZURE_SEARCH_SERVICE_NAME string = avmSearchSearchServices.name @description('Contains Azure AKS Name.') output AZURE_AKS_NAME string = managedCluster.outputs.name @@ -1060,7 +1072,7 @@ output AZURE_OPENAI_SERVICE_NAME string = avmOpenAi.outputs.name output AZURE_OPENAI_SERVICE_ENDPOINT string = avmOpenAi.outputs.endpoint @description('Contains Azure Search Service Endpoint.') -output AZ_SEARCH_SERVICE_ENDPOINT string = avmSearchSearchServices.outputs.name +output AZ_SEARCH_SERVICE_ENDPOINT string = avmSearchSearchServices.name @description('Contains Azure GPT-4o Model Deployment Name.') output AZ_GPT4O_MODEL_ID string = gptModelDeployment.deploymentName diff --git a/infra/main.json b/infra/main.json index 74fc6011..85857e3c 100644 --- a/infra/main.json +++ b/infra/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.36.177.2456", - "templateHash": "16347082498493141517" + "version": "0.40.2.10011", + "templateHash": "8417814553440700358" } }, "parameters": { @@ -302,6 +302,15 @@ "tags": "[shallowMerge(createArray(resourceGroup().tags, parameters('tags'), createObject('TemplateName', 'DKM', 'Type', if(parameters('enablePrivateNetworking'), 'WAF', 'Non-WAF'), 'CreatedBy', parameters('createdBy'), 'DeploymentName', deployment().name)))]" } }, + "avmSearchSearchServices": { + "type": "Microsoft.Search/searchServices", + "apiVersion": "2024-06-01-preview", + "name": "[variables('aiSearchName')]", + "location": "[variables('solutionLocation')]", + "sku": { + "name": "[if(parameters('enableScalability'), 'standard', 'basic')]" + } + }, "avmPrivateDnsZones": { "copy": { "name": "avmPrivateDnsZones", @@ -311,7 +320,7 @@ }, "condition": "[parameters('enablePrivateNetworking')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[format('dns-zone-{0}', copyIndex())]", "properties": { "expressionEvaluationOptions": { @@ -3478,7 +3487,7 @@ "logAnalyticsWorkspace": { "condition": "[and(parameters('enableMonitoring'), not(variables('useExistingLogAnalytics')))]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.operational-insights.workspace.{0}', variables('logAnalyticsWorkspaceResourceName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -6584,7 +6593,7 @@ "virtualNetwork": { "condition": "[parameters('enablePrivateNetworking')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('module.virtualNetwork.{0}', variables('solutionSuffix')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -6621,8 +6630,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.36.177.2456", - "templateHash": "7116469417351280182" + "version": "0.40.2.10011", + "templateHash": "5819780095460630914" } }, "definitions": { @@ -7041,7 +7050,7 @@ }, "condition": "[not(empty(tryGet(parameters('subnets')[copyIndex()], 'networkSecurityGroup')))]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.network.network-security-group.{0}.{1}', tryGet(parameters('subnets')[copyIndex()], 'networkSecurityGroup', 'name'), parameters('resourceSuffix')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -7693,7 +7702,7 @@ }, "virtualNetwork": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.network.virtual-network.{0}', parameters('name')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -9424,7 +9433,7 @@ "bastionHost": { "condition": "[parameters('enablePrivateNetworking')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.network.bastion-host.{0}', variables('bastionHostName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -10743,7 +10752,7 @@ "jumpboxVM": { "condition": "[parameters('enablePrivateNetworking')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.compute.virtual-machine.{0}', variables('jumpboxVmName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -19086,7 +19095,7 @@ }, "userAssignedIdentity": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.managed-identity.user-assigned-identity.{0}', variables('userAssignedIdentityResourceName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -19568,7 +19577,7 @@ }, "avmContainerRegistry": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[format('avmContainerRegistry-{0}', uniqueString('avmContainerRegistry', deployment().name))]", "properties": { "expressionEvaluationOptions": { @@ -19611,8 +19620,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.36.177.2456", - "templateHash": "11092248228709008584" + "version": "0.40.2.10011", + "templateHash": "11752366541769527004" }, "name": "Container Registry Module" }, @@ -19748,7 +19757,7 @@ "resources": { "avmContainerRegistry": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[parameters('acrName')]", "properties": { "expressionEvaluationOptions": { @@ -22817,7 +22826,7 @@ }, "avmCosmosDB": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.cosmos-{0}', variables('solutionSuffix')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -26651,7 +26660,7 @@ }, "avmAppConfig": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.app-configuration.configuration-store.{0}', variables('appConfigName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -26723,11 +26732,11 @@ }, { "name": "Application:Services:PersistentStorage:CosmosMongo:ConnectionString", - "value": "[listOutputsWithSecureValues('avmCosmosDB', '2022-09-01').primaryReadWriteConnectionString]" + "value": "[listOutputsWithSecureValues('avmCosmosDB', '2025-04-01').primaryReadWriteConnectionString]" }, { "name": "Application:Services:AzureAISearch:Endpoint", - "value": "[format('https://{0}.search.windows.net', reference('avmSearchSearchServices').outputs.name.value)]" + "value": "[format('https://{0}.search.windows.net', variables('aiSearchName'))]" }, { "name": "KernelMemory:Services:AzureAIDocIntel:Auth", @@ -26743,7 +26752,7 @@ }, { "name": "KernelMemory:Services:AzureAISearch:Endpoint", - "value": "[format('https://{0}.search.windows.net', reference('avmSearchSearchServices').outputs.name.value)]" + "value": "[format('https://{0}.search.windows.net', variables('aiSearchName'))]" }, { "name": "KernelMemory:Services:AzureBlobs:Account", @@ -28780,7 +28789,7 @@ "avmAppConfigUpdated": { "condition": "[parameters('enablePrivateNetworking')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.app-configuration.configuration-store-update.{0}', variables('appConfigName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -30795,7 +30804,7 @@ }, "avmStorageAccount": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.storage.storage-account.{0}', variables('storageAccountName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -36558,10 +36567,10 @@ "virtualNetwork" ] }, - "avmSearchSearchServices": { + "avmSearchSearchServicesUpdate": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", - "name": "[take(format('avm.res.cognitive-search-services.{0}', variables('aiSearchName')), 64)]", + "apiVersion": "2025-04-01", + "name": "[take(format('avm.res.search-services-identity.{0}', variables('aiSearchName')), 64)]", "properties": { "expressionEvaluationOptions": { "scope": "inner" @@ -38905,6 +38914,7 @@ }, "dependsOn": [ "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').search)]", + "avmSearchSearchServices", "logAnalyticsWorkspace", "userAssignedIdentity", "virtualNetwork" @@ -38912,7 +38922,7 @@ }, "avmOpenAi": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.cognitiveservices.account.{0}', variables('openAiAccountName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -41511,7 +41521,7 @@ }, "documentIntelligence": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.cognitiveservices.account.{0}', variables('docIntelAccountName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -44099,7 +44109,7 @@ }, "managedCluster": { "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.container-service.managed-cluster.aks-{0}', variables('solutionSuffix')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -47436,7 +47446,7 @@ "applicationInsights": { "condition": "[parameters('enableMonitoring')]", "type": "Microsoft.Resources/deployments", - "apiVersion": "2022-09-01", + "apiVersion": "2025-04-01", "name": "[take(format('avm.res.insights.component.{0}', variables('applicationInsightsResourceName')), 64)]", "properties": { "expressionEvaluationOptions": { @@ -48248,7 +48258,7 @@ "metadata": { "description": "Contains Azure Search Service Name." }, - "value": "[reference('avmSearchSearchServices').outputs.name.value]" + "value": "[variables('aiSearchName')]" }, "AZURE_AKS_NAME": { "type": "string", @@ -48290,7 +48300,7 @@ "metadata": { "description": "Contains Azure Search Service Endpoint." }, - "value": "[reference('avmSearchSearchServices').outputs.name.value]" + "value": "[variables('aiSearchName')]" }, "AZ_GPT4O_MODEL_ID": { "type": "string",