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')
|
2022-11-29 10:31:17 +08:00
|
|
|
param linuxFxVersion string = 'DOTNETCORE|7.0'
|
2022-09-18 01:39:52 +08:00
|
|
|
|
2022-12-05 02:03:32 +08:00
|
|
|
@description('The name of the API container app.')
|
2022-12-07 05:51:58 +08:00
|
|
|
param apiName string
|
2022-12-05 02:03:32 +08:00
|
|
|
|
|
|
|
@description('The name of the Hub Web App.')
|
|
|
|
param hubWebAppName string = ''
|
|
|
|
|
2022-09-20 22:59:17 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-05 02:03:32 +08:00
|
|
|
// 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
|
2022-12-05 02:03:32 +08:00
|
|
|
scope: resourceGroup()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reference existing Hub Container App to set App Settings
|
|
|
|
resource hubWebApp 'Microsoft.Web/sites@2022-03-01' existing = {
|
|
|
|
name: hubWebAppName
|
|
|
|
scope: resourceGroup()
|
|
|
|
}
|
|
|
|
|
2022-09-20 22:59:17 +08:00
|
|
|
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
|
2022-12-05 02:03:32 +08:00
|
|
|
appSettings: [
|
|
|
|
{
|
|
|
|
name: 'PodcastApi__BaseAddress'
|
2022-12-07 08:48:03 +08:00
|
|
|
value: 'https://${apiContainerApp.properties.configuration.ingress.fqdn}'
|
2022-12-05 02:03:32 +08:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name: 'ListenTogetherHub'
|
2022-12-07 08:48:03 +08:00
|
|
|
value: 'https://${hubWebApp.properties.hostNames[0]}/listentogether'
|
2022-12-05 02:03:32 +08:00
|
|
|
}
|
|
|
|
]
|
2022-09-18 01:39:52 +08:00
|
|
|
}
|
|
|
|
httpsOnly: true
|
|
|
|
clientAffinityEnabled: false
|
2022-12-05 02:03:32 +08:00
|
|
|
|
2022-09-18 01:39:52 +08:00
|
|
|
}
|
|
|
|
}
|