@@ -195,12 +195,12 @@ param containerAppConfiguration containerAppConfigurationType = {
195195 enabled : true
196196 name : 'ca-${solutionPrefix }'
197197 location : solutionLocation
198- tags : tags
198+ tags : union ( tags , { 'azd-service-name' : 'backend' })
199199 environmentResourceId : null //Default value set on module configuration
200200 concurrentRequests : '100'
201201 containerCpu : '2.0'
202202 containerMemory : '4.0Gi'
203- containerImageRegistryDomain : 'biabcontainerreg.azurecr.io '
203+ containerImageRegistryDomain : ''
204204 containerImageName : 'macaebackend'
205205 containerImageTag : imageTag
206206 containerName : 'backend'
@@ -228,7 +228,7 @@ param webSiteConfiguration webSiteConfigurationType = {
228228 containerImageName : 'macaefrontend'
229229 containerImageTag : imageTag
230230 containerName : 'backend'
231- tags : tags
231+ tags : union ( tags , { 'azd-service-name' : 'frontend' })
232232 environmentResourceId : null //Default value set on module configuration
233233}
234234
@@ -901,6 +901,33 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.12.0' = if (co
901901 }
902902}
903903
904+ // ========== Container Registry ========== //
905+ module containerRegistry 'br/public:avm/res/container-registry/registry:0.9.1' = {
906+ name : 'registryDeployment'
907+ params : {
908+ name : 'cr${solutionPrefix }'
909+ acrAdminUserEnabled : false
910+ acrSku : 'Basic'
911+ azureADAuthenticationAsArmPolicyStatus : 'enabled'
912+ exportPolicyStatus : 'enabled'
913+ location : solutionLocation
914+ softDeletePolicyDays : 7
915+ softDeletePolicyStatus : 'disabled'
916+ tags : tags
917+ networkRuleBypassOptions : 'AzureServices'
918+ roleAssignments : [
919+ {
920+ roleDefinitionIdOrName : acrPullRole
921+ principalType : 'ServicePrincipal'
922+ principalId : userAssignedIdentity .outputs .principalId
923+ }
924+ ]
925+ }
926+ }
927+
928+ var acrPullRole = subscriptionResourceId ('Microsoft.Authorization/roleDefinitions' , '7f951dda-4ed3-4680-a7ca-43fe172d538d' )
929+
930+
904931// ========== Backend Container App Environment ========== //
905932// WAF best practices for container apps: https://learn.microsoft.com/en-us/azure/well-architected/service-guides/azure-container-apps
906933var containerAppEnvironmentEnabled = containerAppEnvironmentConfiguration .?enabled ?? true
@@ -962,10 +989,16 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
962989 }
963990 ]
964991 }
992+ registries : [
993+ {
994+ server : containerRegistry .outputs .loginServer
995+ identity : userAssignedIdentity .outputs .resourceId
996+ }
997+ ]
965998 containers : [
966999 {
9671000 name : containerAppConfiguration .?containerName ?? 'backend'
968- image : '${ containerAppConfiguration .? containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io' }/${ containerAppConfiguration .? containerImageName ?? 'macaebackend' }:${ containerAppConfiguration .? containerImageTag ?? ' latest' } '
1001+ image : 'mcr.microsoft.com/azuredocs/containerapps-helloworld: latest'
9691002 resources : {
9701003 //TODO: Make cpu and memory parameterized
9711004 cpu : containerAppConfiguration .?containerCpu ?? '2.0'
@@ -1069,22 +1102,26 @@ module webSite 'br/public:avm/res/web/site:0.15.1' = if (webSiteEnabled) {
10691102 name : webSiteName
10701103 tags : webSiteConfiguration .?tags ?? tags
10711104 location : webSiteConfiguration .?location ?? solutionLocation
1072- kind : 'app,linux,container'
1105+ kind : 'app,linux'
1106+ // kind: 'app,linux,container'
10731107 enableTelemetry : enableTelemetry
10741108 serverFarmResourceId : webSiteConfiguration .?environmentResourceId ?? webServerFarm .?outputs .resourceId
10751109 appInsightResourceId : applicationInsights .outputs .resourceId
10761110 diagnosticSettings : [{ workspaceResourceId : logAnalyticsWorkspaceId }]
10771111 publicNetworkAccess : 'Enabled' //TODO: use Azure Front Door WAF or Application Gateway WAF instead
10781112 siteConfig : {
1079- linuxFxVersion : 'DOCKER|${webSiteConfiguration .?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io' }/${webSiteConfiguration .?containerImageName ?? 'macaefrontend' }:${webSiteConfiguration .?containerImageTag ?? 'latest' }'
1113+ // linuxFxVersion: 'DOCKER|${webSiteConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${webSiteConfiguration.?containerImageName ?? 'macaefrontend'}:${webSiteConfiguration.?containerImageTag ?? 'latest'}'
1114+ linuxFxVersion : 'python|3.11'
1115+ appCommandLine : 'python3 -m uvicorn frontend_server:app --host 0.0.0.0 --port 8000'
10801116 }
10811117 appSettingsKeyValuePairs : {
1082- SCM_DO_BUILD_DURING_DEPLOYMENT : 'true '
1083- DOCKER_REGISTRY_SERVER_URL : 'https://${webSiteConfiguration .?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io' }'
1084- WEBSITES_PORT : '3000 '
1085- WEBSITES_CONTAINER_START_TIME_LIMIT : '1800' // 30 minutes, adjust as needed
1118+ SCM_DO_BUILD_DURING_DEPLOYMENT : 'True '
1119+ // DOCKER_REGISTRY_SERVER_URL: 'https://${webSiteConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}'
1120+ WEBSITES_PORT : '8000 '
1121+ // WEBSITES_CONTAINER_START_TIME_LIMIT: '1800' // 30 minutes, adjust as needed
10861122 BACKEND_API_URL : 'https://${containerApp .outputs .fqdn }'
10871123 AUTH_ENABLED : 'false'
1124+ ENABLE_ORYX_BUILD : 'True'
10881125 }
10891126 }
10901127}
@@ -1098,6 +1135,21 @@ module webSite 'br/public:avm/res/web/site:0.15.1' = if (webSiteEnabled) {
10981135@description ('The default url of the website to connect to the Multi-Agent Custom Automation Engine solution.' )
10991136output webSiteDefaultHostname string = webSite .outputs .defaultHostname
11001137
1138+ output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerRegistry .outputs .loginServer
1139+
1140+ // @description('The name of the resource.')
1141+ // output name string = <Resource>.name
1142+
1143+ // @description('The location the resource was deployed into.')
1144+ // output location string = <Resource>.location
1145+
1146+ // ================ //
1147+ // Definitions //
1148+ // ================ //
1149+ //
1150+ // Add your User-defined-types here, if any
1151+ //
1152+
11011153@export ()
11021154@description ('The type for the Multi-Agent Custom Automation Engine Log Analytics Workspace resource configuration.' )
11031155type logAnalyticsWorkspaceConfigurationType = {
0 commit comments