Skip to content

Commit 18f7b10

Browse files
US:18810- Standardize Bicep Parameters for Code Modernization
1 parent cc64239 commit 18f7b10

3 files changed

Lines changed: 28 additions & 20 deletions

File tree

docs/CustomizingAzdParameters.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22

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

5-
65
> 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.
76
8-
Change the Content Understanding Location (allowed values: Sweden Central, Australia East)
7+
## Parameters
98

10-
```shell
11-
azd env set AZURE_ENV_CU_LOCATION 'swedencentral'
12-
```
9+
| Name | Type | Default Value | Purpose |
10+
| -------------------------------------- | ------- | ---------------- | ---------------------------------------------------------------------------------------------------- |
11+
| `AZURE_ENV_NAME` | string | `'azdtemp'` | Used as a prefix for all resource names to ensure uniqueness across environments. |
12+
| `AZURE_LOCATION` | string | `'japaneast'` | Location of the Azure resources. Controls where the infrastructure will be deployed. |
13+
| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `'GlobalStandard'` | Change the Model Deployment Type (allowed values: Standard, GlobalStandard). |
14+
| `AZURE_ENV_MODEL_NAME` | string | `'gpt-4o'` | Set the Model Name (allowed values: gpt-4o). |
15+
| `AZURE_ENV_MODEL_CAPACITY` | integer | `'200'` | Set the Model Capacity (choose a number based on available GPT model capacity in your subscription). |
16+
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | `'<Existing Workspace Id>'` | Set this if you want to reuse an existing Log Analytics Workspace instead of creating a new one. |
17+
| `AZURE_ENV_IMAGETAG` | string | `'latest'` | Set the Image tag Like (allowed values: latest, dev, hotfix) |
1318

14-
Change the Model Deployment Type (allowed values: Standard, GlobalStandard)
19+
---
1520

16-
```shell
17-
azd env set AZURE_ENV_MODEL_DEPLOYMENT_TYPE Standard
18-
```
21+
## How to Set a Parameter
1922

20-
Set the Model Name (allowed values: gpt-4o)
23+
To customize any of the above values, run the following command **before** `azd up`:
2124

22-
```shell
23-
azd env set AZURE_ENV_MODEL_NAME gpt-4o
25+
```bash
26+
azd env set <PARAMETER_NAME> <VALUE>
2427
```
2528

26-
Change the Model Capacity (choose a number based on available GPT model capacity in your subscription)
29+
**Example:**
2730

28-
```shell
29-
azd env set AZURE_ENV_MODEL_CAPACITY 30
31+
```bash
32+
azd env set AZURE_LOCATION westus2
3033
```
31-

infra/main.bicep

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,22 @@ var safePrefix = length(Prefix) > 20 ? substring(Prefix, 0, 20) : Prefix
3232
@description('Location for all Ai services resources. This location can be different from the resource group location.')
3333
param AzureAiServiceLocation string // The location used for all deployed resources. This location must be in the same region as the resource group.
3434
param capacity int = 5
35+
param deploymentType string = 'GlobalStandard'
36+
param llmModel string = 'gpt-4o'
37+
param imageVersion string = 'latest'
38+
39+
3540

3641
var uniqueId = toLower(uniqueString(subscription().id, safePrefix, resourceGroup().location))
3742
var UniquePrefix = 'cm${padLeft(take(uniqueId, 12), 12, '0')}'
3843
var ResourcePrefix = take('cm${safePrefix}${UniquePrefix}', 15)
39-
var imageVersion = 'latest'
4044
var location = resourceGroup().location
4145
var dblocation = resourceGroup().location
4246
var cosmosdbDatabase = 'cmsadb'
4347
var cosmosdbBatchContainer = 'cmsabatch'
4448
var cosmosdbFileContainer = 'cmsafile'
4549
var cosmosdbLogContainer = 'cmsalog'
46-
var deploymentType = 'GlobalStandard'
4750
var containerName = 'appstorage'
48-
var llmModel = 'gpt-4o'
4951
var storageSkuName = 'Standard_LRS'
5052
var storageContainerName = replace(replace(replace(replace('${ResourcePrefix}cast', '-', ''), '_', ''), '.', ''),'/', '')
5153
var gptModelVersion = '2024-08-06'

infra/main.bicepparam

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
using './main.bicep'
22

3-
param AzureAiServiceLocation = readEnvironmentVariable('AZURE_LOCATION','japaneast')
43
param Prefix = readEnvironmentVariable('AZURE_ENV_NAME','azdtemp')
4+
param AzureAiServiceLocation = readEnvironmentVariable('AZURE_LOCATION','japaneast')
5+
param capacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '200'))
6+
param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard')
7+
param llmModel = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o')
8+
param imageVersion = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest')

0 commit comments

Comments
 (0)