Skip to content

Commit 568a98b

Browse files
Merge pull request #478 from microsoft/quota-check-before-azd-deployrs
feat: quota check before azd deploy
2 parents 8e652ab + 151a49d commit 568a98b

File tree

3 files changed

+46
-29
lines changed

3 files changed

+46
-29
lines changed

infra/main.bicep

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@ targetScope = 'resourceGroup'
66
@description('A unique prefix for all resources in this deployment. This should be 3-20 characters long:')
77
param environmentName string
88

9+
@minLength(1)
10+
@description('Secondary location for databases creation(example:eastus2):')
11+
param secondaryLocation string = 'eastus2'
12+
13+
@description('Azure location for the solution. If not provided, it defaults to the resource group location.')
14+
param AZURE_LOCATION string=''
15+
16+
// ========== AI Deployments Location ========== //
17+
@description('Location for AI deployments. This should be a valid Azure region where OpenAI services are available.')
918
@metadata({
1019
azd: {
1120
type: 'location'
21+
usageName: [
22+
'OpenAI.GlobalStandard.gpt4.1,150'
23+
'OpenAI.Standard.text-embedding-ada-002,80'
24+
]
1225
}
1326
})
14-
15-
16-
@minLength(1)
17-
@description('Secondary location for databases creation(example:eastus2):')
18-
param secondaryLocation string
27+
param aiDeploymentsLocation string
1928

2029
@minLength(1)
2130
@description('GPT model deployment type:')
@@ -31,28 +40,26 @@ param gptModelName string = 'gpt-4.1'
3140
@description('Version of the GPT model to deploy:')
3241
param gptModelVersion string = '2025-04-14'
3342

34-
param azureOpenaiAPIVersion string = '2024-05-01-preview'
43+
@description('API version for Azure OpenAI service. This should be a valid API version supported by the service.')
44+
param azureOpenaiAPIVersion string = '2025-01-01-preview'
3545

3646
@minValue(10)
3747
@description('Capacity of the GPT deployment:')
3848
// You can increase this, but capacity is limited per model/region, so you will get errors if you go over
3949
// https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits
40-
param gptDeploymentCapacity int = 30
50+
param gptDeploymentCapacity int = 150
4151

4252
@minLength(1)
4353
@description('Name of the Text Embedding model to deploy:')
44-
@allowed([
45-
'text-embedding-ada-002'
46-
])
4754
param embeddingModel string = 'text-embedding-ada-002'
4855

4956
var abbrs = loadJsonContent('./abbreviations.json')
5057
@minValue(10)
5158
@description('Capacity of the Embedding Model deployment')
5259
param embeddingDeploymentCapacity int = 80
5360

61+
@description('Image tag for the App Service container. Default is "latest".')
5462
param imageTag string = 'latest'
55-
param AZURE_LOCATION string=''
5663

5764
@description('Optional: Existing Log Analytics Workspace Resource ID')
5865
param existingLogAnalyticsWorkspaceId string = ''
@@ -91,7 +98,7 @@ module aifoundry 'deploy_ai_foundry.bicep' = {
9198
name: 'deploy_ai_foundry'
9299
params: {
93100
solutionName: solutionPrefix
94-
solutionLocation: solutionLocation
101+
solutionLocation: aiDeploymentsLocation
95102
keyVaultName: kvault.outputs.keyvaultName
96103
deploymentType: deploymentType
97104
gptModelName: gptModelName

infra/main.bicepparam

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

infra/main.parameters.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
"location": {
9+
"value": "${AZURE_LOCATION}"
10+
},
11+
"secondaryLocation": {
12+
"value": "${AZURE_ENV_SECONDARY_LOCATION}"
13+
},
14+
"gptModelVersion": {
15+
"value": "${AZURE_ENV_MODEL_VERSION}"
16+
},
17+
"azureOpenaiAPIVersion ": {
18+
"value": "${AZURE_ENV_OPENAI_API_VERSION}"
19+
},
20+
"imageTag": {
21+
"value": "${AZURE_ENV_IMAGETAG}"
22+
},
23+
"existingLogAnalyticsWorkspaceId": {
24+
"value": "${AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID}"
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)