@@ -30,13 +30,20 @@ param solutionUniqueText string = take(uniqueString(subscription().id, resourceG
30
30
'westeurope'
31
31
'uksouth'
32
32
])
33
- param location string = 'australiaeast'
33
+ param location string
34
34
35
35
// Restricting deployment to only supported Azure OpenAI regions validated with GPT-4o model
36
36
@allowed (['australiaeast' , 'eastus2' , 'francecentral' , 'japaneast' , 'norwayeast' , 'swedencentral' , 'uksouth' , 'westus' ])
37
- @metadata ({ azd : { type : 'location' } })
37
+ @metadata ({
38
+ azd : {
39
+ type : 'location'
40
+ usageName : [
41
+ 'OpenAI.GlobalStandard.gpt-4o, 150'
42
+ ]
43
+ }
44
+ })
38
45
@description ('Optional. Location for all AI service resources. This should be one of the supported Azure AI Service locations.' )
39
- param azureAiServiceLocation string = 'australiaeast'
46
+ param azureAiServiceLocation string
40
47
41
48
@description ('Optional. The tags to apply to all deployed Azure resources.' )
42
49
param tags resourceInput <'Microsoft.Resources/resourceGroups@2025-04-01' >.tags = {}
@@ -62,13 +69,13 @@ param virtualMachineAdminUsername string = take(newGuid(), 20)
62
69
param virtualMachineAdminPassword string = newGuid ()
63
70
64
71
@description ('Optional. The Container Registry hostname where the docker images for the backend are located.' )
65
- param backendContainerRegistryHostname string = 'biabcontainerreg .azurecr.io'
72
+ param backendContainerRegistryHostname string = 'macaer .azurecr.io'
66
73
67
74
@description ('Optional. The Container Image Name to deploy on the backend.' )
68
75
param backendContainerImageName string = 'macaebackend'
69
76
70
77
@description ('Optional. The Container Image Tag to deploy on the backend.' )
71
- param backendContainerImageTag string = 'latest_2025-07-22_895 '
78
+ param backendContainerImageTag string = 'dev '
72
79
73
80
@description ('Optional. The Container Registry hostname where the docker images for the frontend are located.' )
74
81
param frontendContainerRegistryHostname string = 'biabcontainerreg.azurecr.io'
@@ -77,7 +84,7 @@ param frontendContainerRegistryHostname string = 'biabcontainerreg.azurecr.io'
77
84
param frontendContainerImageName string = 'macaefrontend'
78
85
79
86
@description ('Optional. The Container Image Tag to deploy on the frontend.' )
80
- param frontendContainerImageTag string = 'latest_2025-07-22_895 '
87
+ param frontendContainerImageTag string = 'latest '
81
88
82
89
@description ('Optional. Enable/Disable usage telemetry for module.' )
83
90
param enableTelemetry bool = true
@@ -1038,6 +1045,10 @@ var cosmosDbResourceName = 'cosmos-${solutionSuffix}'
1038
1045
var cosmosDbDatabaseName = 'macae'
1039
1046
var cosmosDbDatabaseMemoryContainerName = 'memory'
1040
1047
1048
+ resource sqlContributorRoleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2024-11-15' existing = {
1049
+ name : '${cosmosDbResourceName }/00000000-0000-0000-0000-000000000002'
1050
+ }
1051
+
1041
1052
//TODO: update to latest version of AVM module
1042
1053
module cosmosDb 'br/public:avm/res/document-db/database-account:0.15.0' = {
1043
1054
name : take ('avm.res.document-db.database-account.${cosmosDbResourceName }' , 64 )
@@ -1062,16 +1073,22 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.15.0' = {
1062
1073
]
1063
1074
}
1064
1075
]
1065
- dataPlaneRoleDefinitions : [
1076
+ // dataPlaneRoleDefinitions: [
1077
+ // {
1078
+ // // Cosmos DB Built-in Data Contributor: https://docs.azure.cn/en-us/cosmos-db/nosql/security/reference-data-plane-roles#cosmos-db-built-in-data-contributor
1079
+ // roleName: 'Cosmos DB SQL Data Contributor'
1080
+ // dataActions: [
1081
+ // 'Microsoft.DocumentDB/databaseAccounts/readMetadata'
1082
+ // 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*'
1083
+ // 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*'
1084
+ // ]
1085
+ // assignments: [{ principalId: userAssignedIdentity.outputs.principalId }]
1086
+ // }
1087
+ // ]
1088
+ dataPlaneRoleAssignments : [
1066
1089
{
1067
- // Cosmos DB Built-in Data Contributor: https://docs.azure.cn/en-us/cosmos-db/nosql/security/reference-data-plane-roles#cosmos-db-built-in-data-contributor
1068
- roleName : 'Cosmos DB SQL Data Contributor'
1069
- dataActions : [
1070
- 'Microsoft.DocumentDB/databaseAccounts/readMetadata'
1071
- 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*'
1072
- 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*'
1073
- ]
1074
- assignments : [{ principalId : userAssignedIdentity .outputs .principalId }]
1090
+ principalId : userAssignedIdentity .outputs .principalId
1091
+ roleDefinitionId : sqlContributorRoleDefinition .id
1075
1092
}
1076
1093
]
1077
1094
// WAF aligned configuration for Monitoring
@@ -1331,6 +1348,10 @@ module containerApp 'br/public:avm/res/app/container-app:0.18.1' = {
1331
1348
name : 'AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME'
1332
1349
value : aiFoundryAiServicesModelDeployment .name
1333
1350
}
1351
+ {
1352
+ name : 'AZURE_CLIENT_ID'
1353
+ value : userAssignedIdentity .outputs .clientId // NOTE: This is the client ID of the managed identity, not the Entra application, and is needed for the App Service to access the Cosmos DB account.
1354
+ }
1334
1355
]
1335
1356
}
1336
1357
]
0 commit comments