Skip to content

Commit 70f2ea7

Browse files
committed
update codes
1 parent f0086a5 commit 70f2ea7

12 files changed

Lines changed: 1116 additions & 10 deletions

azure.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,32 @@ metadata:
88
name: content-processinge@1.0
99

1010
hooks:
11+
# preup:
12+
# windows:
13+
# shell: pwsh
14+
# run: ./scripts/set_conns_env_vars.ps1
15+
# interactive: true
16+
# continueOnError: false
17+
# posix:
18+
# shell: sh
19+
# run: sudo chmod u+r+x ./scripts/set_conns_env_vars.sh; ./scripts/set_conns_env_vars.sh
20+
# interactive: true
21+
# continueOnError: false
1122
preprovision:
1223
posix:
1324
shell: sh
14-
run: timestamp=$(date +"%Y%m%d-%H%M%S"); logFile="azd_preprovision_$timestamp.log"; sed -i 's/\r$//' ./infra/scripts/docker-build.sh; ./infra/scripts/docker-build.sh "$AZURE_SUBSCRIPTION_ID" "$AZURE_ENV_NAME" "$AZURE_LOCATION" "$AZURE_RESOURCE_GROUP" "$USE_LOCAL_BUILD" 2>&1 | tee "$logFile"
25+
run: sudo chmod u+r+x ./infra/scripts/validate_model_deployment_quotas.sh; sudo chmod u+r+x .infra/scripts/validate_model_quota.sh; .infra/scripts/validate_model_deployment_quotas.sh --subscription $AZURE_SUBSCRIPTION_ID --location $AZURE_LOCATION --models-parameter "aiModelDeployments; timestamp=$(date +"%Y%m%d-%H%M%S"); logFile="azd_preprovision_$timestamp.log"; sed -i 's/\r$//' ./infra/scripts/docker-build.sh; ./infra/scripts/docker-build.sh "$AZURE_SUBSCRIPTION_ID" "$AZURE_ENV_NAME" "$AZURE_LOCATION" "$AZURE_RESOURCE_GROUP" "$USE_LOCAL_BUILD" 2>&1 | tee "$logFile"
1526
windows:
1627
shell: pwsh
17-
run: $timestamp = Get-Date -Format "yyyyMMdd-HHmmss"; $logFile = "azd_preprovision_$timestamp.log"; ./infra/scripts/docker-build.ps1 $env:AZURE_SUBSCRIPTION_ID $env:AZURE_ENV_NAME $env:AZURE_LOCATION $env:AZURE_RESOURCE_GROUP $env:USE_LOCAL_BUILD *>&1 | Tee-Object -FilePath $logFile
28+
run: ./infra/scripts/validate_model_deployment_quotas.ps1 -Subscription $env:AZURE_SUBSCRIPTION_ID -Location $env:AZURE_LOCATION -ModelsParameter "aiModelDeployments" ;$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"; $logFile = "azd_preprovision_$timestamp.log"; ./infra/scripts/docker-build.ps1 $env:AZURE_SUBSCRIPTION_ID $env:AZURE_ENV_NAME $env:AZURE_LOCATION $env:AZURE_RESOURCE_GROUP $env:USE_LOCAL_BUILD *>&1 | Tee-Object -FilePath $logFile
29+
interactive: true
30+
continueOnError: false
1831
postprovision:
1932
posix:
2033
shell: sh
21-
run: sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; ./infra/scripts/post_deployment.sh
34+
run: sudo chmod u+r+x ./infra/scripts/validate_model_deployment_quotas.sh; sudo chmod u+r+x ./infra/scripts/validate_model_quota.sh; ./infra/scripts/validate_model_deployment_quotas.sh --subscription $AZURE_SUBSCRIPTION_ID --location $AZURE_LOCATION --models-parameter "aiModelDeployments"; sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; ./infra/scripts/post_deployment.sh
2235
interactive: true
2336
windows:
2437
shell: pwsh
25-
run: ./infra/scripts/post_deployment.ps1
38+
run: ./infra/scripts/post_deployment.ps1;./scripts/validate_model_deployment_quotas.ps1 -Subscription $env:AZURE_SUBSCRIPTION_ID -Location $env:AZURE_LOCATION -ModelsParameter "aiModelDeployments"
2639
interactive: true

infra/main.bicep

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ import {
1212
} from './modules/types.bicep'
1313

1414
// ========== get up parameters from parameter file ========== //
15+
@description('Name of the environment to deploy the solution into:')
1516
param environmentName string
17+
@description('Location for the content understanding service: WestUS | SwedenCentral | AustraliaEast')
1618
param contentUnderstandingLocation content_understanding_available_location_type
19+
@description('Type of GPT deployment to use: Standard | GlobalStandard')
1720
param deploymentType gpt_deployment_type = 'GlobalStandard'
21+
@description('Name of the GPT model to deploy: gpt-4o-mini | gpt-4o | gpt-4')
1822
param gptModelName gpt_model_name_type = 'gpt-4o'
1923
@minLength(1)
2024
@description('Version of the GPT model to deploy:')
@@ -23,8 +27,8 @@ param gptModelName gpt_model_name_type = 'gpt-4o'
2327
])
2428
param gptModelVersion string = '2024-08-06'
2529
@minValue(10)
26-
@description('Capacity of the GPT deployment:')
27-
param gptDeploymentCapacity int = 100
30+
@description('Capacity of the GPT deployment: (minimum 10)')
31+
param gptDeploymentCapacity int
2832
param useLocalBuild string = 'false'
2933

3034
// ============ make up Parameters from bicep parameter module ========== //
@@ -41,6 +45,10 @@ param useLocalBuild string = 'false'
4145
// }
4246
// }
4347

48+
// param deployment_parameter default_deployment_param_type
49+
// param ai_deployment_parameter ai_deployment_param_type
50+
// param container_app_parameter container_app_deployment_info_type
51+
4452
// =========== Build Parameters ========== //
4553
var deployment_param default_deployment_param_type = {
4654
environment_name: environmentName
@@ -137,6 +145,7 @@ module avmKeyVault 'br/public:avm/res/key-vault/vault:0.12.1' = {
137145
]
138146
enablePurgeProtection: false
139147
enableSoftDelete: true
148+
enableRbacAuthorization: true
140149
}
141150
scope: resourceGroup(resourceGroup().name)
142151
}
@@ -967,7 +976,7 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
967976
// dependsOn: [roleAssignments]
968977
// }
969978

970-
// output CONTAINER_WEB_APP_NAME string = containerApps.outputs.containerAppWebName
971-
// output CONTAINER_API_APP_NAME string = containerApps.outputs.containerAppApiName
972-
// output CONTAINER_WEB_APP_FQDN string = containerApps.outputs.containweAppWebEndPoint
973-
// output CONTAINER_API_APP_FQDN string = containerApps.outputs.containweAppApiEndPoint
979+
output CONTAINER_WEB_APP_NAME string = avmContainerApp_Web.outputs.name
980+
output CONTAINER_API_APP_NAME string = avmContainerApp_API.outputs.name
981+
output CONTAINER_WEB_APP_FQDN string = avmContainerApp_Web.outputs.fqdn
982+
output CONTAINER_API_APP_FQDN string = avmContainerApp_API.outputs.fqdn

infra/main.parameters.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"name": {
6+
"value": "${AZURE_ENV_NAME}"
7+
},
8+
"location": {
9+
"value": "${AZURE_LOCATION}"
10+
},
11+
"vmAdminPasswordOrKey": {
12+
"value": "${AZURE_VM_ADMIN_PASSWORD}"
13+
},
14+
"vmSize": {
15+
"value": "${AZURE_VM_SIZE=Standard_DS4_v2}"
16+
},
17+
"cosmosDbEnabled": {
18+
"value": "${AZURE_COSMOS_DB_ENABLED}"
19+
},
20+
"sqlServerEnabled": {
21+
"value": "${AZURE_SQL_SERVER_ENABLED}"
22+
},
23+
"acrEnabled": {
24+
"value": "${AZURE_ACR_ENABLED}"
25+
},
26+
"apiManagementEnabled": {
27+
"value": "${AZURE_API_MANAGEMENT_ENABLED}"
28+
},
29+
"searchEnabled": {
30+
"value": "${AZURE_AI_SEARCH_ENABLED}"
31+
},
32+
"contentSafetyEnabled": {
33+
"value": "${AZURE_AI_CONTENT_SAFETY_ENABLED}"
34+
},
35+
"visionEnabled": {
36+
"value": "${AZURE_AI_VISION_ENABLED}"
37+
},
38+
"languageEnabled": {
39+
"value": "${AZURE_AI_LANGUAGE_ENABLED}"
40+
},
41+
"speechEnabled": {
42+
"value": "${AZURE_AI_SPEECH_ENABLED}"
43+
},
44+
"translatorEnabled": {
45+
"value": "${AZURE_AI_TRANSLATOR_ENABLED}"
46+
},
47+
"documentIntelligenceEnabled": {
48+
"value": "${AZURE_AI_DOC_INTELLIGENCE_ENABLED}"
49+
},
50+
"bingGroundingEnabled": {
51+
"value": "${AZURE_BING_GROUNDING_ENABLED}"
52+
},
53+
"aiModelDeployments": {
54+
"value": [
55+
{
56+
"name": "textembed",
57+
"model": {
58+
"name": "text-embedding-ada-002",
59+
"format": "OpenAI",
60+
"version": "2"
61+
},
62+
"sku": {
63+
"name": "Standard",
64+
"capacity": 10
65+
}
66+
},
67+
{
68+
"name": "gpt",
69+
"model": {
70+
"name": "gpt-4o",
71+
"version": "2024-05-13",
72+
"format": "OpenAI"
73+
},
74+
"sku": {
75+
"name": "GlobalStandard",
76+
"capacity": 10
77+
}
78+
}
79+
]
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)