@@ -1082,6 +1082,103 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
10821082 }
10831083}
10841084
1085+ var containerAppMcpResourceName = 'ca-mcp-${solutionPrefix }'
1086+ module containerAppMcp 'br/public:avm/res/app/container-app:0.18.1' = if (containerAppEnabled ) {
1087+ name : take ('avm.res.app.container-app.${containerAppMcpResourceName }' , 64 )
1088+ params : {
1089+ name : containerAppMcpResourceName
1090+ tags : containerAppConfiguration .?tags ?? tags
1091+ location : containerAppConfiguration .?location ?? solutionLocation
1092+ enableTelemetry : enableTelemetry
1093+ environmentResourceId : containerAppConfiguration .?environmentResourceId ?? containerAppEnvironment .outputs .resourceId
1094+ managedIdentities : {
1095+ systemAssigned : true
1096+ userAssignedResourceIds : [userAssignedIdentity !.outputs .resourceId ]
1097+ }
1098+ ingressTargetPort : containerAppConfiguration .?ingressTargetPort ?? 8000
1099+ ingressExternal : true
1100+ activeRevisionsMode : 'Single'
1101+ corsPolicy : {
1102+ allowedOrigins : [
1103+ 'https://${webSiteName }.azurewebsites.net'
1104+ 'http://${webSiteName }.azurewebsites.net'
1105+ ]
1106+ }
1107+ // WAF aligned configuration for Scalability
1108+ scaleSettings : {
1109+ maxReplicas : containerAppConfiguration .?maxReplicas ?? 1
1110+ minReplicas : containerAppConfiguration .?minReplicas ?? 1
1111+ rules : [
1112+ {
1113+ name : 'http-scaler'
1114+ http : {
1115+ metadata : {
1116+ concurrentRequests : containerAppConfiguration .?concurrentRequests ?? '100'
1117+ }
1118+ }
1119+ }
1120+ ]
1121+ }
1122+ containers : [
1123+ {
1124+ name : 'mcp'
1125+ image : 'macaemcpacrdk.azurecr.io/macae-mac-app:t7' //'${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'latest'}'
1126+ resources : {
1127+ //TODO: Make cpu and memory parameterized
1128+ cpu : containerAppConfiguration .?containerCpu ?? '2.0'
1129+ memory : containerAppConfiguration .?containerMemory ?? '4.0Gi'
1130+ }
1131+ env : [
1132+ {
1133+ name : 'MCP_HOST'
1134+ value : '0.0.0.0'
1135+ }
1136+ {
1137+ name : 'MCP_PORT'
1138+ value : '9000'
1139+ }
1140+ {
1141+ name : 'MCP_DEBUG'
1142+ value : 'false'
1143+ }
1144+ {
1145+ name : 'MCP_SERVER_NAME'
1146+ value : 'MACAE MCP Server'
1147+ }
1148+ {
1149+ name : 'MCP_ENABLE_AUTH'
1150+ value : 'true'
1151+ }
1152+ {
1153+ name : 'AZURE_TENANT_ID'
1154+ value : tenant ().tenantId
1155+ }
1156+ {
1157+ name : 'AZURE_CLIENT_ID'
1158+ value : userAssignedIdentity !.outputs .clientId
1159+ }
1160+ {
1161+ name : 'AZURE_JWKS_URI'
1162+ value : 'https://login.microsoftonline.com/${tenant ().tenantId }/discovery/v2.0/keys'
1163+ }
1164+ {
1165+ name : 'AZURE_ISSUER'
1166+ value : 'https://sts.windows.net/${tenant ().tenantId }/'
1167+ }
1168+ {
1169+ name : 'AZURE_AUDIENCE'
1170+ value : 'api://${userAssignedIdentity !.outputs .clientId }'
1171+ }
1172+ {
1173+ name : 'DATASET_PATH'
1174+ value : './datasets'
1175+ }
1176+ ]
1177+ }
1178+ ]
1179+ }
1180+ }
1181+
10851182var webServerFarmEnabled = webServerFarmConfiguration .?enabled ?? true
10861183var webServerFarmResourceName = webServerFarmConfiguration .?name ?? 'asp-${solutionPrefix }'
10871184
0 commit comments