@@ -1046,6 +1046,101 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
10461046 }
10471047}
10481048
1049+ var containerAppMcpResourceName = 'ca-mcp-${solutionPrefix }'
1050+ module containerAppMcp 'br/public:avm/res/app/container-app:0.18.1' = if (containerAppEnabled ) {
1051+ name : take ('avm.res.app.container-app.${containerAppMcpResourceName }' , 64 )
1052+ params : {
1053+ name : containerAppMcpResourceName
1054+ tags : containerAppConfiguration .?tags ?? tags
1055+ location : containerAppConfiguration .?location ?? solutionLocation
1056+ enableTelemetry : enableTelemetry
1057+ environmentResourceId : containerAppConfiguration .?environmentResourceId ?? containerAppEnvironment .outputs .resourceId
1058+ managedIdentities : {
1059+ systemAssigned : true
1060+ userAssignedResourceIds : [userAssignedIdentity !.outputs .resourceId ]
1061+ }
1062+ ingressTargetPort : containerAppConfiguration .?ingressTargetPort ?? 8000
1063+ ingressExternal : true
1064+ activeRevisionsMode : 'Single'
1065+ corsPolicy : {
1066+ allowedOrigins : [
1067+ ]
1068+ }
1069+ // WAF aligned configuration for Scalability
1070+ scaleSettings : {
1071+ maxReplicas : containerAppConfiguration .?maxReplicas ?? 1
1072+ minReplicas : containerAppConfiguration .?minReplicas ?? 1
1073+ rules : [
1074+ {
1075+ name : 'http-scaler'
1076+ http : {
1077+ metadata : {
1078+ concurrentRequests : containerAppConfiguration .?concurrentRequests ?? '100'
1079+ }
1080+ }
1081+ }
1082+ ]
1083+ }
1084+ containers : [
1085+ {
1086+ name : 'mcp'
1087+ image : 'macaer.azurecr.io/macaebackend:macaev3' //'${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'latest'}'
1088+ resources : {
1089+ //TODO: Make cpu and memory parameterized
1090+ cpu : containerAppConfiguration .?containerCpu ?? '2.0'
1091+ memory : containerAppConfiguration .?containerMemory ?? '4.0Gi'
1092+ }
1093+ env : [
1094+ {
1095+ name : 'MCP_HOST'
1096+ value : '0.0.0.0'
1097+ }
1098+ {
1099+ name : 'MCP_PORT'
1100+ value : '9000'
1101+ }
1102+ {
1103+ name : 'MCP_DEBUG'
1104+ value : 'false'
1105+ }
1106+ {
1107+ name : 'MCP_SERVER_NAME'
1108+ value : 'MACAE MCP Server'
1109+ }
1110+ {
1111+ name : 'MCP_ENABLE_AUTH'
1112+ value : 'true'
1113+ }
1114+ {
1115+ name : 'AZURE_TENANT_ID'
1116+ value : tenant ().tenantId
1117+ }
1118+ {
1119+ name : 'AZURE_CLIENT_ID'
1120+ value : userAssignedIdentity !.outputs .clientId
1121+ }
1122+ {
1123+ name : 'AZURE_JWKS_URI'
1124+ value : 'https://login.microsoftonline.com/${tenant ().tenantId }/discovery/v2.0/keys'
1125+ }
1126+ {
1127+ name : 'AZURE_ISSUER'
1128+ value : 'https://sts.windows.net/${tenant ().tenantId }/'
1129+ }
1130+ {
1131+ name : 'AZURE_AUDIENCE'
1132+ value : 'api://${userAssignedIdentity !.outputs .clientId }'
1133+ }
1134+ {
1135+ name : 'DATASET_PATH'
1136+ value : './datasets'
1137+ }
1138+ ]
1139+ }
1140+ ]
1141+ }
1142+ }
1143+
10491144var webServerFarmEnabled = webServerFarmConfiguration .?enabled ?? true
10501145var webServerFarmResourceName = webServerFarmConfiguration .?name ?? 'asp-${solutionPrefix }'
10511146
0 commit comments