Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions infra/main-apps.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module ui 'modules/ui-container.bicep' = {
appDownloadUrl: blobBaseUrl
customDomainName: customDomainName
tags: tags
environmentName: environmentName
}
dependsOn: [
api
Expand Down
31 changes: 29 additions & 2 deletions infra/modules/ui-container.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,36 @@ param apiHealthUrl string
param appDownloadUrl string
param customDomainName string = ''
param tags object = {}
param environmentName string

resource acr 'Microsoft.ContainerRegistry/registries@2023-07-01' existing = {
name: acrName
}

resource containerAppEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' existing = {
name: environmentName
}

resource rootCert 'Microsoft.App/managedEnvironments/managedCertificates@2023-05-01' = if (customDomainName != '') {
name: 'cert-${customDomainName}'
parent: containerAppEnvironment
location: location
properties: {
subjectName: customDomainName
domainControlValidation: 'CNAME'
}
}

resource wwwCert 'Microsoft.App/managedEnvironments/managedCertificates@2023-05-01' = if (customDomainName != '') {
name: 'cert-www-${customDomainName}'
parent: containerAppEnvironment
location: location
properties: {
subjectName: 'www.${customDomainName}'
domainControlValidation: 'CNAME'
}
}

resource uiContainer 'Microsoft.App/containerApps@2023-05-01' = {
name: containerAppName
location: location
Expand All @@ -33,11 +58,13 @@ resource uiContainer 'Microsoft.App/containerApps@2023-05-01' = {
customDomains: customDomainName != '' ? [
{
name: customDomainName
bindingType: 'AzureManaged'
bindingType: 'SniEnabled'
certificateId: rootCert.id
}
{
name: 'www.${customDomainName}'
bindingType: 'AzureManaged'
bindingType: 'SniEnabled'
certificateId: wwwCert.id
}
] : []
}
Expand Down
Loading