Skip to content

Commit 6b97493

Browse files
authored
Merge pull request #407 from microsoft/LocalDeploy
feat: added the local deployment changes
2 parents eae3ba0 + 2ef6e8b commit 6b97493

File tree

14 files changed

+4197
-104
lines changed

14 files changed

+4197
-104
lines changed

azure_custom.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
name: multi-agent-custom-automation-engine-solution-accelerator
3+
metadata:
4+
5+
requiredVersions:
6+
azd: ">=1.15.0 !=1.17.1"
7+
8+
services:
9+
backend:
10+
project: ./src/backend
11+
language: py
12+
host: containerapp
13+
docker:
14+
image: backend
15+
remoteBuild: true
16+
17+
mcp:
18+
project: ./src/mcp_server
19+
language: py
20+
host: containerapp
21+
docker:
22+
image: mcp
23+
remoteBuild: true
24+
25+
frontend:
26+
project: ./src/frontend
27+
language: py
28+
host: appservice
29+
dist: ./dist
30+
hooks:
31+
prepackage:
32+
windows:
33+
shell: pwsh
34+
run: ../../infra/scripts/package_frontend.ps1
35+
interactive: true
36+
continueOnError: false
37+
posix:
38+
shell: sh
39+
run: bash ../../infra/scripts/package_frontend.sh
40+
interactive: true
41+
continueOnError: false

infra/main.bicep

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
11011198
var webServerFarmEnabled = webServerFarmConfiguration.?enabled ?? true
11021199
var webServerFarmResourceName = webServerFarmConfiguration.?name ?? 'asp-${solutionPrefix}'
11031200

@@ -1978,3 +2075,5 @@ output AZURE_AI_MODEL_DEPLOYMENT_NAME string = aiFoundryAiServicesModelDeploymen
19782075
output AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME string = aiFoundryAiServicesModelDeployment.name
19792076
output AZURE_AI_AGENT_ENDPOINT string = aiFoundryAiServices.outputs.aiProjectInfo.apiEndpoint
19802077
output APP_ENV string = 'Prod'
2078+
output AI_FOUNDRY_RESOURCE_ID string = aiFoundryAiServices.outputs.resourceId
2079+
output COSMOSDB_ACCOUNT_NAME string = cosmosDbResourceName

0 commit comments

Comments
 (0)