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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-waf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters \
azureOpenAILocation='${{ env.AZURE_LOCATION }}' \
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
virtualMachineConfiguration='{"adminUsername": "adminuser", "adminPassword": "P@ssw0rd1234"}' \
logAnalyticsWorkspaceConfiguration='{"existingWorkspaceResourceId": ""}'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters \
azureOpenAILocation='${{ env.AZURE_LOCATION }}' \
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
logAnalyticsWorkspaceConfiguration='{"dataRetentionInDays": 30, "existingWorkspaceResourceId": ""}' \
applicationInsightsConfiguration='{"retentionInDays": 30}' \
virtualNetworkConfiguration='{"enabled": false}' \
Expand Down
18 changes: 1 addition & 17 deletions azure.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
name: multi-agent-custom-automation-engine-solution-accelerator
metadata:
template: [email protected]
hooks:
preprovision:
posix:
shell: sh
run: >
chmod u+r+x ./infra/scripts/validate_model_deployment_quota.sh; chmod u+r+x ./infra/scripts/validate_model_quota.sh; ./infra/scripts/validate_model_deployment_quota.sh --subscription "$AZURE_SUBSCRIPTION_ID" --location "${AZURE_ENV_OPENAI_LOCATION:-swedencentral}" --models-parameter "aiModelDeployments"
interactive: false
continueOnError: false

windows:
shell: pwsh
run: >
$location = if ($env:AZURE_ENV_OPENAI_LOCATION) { $env:AZURE_ENV_OPENAI_LOCATION } else { "swedencentral" };
./infra/scripts/validate_model_deployment_quotas.ps1 -SubscriptionId $env:AZURE_SUBSCRIPTION_ID -Location $location -ModelsParameter "aiModelDeployments"
interactive: false
continueOnError: false
template: [email protected]
7 changes: 6 additions & 1 deletion docs/CustomizingAzdParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ By default this template will use the environment name as the prefix to prevent
| `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. |

| `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. |
---

## How to Set a Parameter
Expand All @@ -27,6 +27,11 @@ To customize any of the above values, run the following command **before** `azd
azd env set <PARAMETER_NAME> <VALUE>
```

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 '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>'
```

**Example:**

```bash
Expand Down
44 changes: 30 additions & 14 deletions infra/main.bicep
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
metadata name = 'Multi-Agent Custom Automation Engine'
metadata description = 'This module contains the resources required to deploy the Multi-Agent Custom Automation Engine solution accelerator for both Sandbox environments and WAF aligned environments.'

@description('Set to true if you want to deploy WAF-aligned infrastructure.')
param useWafAlignedArchitecture bool

@description('Optional. The prefix to add in the default names given to all deployed Azure resources.')
@maxLength(19)
param solutionPrefix string = 'macae${uniqueString(deployer().objectId, deployer().tenantId, subscription().subscriptionId, resourceGroup().id)}'
Expand All @@ -11,10 +14,20 @@ param solutionLocation string = resourceGroup().location
@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true

param existingLogAnalyticsWorkspaceId string = ''

// Restricting deployment to only supported Azure OpenAI regions validated with GPT-4o model
@metadata({
azd : {
type: 'location'
usageName : [
'OpenAI.GlobalStandard.gpt-4o, 150'
]
}
})
@allowed(['australiaeast', 'eastus2', 'francecentral', 'japaneast', 'norwayeast', 'swedencentral', 'uksouth', 'westus'])
@description('Azure OpenAI Location')
param azureOpenAILocation string
param aiDeploymentsLocation string

@minLength(1)
@description('Name of the GPT model to deploy:')
Expand All @@ -26,6 +39,9 @@ param gptModelVersion string = '2024-08-06'
@description('GPT model deployment type:')
param modelDeploymentType string = 'GlobalStandard'

@description('Optional. AI model deployment token capacity.')
param gptModelCapacity int = 150

@description('Set the image tag for the container images used in the solution. Default is "latest".')
param imageTag string = 'latest'

Expand All @@ -46,8 +62,8 @@ param logAnalyticsWorkspaceConfiguration logAnalyticsWorkspaceConfigurationType
location: solutionLocation
sku: 'PerGB2018'
tags: tags
dataRetentionInDays: 365
existingWorkspaceResourceId: ''
dataRetentionInDays: useWafAlignedArchitecture ? 365 : 30
existingWorkspaceResourceId: existingLogAnalyticsWorkspaceId
}

@description('Optional. The configuration to apply for the Multi-Agent Custom Automation Engine Application Insights resource.')
Expand All @@ -56,7 +72,7 @@ param applicationInsightsConfiguration applicationInsightsConfigurationType = {
name: 'appi-${solutionPrefix}'
location: solutionLocation
tags: tags
retentionInDays: 365
retentionInDays: useWafAlignedArchitecture ? 365 : 30
}

@description('Optional. The configuration to apply for the Multi-Agent Custom Automation Engine Managed Identity resource.')
Expand Down Expand Up @@ -105,7 +121,7 @@ param networkSecurityGroupAdministrationConfiguration networkSecurityGroupConfig

@description('Optional. The configuration to apply for the Multi-Agent Custom Automation Engine virtual network resource.')
param virtualNetworkConfiguration virtualNetworkConfigurationType = {
enabled: true
enabled: useWafAlignedArchitecture ? true : false
name: 'vnet-${solutionPrefix}'
location: solutionLocation
tags: tags
Expand All @@ -131,7 +147,7 @@ param virtualMachineConfiguration virtualMachineConfigurationType = {
location: solutionLocation
tags: tags
adminUsername: 'adminuser'
adminPassword: guid(solutionPrefix, subscription().subscriptionId)
adminPassword: useWafAlignedArchitecture? 'P@ssw0rd1234' : guid(solutionPrefix, subscription().subscriptionId)
vmSize: 'Standard_D2s_v3'
subnetResourceId: null //Default value set on module configuration
}
Expand All @@ -140,18 +156,18 @@ param virtualMachineConfiguration virtualMachineConfigurationType = {
param aiFoundryAiServicesConfiguration aiServicesConfigurationType = {
enabled: true
name: 'aisa-${solutionPrefix}'
location: azureOpenAILocation
location: aiDeploymentsLocation
sku: 'S0'
deployments: null //Default value set on module configuration
subnetResourceId: null //Default value set on module configuration
modelCapacity: 50
modelCapacity: gptModelCapacity
}

@description('Optional. The configuration to apply for the AI Foundry AI Project resource.')
param aiFoundryAiProjectConfiguration aiProjectConfigurationType = {
enabled: true
name: 'aifp-${solutionPrefix}'
location: azureOpenAILocation
location: aiDeploymentsLocation
sku: 'Basic'
tags: tags
}
Expand Down Expand Up @@ -199,8 +215,8 @@ param webServerFarmConfiguration webServerFarmConfigurationType = {
enabled: true
name: 'asp-${solutionPrefix}'
location: solutionLocation
skuName: 'P1v3'
skuCapacity: 3
skuName: useWafAlignedArchitecture? 'P1v3' : 'B2'
skuCapacity: useWafAlignedArchitecture ? 3 : 1
tags: tags
}

Expand Down Expand Up @@ -729,7 +745,7 @@ var aiFoundryAiServicesModelDeployment = {
sku: {
name: modelDeploymentType
//Curently the capacity is set to 140 for opinanal performance.
capacity: aiFoundryAiServicesConfiguration.?modelCapacity ?? 50
capacity: aiFoundryAiServicesConfiguration.?modelCapacity ?? gptModelCapacity
}
raiPolicyName: 'Microsoft.Default'
}
Expand All @@ -739,7 +755,7 @@ module aiFoundryAiServices 'br/public:avm/res/cognitive-services/account:0.11.0'
params: {
name: aiFoundryAiServicesResourceName
tags: aiFoundryAiServicesConfiguration.?tags ?? tags
location: aiFoundryAiServicesConfiguration.?location ?? azureOpenAILocation
location: aiFoundryAiServicesConfiguration.?location ?? aiDeploymentsLocation
enableTelemetry: enableTelemetry
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceId }]
sku: aiFoundryAiServicesConfiguration.?sku ?? 'S0'
Expand Down Expand Up @@ -817,7 +833,7 @@ resource aiServices 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' ex
resource aiFoundryProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
parent: aiServices
name: aiFoundryAiProjectName
location: aiFoundryAiProjectConfiguration.?location ?? azureOpenAILocation
location: aiFoundryAiProjectConfiguration.?location ?? aiDeploymentsLocation
identity: {
type: 'SystemAssigned'
}
Expand Down
24 changes: 0 additions & 24 deletions infra/main.bicepparam

This file was deleted.

28 changes: 26 additions & 2 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,36 @@
}
]
},
"environmentName": {
"solutionPrefix": {
"value": "${AZURE_ENV_NAME}"
},
"location": {
"solutionLocation": {
"value": "${AZURE_LOCATION}"
},
"aiDeploymentsLocation": {
"value": "${AZURE_ENV_OPENAI_LOCATION}"
},
"modelDeploymentType": {
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
},
"gptModelName": {
"value": "${AZURE_ENV_MODEL_NAME}"
},
"gptModelVersion": {
"value": "${AZURE_ENV_MODEL_VERSION}"
},
"gptModelCapacity": {
"value": "${AZURE_ENV_MODEL_CAPACITY}"
},
"imageTag": {
"value": "${AZURE_ENV_IMAGE_TAG}"
},
"enableTelemetry": {
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"
},
"existingLogAnalyticsWorkspaceId": {
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
},
"backendExists": {
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
},
Expand Down
18 changes: 0 additions & 18 deletions infra/main.waf-aligned.bicepparam

This file was deleted.

Loading