Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docs/CustomizingAzdParameters.md
Original file line number Diff line number Diff line change
@@ -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 <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 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 <PARAMETER_NAME> <VALUE>
```

**Example:**

```bash
azd env set AZURE_LOCATION westus2
```
22 changes: 13 additions & 9 deletions docs/DeploymentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,19 @@ Consider the following settings during your deployment to modify specific settin
<details>
<summary><b>Configurable Deployment Settings</b></summary>

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 |


</details>

Expand Down
23 changes: 18 additions & 5 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
7 changes: 6 additions & 1 deletion infra/main.bicepparam
Original file line number Diff line number Diff line change
@@ -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: ''
Expand Down
7 changes: 6 additions & 1 deletion infra/main.waf-aligned.bicepparam
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Loading