From a915d9e7ec1f68b8480d9c7b80773a8c24f12d15 Mon Sep 17 00:00:00 2001 From: Abdul-Microsoft Date: Fri, 27 Jun 2025 14:10:12 +0530 Subject: [PATCH] feat: Merge the Azd Quota check changes from dev to main (#580) * Implemented Log execution time per prompt in Report * updated readme * updated the code * added functions * feat: added fdp changes, updated to use ai agents instead of openai assistants (#566) * initial bicep changes for fdp * update role assignments in bicep * feat: initial fdp changes for client advisor * updated post deployment scripts to use keyless authentication * rebuilt main.json * fix configuration handling and error checking in backend services * updated unit tests * Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files. * refactor: couple of typo fix (#570) * initial bicep changes for fdp * update role assignments in bicep * feat: initial fdp changes for client advisor * updated post deployment scripts to use keyless authentication * rebuilt main.json * fix configuration handling and error checking in backend services * updated unit tests * Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files. * fix: correct variable names for managed identity and AI foundry in scripts and templates * feat: quota check during azd up (#579) * quota-check-during azd up * updated bicep and parameter json * fix: There is no progress/Process message when deleting chat history from popup (#578) * feat: FDP changes, Updation to use AI agents (#571) * Implemented Log execution time per prompt in Report * updated readme * updated the code * added functions * feat: added fdp changes, updated to use ai agents instead of openai assistants (#566) * initial bicep changes for fdp * update role assignments in bicep * feat: initial fdp changes for client advisor * updated post deployment scripts to use keyless authentication * rebuilt main.json * fix configuration handling and error checking in backend services * updated unit tests * Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files. * refactor: couple of typo fix (#570) * initial bicep changes for fdp * update role assignments in bicep * feat: initial fdp changes for client advisor * updated post deployment scripts to use keyless authentication * rebuilt main.json * fix configuration handling and error checking in backend services * updated unit tests * Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files. * fix: correct variable names for managed identity and AI foundry in scripts and templates --------- Co-authored-by: Rohini-Microsoft Co-authored-by: Avijit-Microsoft Co-authored-by: Harsh-Microsoft * bug fix(#19849) --------- Co-authored-by: Prajwal-Microsoft Co-authored-by: Ragini-Microsoft Co-authored-by: Rohini-Microsoft Co-authored-by: Avijit-Microsoft Co-authored-by: Harsh-Microsoft * updated openai version (#581) * deleted params --------- Co-authored-by: Rohini-Microsoft Co-authored-by: Avijit-Microsoft Co-authored-by: Harsh-Microsoft Co-authored-by: Priyanka-Microsoft Co-authored-by: Bangarraju-Microsoft Co-authored-by: Prajwal-Microsoft Co-authored-by: Ragini-Microsoft --- infra/main.bicep | 23 ++++++++--- infra/main.bicepparam | 14 ------- infra/main.parameters.json | 39 +++++++++++++++++++ .../ChatHistory/ChatHistoryPanel.tsx | 2 + 4 files changed, 59 insertions(+), 19 deletions(-) delete mode 100644 infra/main.bicepparam create mode 100644 infra/main.parameters.json diff --git a/infra/main.bicep b/infra/main.bicep index 9edebe267..3a3e65a30 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -10,7 +10,7 @@ param environmentName string param existingLogAnalyticsWorkspaceId string = '' @description('CosmosDB Location') -param cosmosLocation string +param cosmosLocation string = 'eastus2' @minLength(1) @description('GPT model deployment type:') @@ -33,7 +33,7 @@ param azureOpenaiAPIVersion string = '2025-04-01-preview' @description('Capacity of the GPT deployment:') // You can increase this, but capacity is limited per model/region, so you will get errors if you go over // https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits -param gptDeploymentCapacity int = 30 +param gptDeploymentCapacity int = 200 @minLength(1) @description('Name of the Text Embedding model to deploy:') @@ -53,14 +53,27 @@ param imageTag string = 'latest' //restricting to these regions because assistants api for gpt-4o-mini is available only in these regions @allowed(['australiaeast','eastus', 'eastus2','francecentral','japaneast','swedencentral','uksouth', 'westus', 'westus3']) -@description('Azure OpenAI Location') -param AzureOpenAILocation string = 'eastus2' +// @description('Azure OpenAI Location') +// param AzureOpenAILocation string = 'eastus2' + +@metadata({ + azd:{ + type: 'location' + usageName: [ + 'OpenAI.GlobalStandard.gpt-4o-mini,200' + 'OpenAI.Standard.text-embedding-ada-002,80' + ] + } +}) +@description('Location for AI Foundry deployment. This is the location where the AI Foundry resources will be deployed.') +param aiDeploymentsLocation string @description('Set this if you want to deploy to a different region than the resource group. Otherwise, it will use the resource group location by default.') param AZURE_LOCATION string='' var solutionLocation = empty(AZURE_LOCATION) ? resourceGroup().location : AZURE_LOCATION var uniqueId = toLower(uniqueString(environmentName, subscription().id, solutionLocation)) + var solutionPrefix = 'ca${padLeft(take(uniqueId, 12), 12, '0')}' // Load the abbrevations file required to name the azure resources. @@ -133,7 +146,7 @@ module aifoundry 'deploy_ai_foundry.bicep' = { name: 'deploy_ai_foundry' params: { solutionName: solutionPrefix - solutionLocation: AzureOpenAILocation + solutionLocation: aiDeploymentsLocation keyVaultName: keyvaultModule.outputs.keyvaultName deploymentType: deploymentType gptModelName: gptModelName diff --git a/infra/main.bicepparam b/infra/main.bicepparam deleted file mode 100644 index f0ed4b2ca..000000000 --- a/infra/main.bicepparam +++ /dev/null @@ -1,14 +0,0 @@ -using './main.bicep' - -param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', 'byocatemplate') -param cosmosLocation = readEnvironmentVariable('AZURE_ENV_COSMOS_LOCATION', 'eastus2') -param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') -param gptModelName = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o-mini') -param azureOpenaiAPIVersion = readEnvironmentVariable('AZURE_ENV_MODEL_VERSION', '2025-04-01-preview') -param gptDeploymentCapacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '30')) -param embeddingModel = readEnvironmentVariable('AZURE_ENV_EMBEDDING_MODEL_NAME', 'text-embedding-ada-002') -param embeddingDeploymentCapacity = int(readEnvironmentVariable('AZURE_ENV_EMBEDDING_MODEL_CAPACITY', '80')) -param imageTag = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest') -param AzureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'eastus2') -param AZURE_LOCATION = readEnvironmentVariable('AZURE_LOCATION', '') -param existingLogAnalyticsWorkspaceId = readEnvironmentVariable('AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID', '') diff --git a/infra/main.parameters.json b/infra/main.parameters.json new file mode 100644 index 000000000..a9a35d824 --- /dev/null +++ b/infra/main.parameters.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "environmentName": { + "value": "${AZURE_ENV_NAME}" + }, + "cosmosLocation": { + "value": "${AZURE_ENV_COSMOS_LOCATION}" + }, + "deploymentType": { + "value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}" + }, + "gptModelName": { + "value": "${AZURE_ENV_MODEL_NAME}" + }, + "azureOpenaiAPIVersion": { + "value": "${AZURE_ENV_MODEL_VERSION}" + }, + "gptDeploymentCapacity": { + "value": "${AZURE_ENV_MODEL_CAPACITY}" + }, + "embeddingModel": { + "value": "${AZURE_ENV_EMBEDDING_MODEL_NAME}" + }, + "embeddingDeploymentCapacity": { + "value": "${AZURE_ENV_EMBEDDING_MODEL_CAPACITY}" + }, + "imageTag": { + "value": "${AZURE_ENV_IMAGETAG}" + }, + "location": { + "value": "${AZURE_LOCATION}" + }, + "existingLogAnalyticsWorkspaceId": { + "value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}" + } + } +} \ No newline at end of file diff --git a/src/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx b/src/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx index 1b4be3ebf..798e8a35f 100644 --- a/src/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx +++ b/src/App/frontend/src/components/ChatHistory/ChatHistoryPanel.tsx @@ -87,6 +87,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) { const onClearAllChatHistory = async () => { setClearing(true) + appStateContext?.dispatch({ type: 'TOGGLE_LOADER' }); const response = await historyDeleteAll() if (!response.ok) { setClearingError(true) @@ -94,6 +95,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) { appStateContext?.dispatch({ type: 'DELETE_CHAT_HISTORY' }) toggleClearAllDialog() } + appStateContext?.dispatch({ type: 'TOGGLE_LOADER' }); setClearing(false) }