Skip to content

Commit 37c62a0

Browse files
Added code changes related azd quota check
1 parent 2986c69 commit 37c62a0

File tree

6 files changed

+50
-69
lines changed

6 files changed

+50
-69
lines changed

azure.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
22
name: multi-agent-custom-automation-engine-solution-accelerator
33
metadata:
4-
5-
hooks:
6-
preprovision:
7-
posix:
8-
shell: sh
9-
run: >
10-
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"
11-
interactive: false
12-
continueOnError: false
13-
14-
windows:
15-
shell: pwsh
16-
run: >
17-
$location = if ($env:AZURE_ENV_OPENAI_LOCATION) { $env:AZURE_ENV_OPENAI_LOCATION } else { "swedencentral" };
18-
./infra/scripts/validate_model_deployment_quotas.ps1 -SubscriptionId $env:AZURE_SUBSCRIPTION_ID -Location $location -ModelsParameter "aiModelDeployments"
19-
interactive: false
20-
continueOnError: false
4+

docs/CustomizingAzdParameters.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ By default this template will use the environment name as the prefix to prevent
1616
| `AZURE_ENV_MODEL_VERSION` | string | `2024-08-06` | Version of the GPT model to be used for deployment. |
1717
| `AZURE_ENV_IMAGETAG` | string | `latest` | Docker image tag used for container deployments. |
1818
| `AZURE_ENV_ENABLE_TELEMETRY` | bool | `true` | Enables telemetry for monitoring and diagnostics. |
19-
19+
| `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. |
2020
---
2121

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

30+
Set the Log Analytics Workspace Id if you need to reuse the existing workspace which is already existing
31+
```shell
32+
azd env set AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID '/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>'
33+
```
34+
3035
**Example:**
3136

3237
```bash

infra/main.bicep

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
metadata name = 'Multi-Agent Custom Automation Engine'
22
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.'
33

4+
@description('Set to true if you want to deploy WAF-aligned infrastructure.')
5+
param useWafAlignedArchitecture bool
6+
47
@description('Optional. The prefix to add in the default names given to all deployed Azure resources.')
58
@maxLength(19)
69
param solutionPrefix string = 'macae${uniqueString(deployer().objectId, deployer().tenantId, subscription().subscriptionId, resourceGroup().id)}'
@@ -11,7 +14,17 @@ param solutionLocation string = resourceGroup().location
1114
@description('Optional. Enable/Disable usage telemetry for module.')
1215
param enableTelemetry bool = true
1316

17+
param existingLogAnalyticsWorkspaceId string = ''
18+
1419
// Restricting deployment to only supported Azure OpenAI regions validated with GPT-4o model
20+
@metadata({
21+
azd : {
22+
type: 'location'
23+
usageName : [
24+
'OpenAI.GlobalStandard.gpt-4o, 50'
25+
]
26+
}
27+
})
1528
@allowed(['australiaeast', 'eastus2', 'francecentral', 'japaneast', 'norwayeast', 'swedencentral', 'uksouth', 'westus'])
1629
@description('Azure OpenAI Location')
1730
param azureOpenAILocation string
@@ -46,8 +59,8 @@ param logAnalyticsWorkspaceConfiguration logAnalyticsWorkspaceConfigurationType
4659
location: solutionLocation
4760
sku: 'PerGB2018'
4861
tags: tags
49-
dataRetentionInDays: 365
50-
existingWorkspaceResourceId: ''
62+
dataRetentionInDays: useWafAlignedArchitecture ? 365 : 30
63+
existingWorkspaceResourceId: existingLogAnalyticsWorkspaceId
5164
}
5265

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

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

106119
@description('Optional. The configuration to apply for the Multi-Agent Custom Automation Engine virtual network resource.')
107120
param virtualNetworkConfiguration virtualNetworkConfigurationType = {
108-
enabled: true
121+
enabled: useWafAlignedArchitecture ? true : false
109122
name: 'vnet-${solutionPrefix}'
110123
location: solutionLocation
111124
tags: tags
@@ -131,7 +144,7 @@ param virtualMachineConfiguration virtualMachineConfigurationType = {
131144
location: solutionLocation
132145
tags: tags
133146
adminUsername: 'adminuser'
134-
adminPassword: guid(solutionPrefix, subscription().subscriptionId)
147+
adminPassword: useWafAlignedArchitecture? 'P@ssw0rd1234' : guid(solutionPrefix, subscription().subscriptionId)
135148
vmSize: 'Standard_D2s_v3'
136149
subnetResourceId: null //Default value set on module configuration
137150
}
@@ -199,8 +212,8 @@ param webServerFarmConfiguration webServerFarmConfigurationType = {
199212
enabled: true
200213
name: 'asp-${solutionPrefix}'
201214
location: solutionLocation
202-
skuName: 'P1v3'
203-
skuCapacity: 3
215+
skuName: useWafAlignedArchitecture? 'P1v3' : 'B2'
216+
skuCapacity: useWafAlignedArchitecture ? 3 : 1
204217
tags: tags
205218
}
206219

infra/main.bicepparam

Lines changed: 0 additions & 24 deletions
This file was deleted.

infra/main.parameters.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,33 @@
1818
}
1919
]
2020
},
21-
"environmentName": {
21+
"solutionPrefix": {
2222
"value": "${AZURE_ENV_NAME}"
2323
},
24-
"location": {
24+
"solutionLocation": {
2525
"value": "${AZURE_LOCATION}"
2626
},
27+
"azureOpenAILocation": {
28+
"value": "${AZURE_ENV_OPENAI_LOCATION}"
29+
},
30+
"modelDeploymentType": {
31+
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
32+
},
33+
"gptModelName": {
34+
"value": "${AZURE_ENV_MODEL_NAME}"
35+
},
36+
"gptModelVersion": {
37+
"value": "${AZURE_ENV_MODEL_VERSION}"
38+
},
39+
"imageTag": {
40+
"value": "${AZURE_ENV_IMAGE_TAG}"
41+
},
42+
"enableTelemetry": {
43+
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"
44+
},
45+
"existingLogAnalyticsWorkspaceId": {
46+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
47+
},
2748
"backendExists": {
2849
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
2950
},

infra/main.waf-aligned.bicepparam

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)