diff --git a/code/backend/batch/utilities/helpers/env_helper.py b/code/backend/batch/utilities/helpers/env_helper.py index 44de8677c..787708d8b 100644 --- a/code/backend/batch/utilities/helpers/env_helper.py +++ b/code/backend/batch/utilities/helpers/env_helper.py @@ -186,7 +186,7 @@ def __load_config(self, **kwargs) -> None: "AZURE_OPENAI_MODEL_NAME", "gpt-4.1" ) - self.AZURE_OPENAI_VISION_MODEL = os.getenv("AZURE_OPENAI_VISION_MODEL", "gpt-4") + self.AZURE_OPENAI_VISION_MODEL = os.getenv("AZURE_OPENAI_VISION_MODEL", "gpt-4.1") self.AZURE_OPENAI_TEMPERATURE = os.getenv("AZURE_OPENAI_TEMPERATURE", "0") self.AZURE_OPENAI_TOP_P = os.getenv("AZURE_OPENAI_TOP_P", "1.0") self.AZURE_OPENAI_MAX_TOKENS = os.getenv("AZURE_OPENAI_MAX_TOKENS", "1000") diff --git a/code/tests/utilities/helpers/test_push_embedder.py b/code/tests/utilities/helpers/test_push_embedder.py index cc6702bb8..4e26a507f 100644 --- a/code/tests/utilities/helpers/test_push_embedder.py +++ b/code/tests/utilities/helpers/test_push_embedder.py @@ -192,7 +192,7 @@ def test_embed_file_advanced_image_processing_uses_vision_model_for_captioning( ): # given env_helper_mock = MagicMock() - env_helper_mock.AZURE_OPENAI_VISION_MODEL = "gpt-4" + env_helper_mock.AZURE_OPENAI_VISION_MODEL = "gpt-4.1" push_embedder = PushEmbedder(MagicMock(), env_helper_mock) source_url = "http://localhost:8080/some-file-name.jpg" diff --git a/docs/LOCAL_DEPLOYMENT.md b/docs/LOCAL_DEPLOYMENT.md index da183db7d..9c29992e4 100644 --- a/docs/LOCAL_DEPLOYMENT.md +++ b/docs/LOCAL_DEPLOYMENT.md @@ -21,6 +21,8 @@ The easiest way to run this accelerator is in a VS Code Dev Containers, which wi * **Important**: Beware that the resources created by this command will incur immediate costs, primarily from the AI Search resource. These resources may accrue costs even if you interrupt the command before it is fully executed. You can run `azd down` or delete the resources manually to avoid unnecessary spending. * You will be prompted to select a subscription, and a location. That location list is based on the [OpenAI model availability table](https://learn.microsoft.com/azure/cognitive-services/openai/concepts/models#model-summary-table-and-region-availability) and may become outdated as availability changes. * If you do, accidentally, chose the wrong location; you will have to ensure that you use `azd down` or delete the Resource Group as the deployment bases the location from this Resource Group. + > **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`. + 1. After the application has been successfully deployed you will see a URL printed to the console. Click that URL to interact with the application in your browser. > NOTE: It may take up to an hour for the application to be fully deployed. If you see a "Python Developer" welcome screen or an error page, then wait a bit and refresh the page. diff --git a/docs/LogAnalyticsReplicationDisable.md b/docs/LogAnalyticsReplicationDisable.md new file mode 100644 index 000000000..f72fddae9 --- /dev/null +++ b/docs/LogAnalyticsReplicationDisable.md @@ -0,0 +1,26 @@ +# 🛠 Handling Log Analytics Workspace Deletion with Replication Enabled + +If redundancy (replication) is enabled for your Log Analytics workspace, you must disable it before deleting the workspace or resource group. Otherwise, deletion will fail. + +## ✅ Steps to Disable Replication Before Deletion +Run the following Azure CLI command. Note: This operation may take about 5 minutes to complete. + +```bash +az resource update --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --set properties.replication.enabled=false +``` + +Replace: +- `{subscriptionId}` → Your Azure subscription ID +- `{resourceGroupName}` → The name of your resource group +- `{logAnalyticsName}` → The name of your Log Analytics workspace + +Optional: Verify replication disabled (should output `false`): +```bash +az resource show --ids "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{logAnalyticsName}" --query properties.replication.enabled -o tsv +``` + +## ✅ After Disabling Replication +You can safely delete: +- The Log Analytics workspace (manual) +- The resource group (manual), or +- All provisioned resources via `azd down` diff --git a/docs/model_configuration.md b/docs/model_configuration.md index 78262db95..3bd443d46 100644 --- a/docs/model_configuration.md +++ b/docs/model_configuration.md @@ -27,9 +27,9 @@ This document outlines the necessary steps and configurations required for setti - `AZURE_OPENAI_VISION_MODEL`: The Azure OpenAI Model Deployment Name - example: `my-gpt-4` - `AZURE_OPENAI_VISION_MODEL_NAME`: The Azure OpenAI Model Name - - example: `gpt-4` + - example: `gpt-4.1` - `AZURE_OPENAI_VISION_MODEL_VERSION`: The Azure OpenAI Model Version - - example: `turbo-2024-04-09` + - example: `2025-04-14` - `AZURE_OPENAI_VISION_MODEL_CAPACITY`: The Tokens per Minute Rate Limit (thousands) - example: `10` diff --git a/infra/main.bicep b/infra/main.bicep index e2a5779a7..1a94a6216 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -151,13 +151,13 @@ param useAdvancedImageProcessing bool = false param advancedImageProcessingMaxImages int = 1 @description('Optional. Azure OpenAI Vision Model Deployment Name.') -param azureOpenAIVisionModel string = 'gpt-4' +param azureOpenAIVisionModel string = 'gpt-4.1' @description('Optional. Azure OpenAI Vision Model Name.') -param azureOpenAIVisionModelName string = 'gpt-4' +param azureOpenAIVisionModelName string = 'gpt-4.1' @description('Optional. Azure OpenAI Vision Model Version.') -param azureOpenAIVisionModelVersion string = 'turbo-2024-04-09' +param azureOpenAIVisionModelVersion string = '2025-04-14' @description('Optional. Azure OpenAI Vision Model Capacity - See here for more info https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/quota.') param azureOpenAIVisionModelCapacity int = 10 @@ -963,26 +963,6 @@ var defaultOpenAiDeployments = [ } ] -var openAiDeployments = concat( - defaultOpenAiDeployments, - useAdvancedImageProcessing - ? [ - { - name: azureOpenAIVisionModel - model: { - format: 'OpenAI' - name: azureOpenAIVisionModelName - version: azureOpenAIVisionModelVersion - } - sku: { - name: 'GlobalStandard' - capacity: azureOpenAIVisionModelCapacity - } - } - ] - : [] -) - module openai 'modules/core/ai/cognitiveservices.bicep' = { name: azureOpenAIResourceName scope: resourceGroup() @@ -992,7 +972,7 @@ module openai 'modules/core/ai/cognitiveservices.bicep' = { tags: allTags kind: 'OpenAI' sku: azureOpenAISkuName - deployments: openAiDeployments + deployments: defaultOpenAiDeployments userAssignedResourceId: managedIdentityModule.outputs.resourceId restrictOutboundNetworkAccess: true allowedFqdnList: concat( diff --git a/infra/main.json b/infra/main.json index 40787124f..8ef6633f7 100644 --- a/infra/main.json +++ b/infra/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "12501246938799564354" + "version": "0.39.26.7824", + "templateHash": "4067372207788717969" } }, "parameters": { @@ -257,21 +257,21 @@ }, "azureOpenAIVisionModel": { "type": "string", - "defaultValue": "gpt-4", + "defaultValue": "gpt-4.1", "metadata": { "description": "Optional. Azure OpenAI Vision Model Deployment Name." } }, "azureOpenAIVisionModelName": { "type": "string", - "defaultValue": "gpt-4", + "defaultValue": "gpt-4.1", "metadata": { "description": "Optional. Azure OpenAI Vision Model Name." } }, "azureOpenAIVisionModelVersion": { "type": "string", - "defaultValue": "turbo-2024-04-09", + "defaultValue": "2025-04-14", "metadata": { "description": "Optional. Azure OpenAI Vision Model Version." } @@ -703,7 +703,6 @@ } } ], - "openAiDeployments": "[concat(variables('defaultOpenAiDeployments'), if(parameters('useAdvancedImageProcessing'), createArray(createObject('name', parameters('azureOpenAIVisionModel'), 'model', createObject('format', 'OpenAI', 'name', parameters('azureOpenAIVisionModelName'), 'version', parameters('azureOpenAIVisionModelVersion')), 'sku', createObject('name', 'GlobalStandard', 'capacity', parameters('azureOpenAIVisionModelCapacity')))), createArray()))]", "enablePrivateNetworkingSpeech": false, "webServerFarmResourceName": "[variables('hostingPlanName')]", "postgresDBFqdn": "[format('{0}.postgres.database.azure.com', variables('postgresResourceName'))]", @@ -785,8 +784,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "18020276250806210552" + "version": "0.39.26.7824", + "templateHash": "16389998095350100208" } }, "definitions": { @@ -14159,8 +14158,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "2476719667076026336" + "version": "0.39.26.7824", + "templateHash": "4195530859454785600" }, "name": "Private DNS Zones", "description": "This module deploys a Private DNS zone." @@ -14394,8 +14393,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "7970120618702385913" + "version": "0.39.26.7824", + "templateHash": "162991390725016416" }, "name": "Private DNS Zone Virtual Network Link", "description": "This module deploys a Private DNS Zone Virtual Network Link." @@ -14606,8 +14605,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "14711550466270476198" + "version": "0.39.26.7824", + "templateHash": "5952316286725027748" }, "name": "Azure Cosmos DB account", "description": "This module deploys an Azure Cosmos DB account. The API used for the account is determined by the child resources that are deployed." @@ -15946,8 +15945,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "475414574956671819" + "version": "0.39.26.7824", + "templateHash": "17961189621407340108" }, "name": "DocumentDB Database Account SQL Databases", "description": "This module deploys a SQL Database in a CosmosDB Account." @@ -16078,8 +16077,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "539150072577739553" + "version": "0.39.26.7824", + "templateHash": "249108184354607538" }, "name": "DocumentDB Database Account SQL Database Containers", "description": "This module deploys a SQL Database Container in a CosmosDB Account." @@ -16332,8 +16331,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "11594995374978159650" + "version": "0.39.26.7824", + "templateHash": "6361709294391707996" }, "name": "DocumentDB Database Account SQL Role Definitions.", "description": "This module deploys a SQL Role Definision in a CosmosDB Account." @@ -16469,8 +16468,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6679465723758483212" + "version": "0.39.26.7824", + "templateHash": "11308421294472813926" }, "name": "DocumentDB Database Account SQL Role Assignments.", "description": "This module deploys a SQL Role Assignment in a CosmosDB Account." @@ -20824,8 +20823,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "3816920806302443496" + "version": "0.39.26.7824", + "templateHash": "5436255191760096437" }, "name": "Key Vaults", "description": "This module deploys a Key Vault." @@ -21839,8 +21838,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "12374060982553367047" + "version": "0.39.26.7824", + "templateHash": "13601768680795987047" }, "name": "Key Vault Secrets", "description": "This module deploys a Key Vault Secret." @@ -22958,7 +22957,7 @@ "value": "[parameters('azureOpenAISkuName')]" }, "deployments": { - "value": "[variables('openAiDeployments')]" + "value": "[variables('defaultOpenAiDeployments')]" }, "userAssignedResourceId": { "value": "[reference('managedIdentityModule').outputs.resourceId.value]" @@ -22992,8 +22991,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "13905430926793013397" + "version": "0.39.26.7824", + "templateHash": "8044963307270176525" } }, "parameters": { @@ -23211,8 +23210,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6417423715320093929" + "version": "0.39.26.7824", + "templateHash": "14376261070114657221" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service." @@ -25598,8 +25597,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "13905430926793013397" + "version": "0.39.26.7824", + "templateHash": "8044963307270176525" } }, "parameters": { @@ -25817,8 +25816,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6417423715320093929" + "version": "0.39.26.7824", + "templateHash": "14376261070114657221" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service." @@ -28205,8 +28204,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "13905430926793013397" + "version": "0.39.26.7824", + "templateHash": "8044963307270176525" } }, "parameters": { @@ -28424,8 +28423,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6417423715320093929" + "version": "0.39.26.7824", + "templateHash": "14376261070114657221" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service." @@ -33747,8 +33746,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "4189507643128548708" + "version": "0.39.26.7824", + "templateHash": "5792200250308580841" } }, "parameters": { @@ -34005,8 +34004,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "7313587832506076335" + "version": "0.39.26.7824", + "templateHash": "1347511588046818300" } }, "definitions": { @@ -35022,8 +35021,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "16983009113856606195" + "version": "0.39.26.7824", + "templateHash": "11666262061409473778" }, "name": "Site App Settings", "description": "This module deploys a Site App Setting." @@ -36057,8 +36056,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "14936600876774578597" + "version": "0.39.26.7824", + "templateHash": "16879216494119194959" } }, "parameters": { @@ -36315,8 +36314,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "7313587832506076335" + "version": "0.39.26.7824", + "templateHash": "1347511588046818300" } }, "definitions": { @@ -37332,8 +37331,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "16983009113856606195" + "version": "0.39.26.7824", + "templateHash": "11666262061409473778" }, "name": "Site App Settings", "description": "This module deploys a Site App Setting." @@ -38374,8 +38373,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "5481585313361513032" + "version": "0.39.26.7824", + "templateHash": "10996245640052014127" } }, "parameters": { @@ -38650,8 +38649,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "15042793764389210286" + "version": "0.39.26.7824", + "templateHash": "17508426375842638682" } }, "parameters": { @@ -39016,8 +39015,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "7313587832506076335" + "version": "0.39.26.7824", + "templateHash": "1347511588046818300" } }, "definitions": { @@ -40033,8 +40032,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "16983009113856606195" + "version": "0.39.26.7824", + "templateHash": "11666262061409473778" }, "name": "Site App Settings", "description": "This module deploys a Site App Setting." @@ -41093,8 +41092,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "10734361934206424489" + "version": "0.39.26.7824", + "templateHash": "13305618921652639897" }, "name": "monitoring-solution", "description": "AVM WAF-compliant monitoring solution that integrates Application Insights with Log Analytics for centralized telemetry, diagnostics, and observability." @@ -46721,8 +46720,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "13905430926793013397" + "version": "0.39.26.7824", + "templateHash": "8044963307270176525" } }, "parameters": { @@ -46940,8 +46939,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6417423715320093929" + "version": "0.39.26.7824", + "templateHash": "14376261070114657221" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service." @@ -49325,8 +49324,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "13905430926793013397" + "version": "0.39.26.7824", + "templateHash": "8044963307270176525" } }, "parameters": { @@ -49544,8 +49543,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6417423715320093929" + "version": "0.39.26.7824", + "templateHash": "14376261070114657221" }, "name": "Cognitive Services", "description": "This module deploys a Cognitive Service." @@ -51985,8 +51984,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "6910614001297538446" + "version": "0.39.26.7824", + "templateHash": "883693756681856266" }, "name": "Storage Accounts", "description": "This module deploys a Storage Account." @@ -54027,8 +54026,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "4306458042701725802" + "version": "0.39.26.7824", + "templateHash": "7481967067901562837" }, "name": "Storage Account blob Services", "description": "This module deploys a Storage Account Blob Service." @@ -54492,8 +54491,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "7642903482354110426" + "version": "0.39.26.7824", + "templateHash": "12374539759649682270" }, "name": "Storage Account Blob Containers", "description": "This module deploys a Storage Account Blob Container." @@ -54722,8 +54721,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "16887180392030951459" + "version": "0.39.26.7824", + "templateHash": "16734288001921596993" }, "name": "Storage Account Queue Services", "description": "This module deploys a Storage Account Queue Service." @@ -55037,8 +55036,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "1377052644867575611" + "version": "0.39.26.7824", + "templateHash": "13997648009268095904" }, "name": "Storage Account Queues", "description": "This module deploys a Storage Account Queue." @@ -55161,8 +55160,8 @@ } }, "dependsOn": [ - "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]", "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]", + "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]", "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]", "managedIdentityModule", "virtualNetwork" @@ -55217,8 +55216,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "13585369753304501446" + "version": "0.39.26.7824", + "templateHash": "5984624121413164254" } }, "parameters": { @@ -55300,8 +55299,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "1988405680907044654" + "version": "0.39.26.7824", + "templateHash": "3478302565653564157" }, "name": "workbook", "description": "AVM WAF-compliant Workbook deployment using Microsoft.Insights resource type. Ensures governance, observability, tagging, and consistency with other monitoring resources." @@ -56659,8 +56658,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.38.33.27573", - "templateHash": "14787191897150155634" + "version": "0.39.26.7824", + "templateHash": "4941871820444850127" } }, "parameters": { diff --git a/infra/main.parameters.json b/infra/main.parameters.json index 57568b922..0d4cf6681 100644 --- a/infra/main.parameters.json +++ b/infra/main.parameters.json @@ -127,13 +127,13 @@ "value": "${ADVANCED_IMAGE_PROCESSING_MAX_IMAGES=1}" }, "azureOpenAIVisionModel": { - "value": "${AZURE_OPENAI_VISION_MODEL=gpt-4}" + "value": "${AZURE_OPENAI_VISION_MODEL=gpt-4.1}" }, "azureOpenAIVisionModelName": { - "value": "${AZURE_OPENAI_VISION_MODEL_NAME=gpt-4}" + "value": "${AZURE_OPENAI_VISION_MODEL_NAME=gpt-4.1}" }, "azureOpenAIVisionModelVersion": { - "value": "${AZURE_OPENAI_VISION_MODEL_VERSION=turbo-2024-04-09}" + "value": "${AZURE_OPENAI_VISION_MODEL_VERSION=2025-04-14}" }, "azureOpenAIVisionModelCapacity": { "value": "${AZURE_OPENAI_VISION_MODEL_CAPACITY=10}" diff --git a/infra/main.waf.parameters.json b/infra/main.waf.parameters.json index e9e851ac6..5e9fd1bbe 100644 --- a/infra/main.waf.parameters.json +++ b/infra/main.waf.parameters.json @@ -127,13 +127,13 @@ "value": "${ADVANCED_IMAGE_PROCESSING_MAX_IMAGES=1}" }, "azureOpenAIVisionModel": { - "value": "${AZURE_OPENAI_VISION_MODEL=gpt-4}" + "value": "${AZURE_OPENAI_VISION_MODEL=gpt-4.1}" }, "azureOpenAIVisionModelName": { - "value": "${AZURE_OPENAI_VISION_MODEL_NAME=gpt-4}" + "value": "${AZURE_OPENAI_VISION_MODEL_NAME=gpt-4.1}" }, "azureOpenAIVisionModelVersion": { - "value": "${AZURE_OPENAI_VISION_MODEL_VERSION=turbo-2024-04-09}" + "value": "${AZURE_OPENAI_VISION_MODEL_VERSION=2025-04-14}" }, "azureOpenAIVisionModelCapacity": { "value": "${AZURE_OPENAI_VISION_MODEL_CAPACITY=10}"