@@ -1098,6 +1098,103 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
10981098 }
10991099}
11001100
1101+ var containerAppMcpResourceName = 'ca-mcp-${solutionPrefix }'
1102+ module containerAppMcp 'br/public:avm/res/app/container-app:0.18.1' = if (containerAppEnabled ) {
1103+ name : take ('avm.res.app.container-app.${containerAppMcpResourceName }' , 64 )
1104+ params : {
1105+ name : containerAppMcpResourceName
1106+ tags : containerAppConfiguration .?tags ?? tags
1107+ location : containerAppConfiguration .?location ?? solutionLocation
1108+ enableTelemetry : enableTelemetry
1109+ environmentResourceId : containerAppConfiguration .?environmentResourceId ?? containerAppEnvironment .outputs .resourceId
1110+ managedIdentities : {
1111+ systemAssigned : true
1112+ userAssignedResourceIds : [userAssignedIdentity !.outputs .resourceId ]
1113+ }
1114+ ingressTargetPort : 9000
1115+ ingressExternal : true
1116+ activeRevisionsMode : 'Single'
1117+ corsPolicy : {
1118+ allowedOrigins : [
1119+ 'https://${webSiteName }.azurewebsites.net'
1120+ 'http://${webSiteName }.azurewebsites.net'
1121+ ]
1122+ }
1123+ // WAF aligned configuration for Scalability
1124+ scaleSettings : {
1125+ maxReplicas : containerAppConfiguration .?maxReplicas ?? 1
1126+ minReplicas : containerAppConfiguration .?minReplicas ?? 1
1127+ rules : [
1128+ {
1129+ name : 'http-scaler'
1130+ http : {
1131+ metadata : {
1132+ concurrentRequests : containerAppConfiguration .?concurrentRequests ?? '100'
1133+ }
1134+ }
1135+ }
1136+ ]
1137+ }
1138+ containers : [
1139+ {
1140+ name : 'mcp'
1141+ image : 'macaemcpacrdk.azurecr.io/macae-mac-app:t9' //'${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'latest'}'
1142+ resources : {
1143+ //TODO: Make cpu and memory parameterized
1144+ cpu : containerAppConfiguration .?containerCpu ?? '2.0'
1145+ memory : containerAppConfiguration .?containerMemory ?? '4.0Gi'
1146+ }
1147+ env : [
1148+ {
1149+ name : 'MCP_HOST'
1150+ value : '0.0.0.0'
1151+ }
1152+ {
1153+ name : 'MCP_PORT'
1154+ value : '9000'
1155+ }
1156+ {
1157+ name : 'MCP_DEBUG'
1158+ value : 'false'
1159+ }
1160+ {
1161+ name : 'MCP_SERVER_NAME'
1162+ value : 'MACAE MCP Server'
1163+ }
1164+ {
1165+ name : 'MCP_ENABLE_AUTH'
1166+ value : 'true'
1167+ }
1168+ {
1169+ name : 'AZURE_TENANT_ID'
1170+ value : tenant ().tenantId
1171+ }
1172+ {
1173+ name : 'AZURE_CLIENT_ID'
1174+ value : userAssignedIdentity !.outputs .clientId
1175+ }
1176+ {
1177+ name : 'AZURE_JWKS_URI'
1178+ value : 'https://login.microsoftonline.com/${tenant ().tenantId }/discovery/v2.0/keys'
1179+ }
1180+ {
1181+ name : 'AZURE_ISSUER'
1182+ value : 'https://sts.windows.net/${tenant ().tenantId }/'
1183+ }
1184+ {
1185+ name : 'AZURE_AUDIENCE'
1186+ value : 'api://${userAssignedIdentity !.outputs .clientId }'
1187+ }
1188+ {
1189+ name : 'DATASET_PATH'
1190+ value : './datasets'
1191+ }
1192+ ]
1193+ }
1194+ ]
1195+ }
1196+ }
1197+
11011198var webServerFarmEnabled = webServerFarmConfiguration .?enabled ?? true
11021199var webServerFarmResourceName = webServerFarmConfiguration .?name ?? 'asp-${solutionPrefix }'
11031200
@@ -1978,3 +2075,5 @@ output AZURE_AI_MODEL_DEPLOYMENT_NAME string = aiFoundryAiServicesModelDeploymen
19782075output AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME string = aiFoundryAiServicesModelDeployment .name
19792076output AZURE_AI_AGENT_ENDPOINT string = aiFoundryAiServices .outputs .aiProjectInfo .apiEndpoint
19802077output APP_ENV string = 'Prod'
2078+ output AI_FOUNDRY_RESOURCE_ID string = aiFoundryAiServices .outputs .resourceId
2079+ output COSMOSDB_ACCOUNT_NAME string = cosmosDbResourceName
0 commit comments