dotnet-podcasts/deploy/Web/web.bicep

73 lines
1.7 KiB
Bicep
Raw Normal View History

2022-09-18 01:39:52 +08:00
@description('Web app name.')
@minLength(2)
param webAppName string
@description('Service plan name.')
@minLength(2)
param servicePlanName string
@description('The SKU of App Service Plan.')
param servicePlanSku string = 'B1'
@description('Location for all resources.')
param location string = resourceGroup().location
@description('The Runtime stack of current web app')
param linuxFxVersion string = 'DOTNETCORE|7.0'
2022-09-18 01:39:52 +08:00
@description('The name of the API container app.')
2022-12-07 05:51:58 +08:00
param apiName string
@description('The name of the Hub Web App.')
param hubWebAppName string = ''
resource servicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
2022-09-18 01:39:52 +08:00
name: servicePlanName
location: location
sku: {
name: servicePlanSku
}
kind: 'linux'
properties: {
reserved: true
}
}
// Reference existing API Container App to set App Settings
resource apiContainerApp 'Microsoft.App/containerApps@2022-03-01' existing = {
2022-12-07 05:51:58 +08:00
name: apiName
scope: resourceGroup()
}
// Reference existing Hub Container App to set App Settings
resource hubWebApp 'Microsoft.Web/sites@2022-03-01' existing = {
name: hubWebAppName
scope: resourceGroup()
}
resource webApp 'Microsoft.Web/sites@2022-03-01' = {
2022-09-18 01:39:52 +08:00
name: webAppName
location: location
properties: {
serverFarmId: servicePlan.id
siteConfig: {
linuxFxVersion: linuxFxVersion
alwaysOn: true
http20Enabled: true
appSettings: [
{
name: 'PodcastApi__BaseAddress'
2022-12-07 08:48:03 +08:00
value: 'https://${apiContainerApp.properties.configuration.ingress.fqdn}'
}
{
name: 'ListenTogetherHub'
2022-12-07 08:48:03 +08:00
value: 'https://${hubWebApp.properties.hostNames[0]}/listentogether'
}
]
2022-09-18 01:39:52 +08:00
}
httpsOnly: true
clientAffinityEnabled: false
2022-09-18 01:39:52 +08:00
}
}