From 0f8162ec97018b627fa8d6bf102a4c809ad868c8 Mon Sep 17 00:00:00 2001 From: "Vishal Shinde (Persistent Systems Inc)" Date: Tue, 3 Jun 2025 16:02:41 +0530 Subject: [PATCH 1/5] US-18810 changes --- docs/CustomizingAzdParameters.md | 33 +++++++++++++++++--------------- infra/main.bicep | 4 ++-- infra/main.bicepparam | 6 ++++-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/docs/CustomizingAzdParameters.md b/docs/CustomizingAzdParameters.md index 2585336..f575114 100644 --- a/docs/CustomizingAzdParameters.md +++ b/docs/CustomizingAzdParameters.md @@ -2,28 +2,31 @@ By default this template will use the environment name as the prefix to prevent naming collisions within Azure. The parameters below show the default values. You only need to run the statements below if you need to change the values. - > To override any of the parameters, run `azd env set ` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 characters alphanumeric unique name. -Change the Model Deployment Type (allowed values: Standard, GlobalStandard) +## Parameters -```shell -azd env set AZURE_ENV_MODEL_DEPLOYMENT_TYPE Standard -``` +| Name | Type | Default Value | Purpose | +| -------------------------------------- | ------- | ---------------- | ---------------------------------------------------------------------------------------------------- | +| `AZURE_ENV_NAME` | string | `azdtemp` | Used as a prefix for all resource names to ensure uniqueness across environments. | +| `AZURE_LOCATION` | string | `japaneast` | Location of the Azure resources. Controls where the infrastructure will be deployed. | +| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Change the Model Deployment Type (allowed values: Standard, GlobalStandard). | +| `AZURE_ENV_MODEL_NAME` | string | `gpt-4o` | Set the Model Name (allowed values: gpt-4o). | +| `AZURE_ENV_MODEL_CAPACITY` | integer | `200` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). | +| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | *(optional)* | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. | -Set the Model Name (allowed values: gpt-4) +--- -```shell -azd env set AZURE_ENV_MODEL_NAME gpt-4 -``` +## How to Set a Parameter -Change the Model Capacity (choose a number based on available GPT model capacity in your subscription) +To customize any of the above values, run the following command **before** `azd up`: -```shell -azd env set AZURE_ENV_MODEL_CAPACITY 30 +```bash +azd env set ``` -Set the Log Analytics Workspace Id if you need to reuse the existing workspace which is already existing -```shell -azd env set AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID '' +**Example:** + +```bash +azd env set AZURE_LOCATION westus2 ``` diff --git a/infra/main.bicep b/infra/main.bicep index 40b02d9..38ffde6 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -32,6 +32,8 @@ var safePrefix = length(Prefix) > 20 ? substring(Prefix, 0, 20) : Prefix @description('Location for all Ai services resources. This location can be different from the resource group location.') param AzureAiServiceLocation string // The location used for all deployed resources. This location must be in the same region as the resource group. param capacity int = 5 +param deploymentType string = 'GlobalStandard' +param llmModel string = 'gpt-4o' param existingLogAnalyticsWorkspaceId string = '' @@ -45,9 +47,7 @@ var cosmosdbDatabase = 'cmsadb' var cosmosdbBatchContainer = 'cmsabatch' var cosmosdbFileContainer = 'cmsafile' var cosmosdbLogContainer = 'cmsalog' -var deploymentType = 'GlobalStandard' var containerName = 'appstorage' -var llmModel = 'gpt-4o' var storageSkuName = 'Standard_LRS' var storageContainerName = replace(replace(replace(replace('${ResourcePrefix}cast', '-', ''), '_', ''), '.', ''),'/', '') var gptModelVersion = '2024-08-06' diff --git a/infra/main.bicepparam b/infra/main.bicepparam index 4ca1065..adde5b0 100644 --- a/infra/main.bicepparam +++ b/infra/main.bicepparam @@ -1,5 +1,7 @@ using './main.bicep' -param AzureAiServiceLocation = readEnvironmentVariable('AZURE_LOCATION','japaneast') param Prefix = readEnvironmentVariable('AZURE_ENV_NAME','azdtemp') -param existingLogAnalyticsWorkspaceId = readEnvironmentVariable('AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID', '') +param AzureAiServiceLocation = readEnvironmentVariable('AZURE_LOCATION','japaneast') +param capacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '200')) +param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') +param llmModel = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o') From 00a3db087d7fabc8458650163447b019eba47ba1 Mon Sep 17 00:00:00 2001 From: "Vishal Shinde (Persistent Systems Inc)" Date: Tue, 3 Jun 2025 16:18:07 +0530 Subject: [PATCH 2/5] added AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID parameter in main.bicepparma file --- infra/main.bicepparam | 1 + 1 file changed, 1 insertion(+) diff --git a/infra/main.bicepparam b/infra/main.bicepparam index adde5b0..f8c5c50 100644 --- a/infra/main.bicepparam +++ b/infra/main.bicepparam @@ -5,3 +5,4 @@ param AzureAiServiceLocation = readEnvironmentVariable('AZURE_LOCATION','japanea param capacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '200')) param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') param llmModel = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o') +param existingLogAnalyticsWorkspaceId = readEnvironmentVariable('AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID', '') From aa4568237f47f86716b5a44c9a875e6498478eeb Mon Sep 17 00:00:00 2001 From: "Vishal Shinde (Persistent Systems Inc)" Date: Tue, 3 Jun 2025 19:04:43 +0530 Subject: [PATCH 3/5] added existingLogAnalyticsWorkspaceId parameter --- docs/CustomizingAzdParameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CustomizingAzdParameters.md b/docs/CustomizingAzdParameters.md index f575114..d4a7b81 100644 --- a/docs/CustomizingAzdParameters.md +++ b/docs/CustomizingAzdParameters.md @@ -13,7 +13,7 @@ By default this template will use the environment name as the prefix to prevent | `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Change the Model Deployment Type (allowed values: Standard, GlobalStandard). | | `AZURE_ENV_MODEL_NAME` | string | `gpt-4o` | Set the Model Name (allowed values: gpt-4o). | | `AZURE_ENV_MODEL_CAPACITY` | integer | `200` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). | -| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | *(optional)* | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. | +| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `''` | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. | --- From a5f82253c86b55018e7f6068b3c9c3a4d65fe258 Mon Sep 17 00:00:00 2001 From: "Vishal Shinde (Persistent Systems Inc)" Date: Tue, 3 Jun 2025 19:08:21 +0530 Subject: [PATCH 4/5] changes --- docs/CustomizingAzdParameters.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/CustomizingAzdParameters.md b/docs/CustomizingAzdParameters.md index d4a7b81..2fadeab 100644 --- a/docs/CustomizingAzdParameters.md +++ b/docs/CustomizingAzdParameters.md @@ -8,11 +8,11 @@ By default this template will use the environment name as the prefix to prevent | Name | Type | Default Value | Purpose | | -------------------------------------- | ------- | ---------------- | ---------------------------------------------------------------------------------------------------- | -| `AZURE_ENV_NAME` | string | `azdtemp` | Used as a prefix for all resource names to ensure uniqueness across environments. | -| `AZURE_LOCATION` | string | `japaneast` | Location of the Azure resources. Controls where the infrastructure will be deployed. | -| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Change the Model Deployment Type (allowed values: Standard, GlobalStandard). | -| `AZURE_ENV_MODEL_NAME` | string | `gpt-4o` | Set the Model Name (allowed values: gpt-4o). | -| `AZURE_ENV_MODEL_CAPACITY` | integer | `200` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). | +| `AZURE_ENV_NAME` | string | `'azdtemp'` | Used as a prefix for all resource names to ensure uniqueness across environments. | +| `AZURE_LOCATION` | string | `'japaneast'` | Location of the Azure resources. Controls where the infrastructure will be deployed. | +| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `'GlobalStandard'` | Change the Model Deployment Type (allowed values: Standard, GlobalStandard). | +| `AZURE_ENV_MODEL_NAME` | string | `'gpt-4o'` | Set the Model Name (allowed values: gpt-4o). | +| `AZURE_ENV_MODEL_CAPACITY` | integer | `'200'` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). | | `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `''` | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. | --- From 9d2d120a7d2cb2c5dfc9ffdca8c823a562c3b2f1 Mon Sep 17 00:00:00 2001 From: "Vishal Shinde (Persistent Systems Inc)" Date: Wed, 4 Jun 2025 12:36:50 +0530 Subject: [PATCH 5/5] added image tage parameter --- docs/CustomizingAzdParameters.md | 1 + infra/main.bicep | 3 ++- infra/main.bicepparam | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CustomizingAzdParameters.md b/docs/CustomizingAzdParameters.md index 2fadeab..48b146d 100644 --- a/docs/CustomizingAzdParameters.md +++ b/docs/CustomizingAzdParameters.md @@ -14,6 +14,7 @@ By default this template will use the environment name as the prefix to prevent | `AZURE_ENV_MODEL_NAME` | string | `'gpt-4o'` | Set the Model Name (allowed values: gpt-4o). | | `AZURE_ENV_MODEL_CAPACITY` | integer | `'200'` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). | | `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `''` | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. | +| `AZURE_ENV_IMAGETAG` | string | `'latest'` | Set the Image tag Like (allowed values: latest, dev, hotfix) | --- diff --git a/infra/main.bicep b/infra/main.bicep index 38ffde6..dd153ee 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -34,13 +34,14 @@ param AzureAiServiceLocation string // The location used for all deployed resou param capacity int = 5 param deploymentType string = 'GlobalStandard' param llmModel string = 'gpt-4o' +param imageVersion string = 'latest' + param existingLogAnalyticsWorkspaceId string = '' var uniqueId = toLower(uniqueString(subscription().id, safePrefix, resourceGroup().location)) var UniquePrefix = 'cm${padLeft(take(uniqueId, 12), 12, '0')}' var ResourcePrefix = take('cm${safePrefix}${UniquePrefix}', 15) -var imageVersion = 'latest' var location = resourceGroup().location var dblocation = resourceGroup().location var cosmosdbDatabase = 'cmsadb' diff --git a/infra/main.bicepparam b/infra/main.bicepparam index f8c5c50..d337bc1 100644 --- a/infra/main.bicepparam +++ b/infra/main.bicepparam @@ -5,4 +5,5 @@ param AzureAiServiceLocation = readEnvironmentVariable('AZURE_LOCATION','japanea param capacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '200')) param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') param llmModel = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o') +param imageVersion = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest') param existingLogAnalyticsWorkspaceId = readEnvironmentVariable('AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID', '')