Skip to content

Commit 837cb87

Browse files
feat: Standardize Bicep Parameters for km-generic
2 parents 65a1649 + 6230b4c commit 837cb87

File tree

5 files changed

+56
-59
lines changed

5 files changed

+56
-59
lines changed

documents/CustomizingAzdParameters.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,38 @@
33
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.
44

55

6-
> To override any of the parameters, run `azd env set <key> <value>` 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.
6+
> To override any of the parameters, run `azd env set <PARAMETER_NAME> <VALUE>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 charaters alphanumeric unique name.
77
8-
Change the Content Understanding Location (allowed values: Sweden Central, Australia East)
8+
## Parameters
99

10-
```shell
11-
azd env set AZURE_CONTENT_UNDERSTANDING_LOCATION 'swedencentral'
12-
```
13-
14-
Change the Secondary Location (example: eastus2, westus2, etc.)
15-
16-
```shell
17-
azd env set AZURE_SECONDARY_LOCATION eastus2
18-
```
19-
20-
Change the Model Deployment Type (allowed values: Standard, GlobalStandard)
21-
22-
```shell
23-
azd env set AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE GlobalStandard
24-
```
25-
26-
Set the Model Name (allowed values: gpt-4o-mini, gpt-4o, gpt-4)
10+
| Name | Type | Default Value | Purpose |
11+
| ----------------------------------------- | ------- | ------------------------ | -------------------------------------------------------------------------- |
12+
| `AZURE_LOCATION` | string | ` ` *(empty)* | Sets the Azure region for resource deployment. |
13+
| `AZURE_ENV_NAME` | string | `env_name` | Sets the environment name prefix for all Azure resources. |
14+
| `AZURE_CONTENT_UNDERSTANDING_LOCATION` | string | `swedencentral` | Specifies the region for content understanding resources. |
15+
| `AZURE_SECONDARY_LOCATION` | string | `eastus2` | Specifies a secondary Azure region. |
16+
| `AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). |
17+
| `AZURE_OPEN_AI_DEPLOYMENT_MODEL` | string | `gpt-4o-mini` | Specifies the GPT model name (e.g., `gpt-4`, `gpt-4o-mini`). |
18+
| `AZURE_ENV_MODEL_VERSION` | string | `2024-07-18` | Sets the Azure model version (allowed: `2024-08-06`, etc.). |
19+
| `AZURE_OPENAI_API_VERSION` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI. |
20+
| `AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY` | integer | `30` | Sets the GPT model capacity. |
21+
| `AZURE_OPENAI_EMBEDDING_MODEL` | string | `text-embedding-ada-002` | Sets the name of the embedding model to use. |
22+
| `AZURE_ENV_IMAGETAG` | string | `latest` | Sets the image tag (`latest`, `dev`, `hotfix`, etc.). |
23+
| `AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY` | integer | `80` | Sets the capacity for the embedding model deployment. |
24+
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | ` ` *(empty)* | Reuses an existing Log Analytics Workspace instead of creating a new one. |
2725

28-
```shell
29-
azd env set AZURE_OPEN_AI_DEPLOYMENT_MODEL gpt-4o-mini
30-
```
3126

32-
Change the Model Capacity (choose a number based on available GPT model capacity in your subscription)
3327

34-
```shell
35-
azd env set AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY 30
36-
```
28+
## How to Set a Parameter
3729

38-
Change the Embedding Model
30+
To customize any of the above values, run the following command **before** `azd up`:
3931

40-
```shell
41-
azd env set AZURE_OPENAI_EMBEDDING_MODEL text-embedding-ada-002
32+
```bash
33+
azd env set <PARAMETER_NAME> <VALUE>
4234
```
4335

44-
Change the Embedding Deployment Capacity (choose a number based on available embedding model capacity in your subscription)
45-
46-
```shell
47-
azd env set AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY 80
48-
```
36+
**Example:**
4937

50-
Set the Log Analytics Workspace Id if you need to reuse the existing workspace which is already existing
51-
```shell
52-
azd env set AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>'
38+
```bash
39+
azd env set AZURE_LOCATION westus2
5340
```

documents/DeploymentGuide.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,24 @@ Consider the following settings during your deployment to modify specific settin
103103
<details>
104104
<summary><b>Configurable Deployment Settings</b></summary>
105105

106-
When you start the deployment, most parameters will have **default values**, but you can update the following settings:
107-
108-
| **Setting** | **Description** | **Default value** |
109-
|------------|----------------|------------|
110-
| **Azure Region** | The region where resources will be created. | eastus |
111-
| **Environment Name** | A **3-20 character alphanumeric value** used to generate a unique ID to prefix the resources. | kmtemplate |
112-
| **Azure AI Content Understanding Location** | Select from a drop-down list of values. | swedencentral |
113-
| **Secondary Location** | A **less busy** region for **Azure SQL and Azure Cosmos DB**, useful in case of availability constraints. | eastus2 |
114-
| **Deployment Type** | Select from a drop-down list. | GlobalStandard |
115-
| **GPT Model** | Choose from **gpt-4, gpt-4o, gpt-4o-mini** | gpt-4o-mini |
116-
| **GPT Model Deployment Capacity** | Configure capacity for **GPT models**. | 30k |
117-
| **Embedding Model** | Default: **text-embedding-ada-002**. | text-embedding-ada-002 |
118-
| **Embedding Model Capacity** | Set the capacity for **embedding models**. | 80k |
119-
| **Existing Log analytics workspace** | To reuse the existing Log analytics workspace Id. | |
106+
When you start the deployment, most parameters will have **default values**, but you can update the following settings [here](../documents/CustomizingAzdParameters.md):
107+
108+
| **Setting** | **Description** | **Default value** |
109+
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------- |
110+
| **Azure Region** | The region where resources will be created. | *(empty)* |
111+
| **Environment Name** | A **3–20 character alphanumeric value** used to generate a unique ID to prefix the resources. | env\_name |
112+
| **Azure AI Content Understanding Location** | Region for content understanding resources. | swedencentral |
113+
| **Secondary Location** | A **less busy** region for **Azure SQL and Azure Cosmos DB**, useful in case of availability constraints. | eastus2 |
114+
| **Deployment Type** | Select from a drop-down list (allowed: `Standard`, `GlobalStandard`). | GlobalStandard |
115+
| **GPT Model** | Choose from **gpt-4, gpt-4o, gpt-4o-mini**. | gpt-4o-mini |
116+
| **GPT Model Version** | The version of the selected GPT model. | 2024-07-18 |
117+
| **OpenAI API Version** | The Azure OpenAI API version to use. | 2025-01-01-preview |
118+
| **GPT Model Deployment Capacity** | Configure capacity for **GPT models** (in thousands). | 30k |
119+
| **Embedding Model** | Default: **text-embedding-ada-002**. | text-embedding-ada-002 |
120+
| **Embedding Model Capacity** | Set the capacity for **embedding models** (in thousands). | 80k |
121+
| **Image Tag** | Docker image tag to deploy. Common values: `latest`, `dev`, `hotfix`. | latest\_migrated |
122+
| **Existing Log Analytics Workspace** | To reuse an existing Log Analytics Workspace ID. | *(empty)* |
123+
120124

121125

122126
</details>

infra/main.bicep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ param gptModelName string = 'gpt-4o-mini'
3737
@description('Version of the GPT model to deploy:')
3838
param gptModelVersion string = '2024-07-18'
3939

40-
var azureOpenAIApiVersion = '2025-01-01-preview'
40+
param azureOpenAIApiVersion string = '2025-01-01-preview'
41+
4142

4243
@minValue(10)
4344
@description('Capacity of the GPT deployment:')

infra/main.bicepparam

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ param secondaryLocation = readEnvironmentVariable('AZURE_SECONDARY_LOCATION', 'e
77
param deploymentType = readEnvironmentVariable('AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard')
88
param gptModelName = readEnvironmentVariable('AZURE_OPEN_AI_DEPLOYMENT_MODEL', 'gpt-4o-mini')
99
param gptModelVersion = readEnvironmentVariable('AZURE_ENV_MODEL_VERSION', '2024-07-18')
10+
param azureOpenAIApiVersion = readEnvironmentVariable('AZURE_OPENAI_API_VERSION', '2025-01-01-preview')
1011
param gptDeploymentCapacity = int(readEnvironmentVariable('AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY', '30'))
1112
param embeddingModel = readEnvironmentVariable('AZURE_OPENAI_EMBEDDING_MODEL', 'text-embedding-ada-002')
13+
param imageTag = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest')
1214
param embeddingDeploymentCapacity = int(readEnvironmentVariable('AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY', '80'))
1315
param existingLogAnalyticsWorkspaceId = readEnvironmentVariable('AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID', '')

infra/main.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.36.1.42791",
8-
"templateHash": "14571116812938220669"
8+
"templateHash": "2363441728169448979"
99
}
1010
},
1111
"parameters": {
@@ -71,6 +71,10 @@
7171
"description": "Version of the GPT model to deploy:"
7272
}
7373
},
74+
"azureOpenAIApiVersion": {
75+
"type": "string",
76+
"defaultValue": "2025-01-01-preview"
77+
},
7478
"gptDeploymentCapacity": {
7579
"type": "int",
7680
"defaultValue": 30,
@@ -336,7 +340,6 @@
336340
}
337341
},
338342
"abbrs": "[variables('$fxv#0')]",
339-
"azureOpenAIApiVersion": "2025-01-01-preview",
340343
"solutionLocation": "[if(empty(parameters('AZURE_LOCATION')), resourceGroup().location, parameters('AZURE_LOCATION'))]",
341344
"uniqueId": "[toLower(uniqueString(subscription().id, parameters('environmentName'), variables('solutionLocation')))]",
342345
"solutionPrefix": "[format('km{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]",
@@ -601,7 +604,7 @@
601604
"value": "[parameters('gptModelVersion')]"
602605
},
603606
"azureOpenAIApiVersion": {
604-
"value": "[variables('azureOpenAIApiVersion')]"
607+
"value": "[parameters('azureOpenAIApiVersion')]"
605608
},
606609
"gptDeploymentCapacity": {
607610
"value": "[parameters('gptDeploymentCapacity')]"
@@ -2492,7 +2495,7 @@
24922495
"value": {
24932496
"AZURE_OPEN_AI_DEPLOYMENT_MODEL": "[parameters('gptModelName')]",
24942497
"AZURE_OPEN_AI_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesTarget.value]",
2495-
"AZURE_OPENAI_API_VERSION": "[variables('azureOpenAIApiVersion')]",
2498+
"AZURE_OPENAI_API_VERSION": "[parameters('azureOpenAIApiVersion')]",
24962499
"AZURE_OPENAI_RESOURCE": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesName.value]",
24972500
"AZURE_AI_AGENT_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.projectEndpoint.value]",
24982501
"AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME": "[parameters('gptModelName')]",
@@ -2505,7 +2508,7 @@
25052508
"SQLDB_SERVER": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_sql_db'), '2022-09-01').outputs.sqlServerName.value]",
25062509
"SQLDB_USERNAME": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_sql_db'), '2022-09-01').outputs.sqlDbUser.value]",
25072510
"SQLDB_USER_MID": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity'), '2022-09-01').outputs.managedIdentityBackendAppOutput.value.clientId]",
2508-
"OPENAI_API_VERSION": "[variables('azureOpenAIApiVersion')]",
2511+
"OPENAI_API_VERSION": "[parameters('azureOpenAIApiVersion')]",
25092512
"AZURE_AI_SEARCH_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiSearchTarget.value]",
25102513
"AZURE_AI_SEARCH_API_KEY": "[format('@Microsoft.KeyVault(SecretUri={0}secrets/AZURE-SEARCH-KEY/)', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault'), '2022-09-01').outputs.keyvaultUri.value)]",
25112514
"AZURE_AI_SEARCH_INDEX": "call_transcripts_index",
@@ -3240,15 +3243,15 @@
32403243
},
32413244
"AZURE_OPENAI_API_VERSION": {
32423245
"type": "string",
3243-
"value": "[variables('azureOpenAIApiVersion')]"
3246+
"value": "[parameters('azureOpenAIApiVersion')]"
32443247
},
32453248
"AZURE_OPENAI_RESOURCE": {
32463249
"type": "string",
32473250
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesName.value]"
32483251
},
32493252
"OPENAI_API_VERSION": {
32503253
"type": "string",
3251-
"value": "[variables('azureOpenAIApiVersion')]"
3254+
"value": "[parameters('azureOpenAIApiVersion')]"
32523255
},
32533256
"REACT_APP_LAYOUT_CONFIG": {
32543257
"type": "string",

0 commit comments

Comments
 (0)