Skip to content

Commit 9288614

Browse files
Merge pull request #149 from microsoft/psl-azdquotacheck
feat: Added code changes related azd quota check
2 parents 8e9b235 + a1e7485 commit 9288614

6 files changed

Lines changed: 49 additions & 75 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
--template-file infra/main.bicep \
9696
--parameters \
9797
Prefix="${{ env.SOLUTION_PREFIX }}" \
98-
AzureAiServiceLocation="eastus" \
98+
aiDeploymentsLocation="eastus" \
9999
capacity=${{ env.GPT_MIN_CAPACITY }} \
100100
imageVersion="${IMAGE_TAG}"\
101101
--debug

azure.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,3 @@ deployment:
1818
AzureAiServiceLocation: ${{ parameters.AzureAiServiceLocation }}
1919
Prefix: ${{ parameters.Prefix }}
2020
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: 18 additions & 9 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 aiDeploymentsLocation 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()
@@ -210,7 +219,7 @@ module aiServices 'modules/ai-foundry/main.bicep' = {
210219
dependsOn: [logAnalyticsWorkspace, network] // required due to optional flags that could change dependency
211220
params: {
212221
name: 'ais-${resourcesName}'
213-
location: azureAiServiceLocation
222+
location: aiDeploymentsLocation
214223
sku: 'S0'
215224
kind: 'AIServices'
216225
deployments: [modelDeployment]

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)