dotnet-podcasts/deploy/Services/hub.deployment.json

151 lines
4.5 KiB
JSON
Raw Normal View History

2021-11-30 03:54:48 +08:00
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string",
"minLength": 2,
"metadata": {
"description": "Web app name."
}
},
"servicePlanName": {
"type": "string",
"minLength": 2,
"metadata": {
"description": "Service plan name."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"sku": {
"type": "string",
2021-12-11 04:58:41 +08:00
"defaultValue": "S1",
2021-11-30 03:54:48 +08:00
"metadata": {
"description": "The SKU of App Service Plan."
}
},
"linuxFxVersion": {
"type": "string",
"defaultValue": "DOTNETCORE|6.0",
"metadata": {
"description": "The Runtime stack of current web app"
}
},
"podcastApiUrl": {
"type": "string"
},
"serverName": {
"type": "string"
},
"sqlDBName": {
"type": "string",
"defaultValue": "ListenTogether"
},
"administratorLogin": {
"type": "string"
},
"administratorLoginPassword": {
"type": "secureString"
}
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[parameters('servicePlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('sku')]"
},
"kind": "linux",
"properties": {
"reserved": true
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[parameters('webAppName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('servicePlanName'))]",
"[resourceId('Microsoft.Sql/servers/databases', parameters('serverName'), parameters('sqlDBName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('servicePlanName'))]",
"siteConfig": {
"linuxFxVersion": "[parameters('linuxFxVersion')]",
"alwaysOn": true,
"http20Enabled" : true,
"appSettings": [
{
"name": "NetPodcastApi__BaseAddress",
"value": "[parameters('podcastApiUrl')]"
}
]
},
"httpsOnly": true,
"clientAffinityEnabled": false
}
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2020-12-01",
"name": "[format('{0}/{1}', parameters('webAppName'), 'connectionstrings')]",
"properties": {
"ListenTogetherDb": {
"value": "[format('Server=tcp:{0}.database.windows.net,1433;Initial Catalog={1};Persist Security Info=False;User ID={2};Password={3};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;', parameters('serverName'), parameters('sqlDBName'), parameters('administratorLogin'), parameters('administratorLoginPassword'))]",
"type": "SQLAzure"
}
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]",
"[resourceId('Microsoft.Web/sites', parameters('webAppName'))]"
]
},
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2020-02-02-preview",
"name": "[parameters('serverName')]",
"location": "[parameters('location')]",
"properties": {
"administratorLogin": "[parameters('administratorLogin')]",
"administratorLoginPassword": "[parameters('administratorLoginPassword')]"
}
},
{
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2020-08-01-preview",
"name": "[format('{0}/{1}', parameters('serverName'), parameters('sqlDBName'))]",
"location": "[parameters('location')]",
"sku": {
2021-12-11 04:58:41 +08:00
"name": "Basic",
"tier": "Basic",
"capacity": 5
2021-11-30 03:54:48 +08:00
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
]
},
{
"type": "Microsoft.Sql/servers/firewallrules",
"apiVersion": "2014-04-01-preview",
"name": "[format('{0}/{1}', parameters('serverName'), 'AllowAllWindowsAzureIps')]",
"location": "[resourceGroup().location]",
"properties": {
"endIpAddress": "0.0.0.0",
"startIpAddress": "0.0.0.0"
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
]
}
]
2021-12-11 04:58:41 +08:00
}