Skip to content

Commit c0d4b90

Browse files
feat: quota check during azd up (#579)
* quota-check-during azd up * updated bicep and parameter json
1 parent cee593c commit c0d4b90

File tree

3 files changed

+58
-20
lines changed

3 files changed

+58
-20
lines changed

infra/main.bicep

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param environmentName string
1010
param existingLogAnalyticsWorkspaceId string = ''
1111

1212
@description('CosmosDB Location')
13-
param cosmosLocation string
13+
param cosmosLocation string = 'eastus2'
1414

1515
@minLength(1)
1616
@description('GPT model deployment type:')
@@ -27,13 +27,13 @@ param deploymentType string = 'GlobalStandard'
2727
])
2828
param gptModelName string = 'gpt-4o-mini'
2929

30-
param azureOpenaiAPIVersion string = '2025-04-01-preview'
30+
param azureOpenaiAPIVersion string = '2025-01-01-preview'
3131

3232
@minValue(10)
3333
@description('Capacity of the GPT deployment:')
3434
// You can increase this, but capacity is limited per model/region, so you will get errors if you go over
3535
// https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits
36-
param gptDeploymentCapacity int = 30
36+
param gptDeploymentCapacity int = 200
3737

3838
@minLength(1)
3939
@description('Name of the Text Embedding model to deploy:')
@@ -53,14 +53,27 @@ param imageTag string = 'latest'
5353

5454
//restricting to these regions because assistants api for gpt-4o-mini is available only in these regions
5555
@allowed(['australiaeast','eastus', 'eastus2','francecentral','japaneast','swedencentral','uksouth', 'westus', 'westus3'])
56-
@description('Azure OpenAI Location')
57-
param AzureOpenAILocation string = 'eastus2'
56+
// @description('Azure OpenAI Location')
57+
// param AzureOpenAILocation string = 'eastus2'
58+
59+
@metadata({
60+
azd:{
61+
type: 'location'
62+
usageName: [
63+
'OpenAI.GlobalStandard.gpt-4o-mini,200'
64+
'OpenAI.Standard.text-embedding-ada-002,80'
65+
]
66+
}
67+
})
68+
@description('Location for AI Foundry deployment. This is the location where the AI Foundry resources will be deployed.')
69+
param aiDeploymentsLocation string
5870

5971
@description('Set this if you want to deploy to a different region than the resource group. Otherwise, it will use the resource group location by default.')
6072
param AZURE_LOCATION string=''
6173
var solutionLocation = empty(AZURE_LOCATION) ? resourceGroup().location : AZURE_LOCATION
6274

6375
var uniqueId = toLower(uniqueString(environmentName, subscription().id, solutionLocation))
76+
6477
var solutionPrefix = 'ca${padLeft(take(uniqueId, 12), 12, '0')}'
6578

6679
// Load the abbrevations file required to name the azure resources.
@@ -133,7 +146,7 @@ module aifoundry 'deploy_ai_foundry.bicep' = {
133146
name: 'deploy_ai_foundry'
134147
params: {
135148
solutionName: solutionPrefix
136-
solutionLocation: AzureOpenAILocation
149+
solutionLocation: aiDeploymentsLocation
137150
keyVaultName: keyvaultModule.outputs.keyvaultName
138151
deploymentType: deploymentType
139152
gptModelName: gptModelName

infra/main.bicepparam

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

infra/main.parameters.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"environmentName": {
6+
"value": "${AZURE_ENV_NAME}"
7+
},
8+
"cosmosLocation": {
9+
"value": "${AZURE_ENV_COSMOS_LOCATION}"
10+
},
11+
"deploymentType": {
12+
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
13+
},
14+
"gptModelName": {
15+
"value": "${AZURE_ENV_MODEL_NAME}"
16+
},
17+
"azureOpenaiAPIVersion": {
18+
"value": "${AZURE_ENV_MODEL_VERSION}"
19+
},
20+
"gptDeploymentCapacity": {
21+
"value": "${AZURE_ENV_MODEL_CAPACITY}"
22+
},
23+
"embeddingModel": {
24+
"value": "${AZURE_ENV_EMBEDDING_MODEL_NAME}"
25+
},
26+
"embeddingDeploymentCapacity": {
27+
"value": "${AZURE_ENV_EMBEDDING_MODEL_CAPACITY}"
28+
},
29+
"imageTag": {
30+
"value": "${AZURE_ENV_IMAGETAG}"
31+
},
32+
"location": {
33+
"value": "${AZURE_LOCATION}"
34+
},
35+
"existingLogAnalyticsWorkspaceId": {
36+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)