Skip to content

Commit ee59c99

Browse files
Added code changes for azd quota check
1 parent 8e9b235 commit ee59c99

5 files changed

Lines changed: 47 additions & 90 deletions

File tree

azure.yaml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
11
name: modernize-your-code-solution-accelerator
22
metadata:
33
template: modernize-your-code-solution-accelerator@1.0
4-
parameters:
5-
AzureAiServiceLocation:
6-
type: string
7-
default: japaneast
8-
Prefix:
9-
type: string
10-
default: azdtemp
11-
baseUrl:
12-
type: string
13-
default: 'https://raw.githubusercontent.com/microsoft/Modernize-your-code-solution-accelerator'
14-
deployment:
15-
mode: Incremental
16-
template: ./infra/main.bicep # Path to the main.bicep file inside the 'deployment' folder
17-
parameters:
18-
AzureAiServiceLocation: ${{ parameters.AzureAiServiceLocation }}
19-
Prefix: ${{ parameters.Prefix }}
20-
baseUrl: ${{ parameters.baseUrl }}
21-
hooks:
22-
preprovision:
23-
posix:
24-
shell: sh
25-
run: >
26-
chmod u+r+x ./scripts/validate_model_deployment_quota.sh; chmod u+r+x ./scripts/validate_model_quota.sh; ./scripts/validate_model_deployment_quota.sh --SubscriptionId "$AZURE_SUBSCRIPTION_ID" --Location "${AZURE_AISERVICE_LOCATION:-japaneast}" --ModelsParameter "aiModelDeployments"
27-
interactive: false
28-
continueOnError: false
29-
30-
windows:
31-
shell: pwsh
32-
run: >
33-
$location = if ($env:AZURE_AISERVICE_LOCATION) { $env:AZURE_AISERVICE_LOCATION } else { "japaneast" };
34-
./scripts/validate_model_deployment_quota.ps1 -SubscriptionId $env:AZURE_SUBSCRIPTION_ID -Location $location -ModelsParameter "aiModelDeployments"
35-
interactive: false
36-
continueOnError: false

infra/main.bicep

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ metadata name = 'Modernize Your Code Solution Accelerator'
22
metadata description = '''CSA CTO Gold Standard Solution Accelerator for Modernize Your Code.
33
'''
44

5+
@description('Set to true if you want to deploy WAF-aligned infrastructure.')
6+
param useWafAlignedArchitecture bool
7+
58
@minLength(3)
69
@maxLength(16)
710
@description('Required. A unique application/solution name for all resources in this deployment. This should be 3-16 characters long.')
@@ -29,19 +32,25 @@ param location string = resourceGroup().location
2932
'westus'
3033
'westus3'
3134
])
32-
@metadata({ azd: { type: 'location' } })
35+
@metadata({
36+
azd : {
37+
type: 'location'
38+
usageName : [
39+
'OpenAI.GlobalStandard.gpt-4o, 150'
40+
]
41+
}
42+
})
3343
@description('Optional. Location for all AI service resources. This location can be different from the resource group location.')
34-
param azureAiServiceLocation string = location
35-
44+
param azureAiServiceLocation string
3645

37-
@description('Optional. AI model deployment token capacity. Defaults to 5K tokens per minute.')
38-
param capacity int = 5 // was 5 before = 5K
46+
@description('Optional. AI model deployment token capacity. Defaults to 150K tokens per minute.')
47+
param capacity int = 150
3948

4049
@description('Optional. Enable monitoring for the resources. This will enable Application Insights and Log Analytics. Defaults to false.')
41-
param enableMonitoring bool = false
50+
param enableMonitoring bool = useWafAlignedArchitecture? true : false
4251

4352
@description('Optional. Enable scaling for the container apps. Defaults to false.')
44-
param enableScaling bool = false
53+
param enableScaling bool = useWafAlignedArchitecture? true : false
4554

4655
@description('Optional. Enable redundancy for applicable resources. Defaults to false.')
4756
param enableRedundancy bool = false
@@ -50,7 +59,7 @@ param enableRedundancy bool = false
5059
param secondaryLocation string?
5160

5261
@description('Optional. Enable private networking for the resources. Set to true to enable private networking. Defaults to false.')
53-
param enablePrivateNetworking bool = false
62+
param enablePrivateNetworking bool = useWafAlignedArchitecture? true : false
5463

5564
@description('Optional. Admin username for the Jumpbox Virtual Machine. Set to custom value if enablePrivateNetworking is true.')
5665
@secure()

infra/main.bicepparam

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

infra/main.parameters.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,39 @@
22
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
33
"contentVersion": "1.0.0.0",
44
"parameters": {
5+
"solutionName": {
6+
"value": "${AZURE_ENV_NAME}"
7+
},
58
"location": {
69
"value": "${AZURE_LOCATION}"
710
},
11+
"deploymentType": {
12+
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
13+
},
14+
"llmModel": {
15+
"value": "${AZURE_ENV_MODEL_NAME}"
16+
},
17+
"capacity": {
18+
"value": "${AZURE_ENV_MODEL_CAPACITY}"
19+
},
20+
"gptModelVersion": {
21+
"value": "${AZURE_ENV_MODEL_VERSION}"
22+
},
23+
"imageVersion": {
24+
"value": "${AZURE_ENV_IMAGETAG}"
25+
},
26+
"existingLogAnalyticsWorkspaceId": {
27+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
28+
},
29+
"secondaryLocation": {
30+
"value": "${AZURE_ENV_COSMOS_SECONDARY_LOCATION}"
31+
},
32+
"vmAdminUsername": {
33+
"value": "${AZURE_ENV_JUMPBOX_ADMIN_USERNAME}"
34+
},
35+
"vmAdminPassword": {
36+
"value": "${AZURE_ENV_JUMPBOX_ADMIN_PASSWORD}"
37+
},
838
"backendExists": {
939
"value": "${SERVICE_BACKEND_RESOURCE_EXISTS=false}"
1040
},

infra/main.waf-aligned.bicepparam

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

0 commit comments

Comments
 (0)