diff --git a/docs/CustomizingAzdParameters.md b/docs/CustomizingAzdParameters.md new file mode 100644 index 000000000..b4e194726 --- /dev/null +++ b/docs/CustomizingAzdParameters.md @@ -0,0 +1,34 @@ +## [Optional]: Customizing resource names + +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. + +## Parameters + +| Name | Type | Default Value | Purpose | +| ------------------------------- | ------ | ----------------- | --------------------------------------------------------------------------------------------------- | +| `AZURE_ENV_NAME` | string | `macae` | Used as a prefix for all resource names to ensure uniqueness across environments. | +| `AZURE_LOCATION` | string | `swedencentral` | Location of the Azure resources. Controls where the infrastructure will be deployed. | +| `AZURE_ENV_OPENAI_LOCATION` | string | `swedencentral` | Specifies the region for OpenAI resource deployment. | +| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the deployment type for the AI model (e.g., Standard, GlobalStandard). | +| `AZURE_ENV_MODEL_NAME` | string | `gpt-4o` | Specifies the name of the GPT model to be deployed. | +| `AZURE_ENV_MODEL_VERSION` | string | `2024-08-06` | Version of the GPT model to be used for deployment. | +| `AZURE_ENV_IMAGETAG` | string | `latest` | Docker image tag used for container deployments. | +| `AZURE_ENV_ENABLE_TELEMETRY` | bool | `true` | Enables telemetry for monitoring and diagnostics. | + +--- + +## How to Set a Parameter + +To customize any of the above values, run the following command **before** `azd up`: + +```bash +azd env set +``` + +**Example:** + +```bash +azd env set AZURE_LOCATION westus2 +``` diff --git a/docs/DeploymentGuide.md b/docs/DeploymentGuide.md index 2b5cc5105..c45603940 100644 --- a/docs/DeploymentGuide.md +++ b/docs/DeploymentGuide.md @@ -134,15 +134,19 @@ Consider the following settings during your deployment to modify specific settin
Configurable Deployment Settings -When you start the deployment, most parameters will have **default values**, but you can update the following settings: - -| **Setting** | **Description** | **Default value** | -| --------------------------------- | ------------------------------------------------------------------------------------------- | ----------------- | -| **Azure Region** | The region where resources will be created. | East US | -| **Secondary Location** | A **less busy** region for **Azure Cosmos DB**, useful in case of availability constraints. | eastus2 | -| **Deployment Type** | Select from a drop-down list. | GlobalStandard | -| **GPT Model** | Choose from **gpt-4, gpt-4o, gpt-4o-mini**. | gpt-4o | -| **GPT Model Deployment Capacity** | Configure capacity for **GPT models**. | 140k | +When you start the deployment, most parameters will have **default values**, but you can update the following settings [here](../docs/CustomizingAzdParameters.md): + +| **Setting** | **Description** | **Default value** | +| ------------------------------ | ------------------------------------------------------------------------------------ | ----------------- | +| **Environment Name** | Used as a prefix for all resource names to ensure uniqueness across environments. | macae | +| **Azure Region** | Location of the Azure resources. Controls where the infrastructure will be deployed. | swedencentral | +| **OpenAI Deployment Location** | Specifies the region for OpenAI resource deployment. | swedencentral | +| **Model Deployment Type** | Defines the deployment type for the AI model (e.g., Standard, GlobalStandard). | GlobalStandard | +| **GPT Model Name** | Specifies the name of the GPT model to be deployed. | gpt-4o | +| **GPT Model Version** | Version of the GPT model to be used for deployment. | 2024-08-06 | +| **Image Tag** | Docker image tag used for container deployments. | latest | +| **Enable Telemetry** | Enables telemetry for monitoring and diagnostics. | true | +
diff --git a/infra/main.bicep b/infra/main.bicep index 9991ad766..b0552b5cc 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -16,6 +16,19 @@ param enableTelemetry bool = true @description('Azure OpenAI Location') param azureOpenAILocation string +@minLength(1) +@description('Name of the GPT model to deploy:') +param gptModelName string = 'gpt-4o' + +param gptModelVersion string = '2024-08-06' + +@minLength(1) +@description('GPT model deployment type:') +param modelDeploymentType string = 'GlobalStandard' + +@description('Set the image tag for the container images used in the solution. Default is "latest".') +param imageTag string = 'latest' + // @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='' // param solutionLocation string = empty(AZURE_LOCATION) ? resourceGroup().location @@ -194,7 +207,7 @@ param containerAppConfiguration containerAppConfigurationType = { containerMemory: '4.0Gi' containerImageRegistryDomain: 'biabcontainerreg.azurecr.io' containerImageName: 'macaebackend' - containerImageTag: 'latest' + containerImageTag: imageTag containerName: 'backend' ingressTargetPort: 8000 maxReplicas: 1 @@ -218,7 +231,7 @@ param webSiteConfiguration webSiteConfigurationType = { location: solutionLocation containerImageRegistryDomain: 'biabcontainerreg.azurecr.io' containerImageName: 'macaefrontend' - containerImageTag: 'latest' + containerImageTag: imageTag containerName: 'backend' tags: tags environmentResourceId: null //Default value set on module configuration @@ -731,10 +744,10 @@ var aiFoundryAiServicesResourceName = aiFoundryAiServicesConfiguration.?name ?? var aiFoundryAIservicesEnabled = aiFoundryAiServicesConfiguration.?enabled ?? true var aiFoundryAiServicesModelDeployment = { format: 'OpenAI' - name: 'gpt-4o' - version: '2024-08-06' + name: gptModelName + version: gptModelVersion sku: { - name: 'GlobalStandard' + name: modelDeploymentType //Curently the capacity is set to 140 for opinanal performance. capacity: aiFoundryAiServicesConfiguration.?modelCapacity ?? 140 } diff --git a/infra/main.bicepparam b/infra/main.bicepparam index 69723341e..5f32de008 100644 --- a/infra/main.bicepparam +++ b/infra/main.bicepparam @@ -1,8 +1,13 @@ using './main.bicep' -param solutionPrefix = null //Type a string value to customize the prefix for your resource names +param solutionPrefix = readEnvironmentVariable('AZURE_ENV_NAME', 'macae') param solutionLocation = readEnvironmentVariable('AZURE_LOCATION', 'swedencentral') param azureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'swedencentral') +param modelDeploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') +param gptModelName = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o') +param gptModelVersion = readEnvironmentVariable('AZURE_ENV_MODEL_VERSION', '2024-08-06') +param imageTag = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest') +param enableTelemetry = bool(readEnvironmentVariable('AZURE_ENV_ENABLE_TELEMETRY', 'true')) param logAnalyticsWorkspaceConfiguration = { dataRetentionInDays: 30 existingWorkspaceResourceId: '' diff --git a/infra/main.waf-aligned.bicepparam b/infra/main.waf-aligned.bicepparam index 0a226da80..ac45cdcf3 100644 --- a/infra/main.waf-aligned.bicepparam +++ b/infra/main.waf-aligned.bicepparam @@ -1,8 +1,13 @@ using './main.bicep' -param solutionPrefix = null //Type a string value to customize the prefix for your resource names +param solutionPrefix = readEnvironmentVariable('AZURE_ENV_NAME', 'macae') param solutionLocation = readEnvironmentVariable('AZURE_LOCATION', 'swedencentral') param azureOpenAILocation = readEnvironmentVariable('AZURE_ENV_OPENAI_LOCATION', 'swedencentral') +param modelDeploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') +param gptModelName = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o') +param gptModelVersion = readEnvironmentVariable('AZURE_ENV_MODEL_VERSION', '2024-08-06') +param imageTag = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest') +param enableTelemetry = bool(readEnvironmentVariable('AZURE_ENV_ENABLE_TELEMETRY', 'true')) param virtualMachineConfiguration = { adminUsername: 'adminuser' adminPassword: 'P@ssw0rd1234'