Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions infra/avm/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ var supportedModels = [
]

var containerAppName = 'ca-${solutionSuffix}'
var backendUsesBootstrapImage = toLower(backendContainerRegistryHostname) == 'mcr.microsoft.com' && toLower(backendContainerImageName) == 'azuredocs/containerapps-helloworld'
var mcpUsesBootstrapImage = toLower(MCPContainerRegistryHostname) == 'mcr.microsoft.com' && toLower(MCPContainerImageName) == 'azuredocs/containerapps-helloworld'

var privateDnsZones = [
'privatelink.cognitiveservices.azure.com'
Expand Down Expand Up @@ -1069,18 +1071,20 @@ module containerApp './modules/compute/container-app.bicep' = {
tags: tags
environmentResourceId: containerAppEnvironment.outputs.resourceId
ingressExternal: true
ingressTargetPort: 8000
ingressTargetPort: backendUsesBootstrapImage ? 80 : 8000
ingressAllowInsecure: false
enableTelemetry: enableTelemetry
managedIdentities: {
userAssignedResourceIds: [managed_identity.outputs.resourceId]
}
registries: [
{
server: acrLoginServer
identity: managed_identity.outputs.resourceId
}
]
registries: backendUsesBootstrapImage
? null
: [
{
server: acrLoginServer
identity: managed_identity.outputs.resourceId
}
]
corsPolicy: {
allowedOrigins: [
'https://app-${solutionSuffix}.azurewebsites.net'
Expand Down Expand Up @@ -1246,18 +1250,20 @@ module containerAppMcp './modules/compute/container-app.bicep' = {
tags: tags
environmentResourceId: containerAppEnvironment.outputs.resourceId
ingressExternal: true
ingressTargetPort: 9000
ingressTargetPort: mcpUsesBootstrapImage ? 80 : 9000
ingressAllowInsecure: false
enableTelemetry: enableTelemetry
managedIdentities: {
userAssignedResourceIds: [managed_identity.outputs.resourceId]
}
registries: [
{
server: acrLoginServer
identity: managed_identity.outputs.resourceId
}
]
registries: mcpUsesBootstrapImage
? null
: [
{
server: acrLoginServer
identity: managed_identity.outputs.resourceId
}
]
corsPolicy: {
allowedOrigins: [
'https://app-${solutionSuffix}.azurewebsites.net'
Expand Down
117 changes: 60 additions & 57 deletions infra/avm/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.44.1.10279",
"templateHash": "10080544909430391861"
"templateHash": "15518088603134439540"
},
"name": "Multi-Agent Custom Automation Engine - AVM",
"description": "AVM orchestrator for the Multi-Agent Custom Automation Engine accelerator. Deploys the same logical resources and preserves the same outputs as infra\\main.bicep using local AVM wrapper modules."
Expand Down Expand Up @@ -467,6 +467,8 @@
"[parameters('gptImageModelName')]"
],
"containerAppName": "[format('ca-{0}', variables('solutionSuffix'))]",
"backendUsesBootstrapImage": "[and(equals(toLower(parameters('backendContainerRegistryHostname')), 'mcr.microsoft.com'), equals(toLower(parameters('backendContainerImageName')), 'azuredocs/containerapps-helloworld'))]",
"mcpUsesBootstrapImage": "[and(equals(toLower(parameters('MCPContainerRegistryHostname')), 'mcr.microsoft.com'), equals(toLower(parameters('MCPContainerImageName')), 'azuredocs/containerapps-helloworld'))]",
"privateDnsZones": [
"privatelink.cognitiveservices.azure.com",
"privatelink.openai.azure.com",
Expand Down Expand Up @@ -687,7 +689,7 @@
"aiSearchIndexNameForRFPSummary": "macae-rfp-summary-index",
"aiSearchIndexNameForRFPRisk": "macae-rfp-risk-index",
"aiSearchIndexNameForRFPCompliance": "macae-rfp-compliance-index",
"virtualMachineAvailabilityZone": 1,
"virtualMachineAvailabilityZone": -1,
"aiFoundryOpenAIEndpoint": "[format('https://{0}.openai.azure.com/', variables('aiFoundryAiServicesResourceName'))]"
},
"resources": {
Expand Down Expand Up @@ -28583,7 +28585,7 @@
"_generator": {
"name": "bicep",
"version": "0.44.1.10279",
"templateHash": "10180502016624897684"
"templateHash": "13733831222630151234"
}
},
"parameters": {
Expand All @@ -28609,7 +28611,7 @@
"modelName": {
"type": "string",
"metadata": {
"description": "Required. Model name (e.g., gpt-4o, text-embedding-ada-002)."
"description": "Required. Model name (e.g., gpt-5.4-mini, text-embedding-ada-002)."
}
},
"modelVersion": {
Expand Down Expand Up @@ -54859,9 +54861,7 @@
"ingressExternal": {
"value": true
},
"ingressTargetPort": {
"value": 8000
},
"ingressTargetPort": "[if(variables('backendUsesBootstrapImage'), createObject('value', 80), createObject('value', 8000))]",
"ingressAllowInsecure": {
"value": false
},
Expand All @@ -54875,14 +54875,7 @@
]
}
},
"registries": {
"value": [
{
"server": "[if(variables('useExistingContainerRegistry'), format('{0}.azurecr.io', variables('existingContainerRegistryName')), reference('container_registry').outputs.loginServer.value)]",
"identity": "[reference('managed_identity').outputs.resourceId.value]"
}
]
},
"registries": "[if(variables('backendUsesBootstrapImage'), createObject('value', null()), createObject('value', createArray(createObject('server', if(variables('useExistingContainerRegistry'), format('{0}.azurecr.io', variables('existingContainerRegistryName')), reference('container_registry').outputs.loginServer.value), 'identity', reference('managed_identity').outputs.resourceId.value))))]",
"corsPolicy": {
"value": {
"allowedOrigins": [
Expand Down Expand Up @@ -56862,9 +56855,7 @@
"ingressExternal": {
"value": true
},
"ingressTargetPort": {
"value": 9000
},
"ingressTargetPort": "[if(variables('mcpUsesBootstrapImage'), createObject('value', 80), createObject('value', 9000))]",
"ingressAllowInsecure": {
"value": false
},
Expand All @@ -56878,14 +56869,7 @@
]
}
},
"registries": {
"value": [
{
"server": "[if(variables('useExistingContainerRegistry'), format('{0}.azurecr.io', variables('existingContainerRegistryName')), reference('container_registry').outputs.loginServer.value)]",
"identity": "[reference('managed_identity').outputs.resourceId.value]"
}
]
},
"registries": "[if(variables('mcpUsesBootstrapImage'), createObject('value', null()), createObject('value', createArray(createObject('server', if(variables('useExistingContainerRegistry'), format('{0}.azurecr.io', variables('existingContainerRegistryName')), reference('container_registry').outputs.loginServer.value), 'identity', reference('managed_identity').outputs.resourceId.value))))]",
"corsPolicy": {
"value": {
"allowedOrigins": [
Expand Down Expand Up @@ -56966,10 +56950,18 @@
"name": "AZURE_OPENAI_IMAGE_DEPLOYMENT",
"value": "[parameters('gptImageModelName')]"
},
{
"name": "AZURE_OPENAI_IMAGE_QUALITY",
"value": "high"
},
{
"name": "AZURE_STORAGE_BLOB_URL",
"value": "[reference('storage_account').outputs.blobEndpoint.value]"
},
{
"name": "AZURE_STORAGE_IMAGES_CONTAINER",
"value": "generated-images"
},
{
"name": "BACKEND_URL",
"value": "[format('https://{0}.{1}', variables('containerAppName'), reference('containerAppEnvironment').outputs.defaultDomain.value)]"
Expand Down Expand Up @@ -59690,14 +59682,19 @@
"value": {
"SCM_DO_BUILD_DURING_DEPLOYMENT": "true",
"DOCKER_REGISTRY_SERVER_URL": "[format('https://{0}', if(variables('useExistingContainerRegistry'), format('{0}.azurecr.io', variables('existingContainerRegistryName')), reference('container_registry').outputs.loginServer.value))]",
"WEBSITES_PORT": "3000",
"WEBSITES_CONTAINER_START_TIME_LIMIT": "1800",
"BACKEND_API_URL": "[format('https://{0}', reference('containerApp').outputs.fqdn.value)]",
Comment thread
Dhruvkumar-Microsoft marked this conversation as resolved.
"AUTH_ENABLED": "false",
"PROXY_API_REQUESTS": "[if(parameters('enablePrivateNetworking'), 'true', 'false')]"
}
},
"virtualNetworkSubnetId": "[if(parameters('enablePrivateNetworking'), createObject('value', reference('virtualNetwork').outputs.webserverfarmSubnetResourceId.value), createObject('value', ''))]",
"vnetRouteAllEnabled": {
"value": "[parameters('enablePrivateNetworking')]"
},
"imagePullTraffic": {
"value": "[parameters('enablePrivateNetworking')]"
},
"publicNetworkAccess": {
"value": "Enabled"
},
Expand All @@ -59712,7 +59709,7 @@
"_generator": {
"name": "bicep",
"version": "0.44.1.10279",
"templateHash": "9621160936099183182"
"templateHash": "9504607717010385151"
}
},
"definitions": {
Expand Down Expand Up @@ -60250,6 +60247,40 @@
}
},
"resources": {
"site": {
"existing": true,
"type": "Microsoft.Web/sites",
"apiVersion": "2025-03-01",
"name": "[parameters('name')]"
},
"logsConfig": {
"type": "Microsoft.Web/sites/config",
"apiVersion": "2025-03-01",
"name": "[format('{0}/{1}', parameters('name'), 'logs')]",
"properties": {
"applicationLogs": {
"fileSystem": {
"level": "Verbose"
}
},
"detailedErrorMessages": {
"enabled": true
},
"failedRequestsTracing": {
"enabled": true
},
"httpLogs": {
"fileSystem": {
"enabled": true,
"retentionInDays": 1,
"retentionInMb": 35
}
}
},
"dependsOn": [
"appService"
]
},
"appService": {
"type": "Microsoft.Resources/deployments",
"apiVersion": "2025-04-01",
Expand Down Expand Up @@ -60293,6 +60324,7 @@
"healthCheckPath": "[if(not(empty(parameters('healthCheckPath'))), parameters('healthCheckPath'), null())]",
"webSocketsEnabled": "[parameters('webSocketsEnabled')]",
"appCommandLine": "[parameters('appCommandLine')]",
"vnetRouteAllEnabled": "[parameters('vnetRouteAllEnabled')]",
"acrUseManagedIdentityCreds": "[not(empty(parameters('acrUserManagedIdentityClientId')))]",
"acrUserManagedIdentityID": "[if(not(empty(parameters('acrUserManagedIdentityClientId'))), parameters('acrUserManagedIdentityClientId'), null())]"
}
Expand All @@ -60306,35 +60338,6 @@
"name": "appsettings",
"properties": "[parameters('appSettings')]",
"applicationInsightResourceId": "[if(not(empty(parameters('applicationInsightResourceId'))), parameters('applicationInsightResourceId'), null())]"
},
{
"name": "logs",
"properties": {
"applicationLogs": {
"fileSystem": {
"level": "Verbose"
}
},
"detailedErrorMessages": {
"enabled": true
},
"failedRequestsTracing": {
"enabled": true
},
"httpLogs": {
"fileSystem": {
"enabled": true,
"retentionInDays": 1,
"retentionInMb": 35
}
}
}
},
{
"name": "web",
"properties": {
"vnetRouteAllEnabled": "[parameters('vnetRouteAllEnabled')]"
}
}
]
},
Expand Down
34 changes: 20 additions & 14 deletions infra/bicep/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ var frontendAppUrl = 'https://${frontendAppName}.azurewebsites.net'
var appServicePlanName = 'asp-${solutionSuffix}'
var backendContainerAppName = 'ca-${solutionSuffix}'
var mcpContainerAppName = 'ca-mcp-${solutionSuffix}'
var backendUsesBootstrapImage = toLower(backendContainerRegistryHostname) == 'mcr.microsoft.com' && toLower(backendContainerImageName) == 'azuredocs/containerapps-helloworld'
var mcpUsesBootstrapImage = toLower(MCPContainerRegistryHostname) == 'mcr.microsoft.com' && toLower(MCPContainerImageName) == 'azuredocs/containerapps-helloworld'
var storageAccountName = take('st${toLower(replace(solutionSuffix, '-', ''))}', 24)
var aiSearchServiceName = 'srch-${solutionSuffix}'

Expand Down Expand Up @@ -495,7 +497,7 @@ module backend_container_app './modules/compute/container-app.bicep' = {
tags: isCustom ? union(allTags, { 'azd-service-name': 'backend' }) : allTags
environmentResourceId: container_app_environment.outputs.resourceId
ingressExternal: true
ingressTargetPort: 8000
ingressTargetPort: backendUsesBootstrapImage ? 80 : 8000
managedIdentities: {
userAssignedResourceIds: [userAssignedIdentity.outputs.resourceId]
}
Expand All @@ -516,12 +518,14 @@ module backend_container_app './modules/compute/container-app.bicep' = {
minReplicas: 1
maxReplicas: 1
}
registries: [
{
server: acrLoginServer
identity: userAssignedIdentity.outputs.resourceId
}
]
registries: backendUsesBootstrapImage
? null
: [
{
server: acrLoginServer
identity: userAssignedIdentity.outputs.resourceId
}
]
containers: [
{
name: 'backend'
Expand Down Expand Up @@ -669,7 +673,7 @@ module mcp_container_app './modules/compute/container-app.bicep' = {
tags: isCustom ? union(allTags, { 'azd-service-name': 'mcp' }) : allTags
environmentResourceId: container_app_environment.outputs.resourceId
ingressExternal: true
ingressTargetPort: 9000
ingressTargetPort: mcpUsesBootstrapImage ? 80 : 9000
managedIdentities: {
userAssignedResourceIds: [userAssignedIdentity.outputs.resourceId]
}
Expand All @@ -683,12 +687,14 @@ module mcp_container_app './modules/compute/container-app.bicep' = {
minReplicas: 1
maxReplicas: 1
}
registries: [
{
server: acrLoginServer
identity: userAssignedIdentity.outputs.resourceId
}
]
registries: mcpUsesBootstrapImage
? null
: [
{
server: acrLoginServer
identity: userAssignedIdentity.outputs.resourceId
}
]
containers: [
{
name: 'mcp'
Expand Down
Loading