Skip to content

Commit e34db32

Browse files
Merge pull request #288 from microsoft/psl-azdquotacheck
feat: Added code changes related azd quota check
2 parents 2986c69 + 37125bd commit e34db32

File tree

6 files changed

+58
-71
lines changed

6 files changed

+58
-71
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: 25 additions & 9 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, 150'
25+
]
26+
}
27+
})
1528
@allowed(['australiaeast', 'eastus2', 'francecentral', 'japaneast', 'norwayeast', 'swedencentral', 'uksouth', 'westus'])
1629
@description('Azure OpenAI Location')
1730
param azureOpenAILocation string
@@ -26,6 +39,9 @@ param gptModelVersion string = '2024-08-06'
2639
@description('GPT model deployment type:')
2740
param modelDeploymentType string = 'GlobalStandard'
2841

42+
@description('Optional. AI model deployment token capacity.')
43+
param gptModelCapacity int = 150
44+
2945
@description('Set the image tag for the container images used in the solution. Default is "latest".')
3046
param imageTag string = 'latest'
3147

@@ -46,8 +62,8 @@ param logAnalyticsWorkspaceConfiguration logAnalyticsWorkspaceConfigurationType
4662
location: solutionLocation
4763
sku: 'PerGB2018'
4864
tags: tags
49-
dataRetentionInDays: 365
50-
existingWorkspaceResourceId: ''
65+
dataRetentionInDays: useWafAlignedArchitecture ? 365 : 30
66+
existingWorkspaceResourceId: existingLogAnalyticsWorkspaceId
5167
}
5268

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

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

106122
@description('Optional. The configuration to apply for the Multi-Agent Custom Automation Engine virtual network resource.')
107123
param virtualNetworkConfiguration virtualNetworkConfigurationType = {
108-
enabled: true
124+
enabled: useWafAlignedArchitecture ? true : false
109125
name: 'vnet-${solutionPrefix}'
110126
location: solutionLocation
111127
tags: tags
@@ -131,7 +147,7 @@ param virtualMachineConfiguration virtualMachineConfigurationType = {
131147
location: solutionLocation
132148
tags: tags
133149
adminUsername: 'adminuser'
134-
adminPassword: guid(solutionPrefix, subscription().subscriptionId)
150+
adminPassword: useWafAlignedArchitecture? 'P@ssw0rd1234' : guid(solutionPrefix, subscription().subscriptionId)
135151
vmSize: 'Standard_D2s_v3'
136152
subnetResourceId: null //Default value set on module configuration
137153
}
@@ -144,7 +160,7 @@ param aiFoundryAiServicesConfiguration aiServicesConfigurationType = {
144160
sku: 'S0'
145161
deployments: null //Default value set on module configuration
146162
subnetResourceId: null //Default value set on module configuration
147-
modelCapacity: 50
163+
modelCapacity: gptModelCapacity
148164
}
149165

150166
@description('Optional. The configuration to apply for the AI Foundry AI Project resource.')
@@ -199,8 +215,8 @@ param webServerFarmConfiguration webServerFarmConfigurationType = {
199215
enabled: true
200216
name: 'asp-${solutionPrefix}'
201217
location: solutionLocation
202-
skuName: 'P1v3'
203-
skuCapacity: 3
218+
skuName: useWafAlignedArchitecture? 'P1v3' : 'B2'
219+
skuCapacity: useWafAlignedArchitecture ? 3 : 1
204220
tags: tags
205221
}
206222

@@ -729,7 +745,7 @@ var aiFoundryAiServicesModelDeployment = {
729745
sku: {
730746
name: modelDeploymentType
731747
//Curently the capacity is set to 140 for opinanal performance.
732-
capacity: aiFoundryAiServicesConfiguration.?modelCapacity ?? 50
748+
capacity: aiFoundryAiServicesConfiguration.?modelCapacity ?? gptModelCapacity
733749
}
734750
raiPolicyName: 'Microsoft.Default'
735751
}

infra/main.bicepparam

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

infra/main.parameters.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,36 @@
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+
"gptModelCapacity": {
40+
"value": "${AZURE_ENV_MODEL_CAPACITY}"
41+
},
42+
"imageTag": {
43+
"value": "${AZURE_ENV_IMAGE_TAG}"
44+
},
45+
"enableTelemetry": {
46+
"value": "${AZURE_ENV_ENABLE_TELEMETRY}"
47+
},
48+
"existingLogAnalyticsWorkspaceId": {
49+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
50+
},
2751
"backendExists": {
2852
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
2953
},

infra/main.waf-aligned.bicepparam

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

0 commit comments

Comments
 (0)