Last active
June 4, 2020 12:18
-
-
Save reallydontask/b73a89ad34603835bcecffe4dc455014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"appName": { | |
"type": "string" | |
}, | |
"AppInsightsKey": { | |
"type": "string" | |
}, | |
"appServicePlanName": { | |
"type": "string" | |
}, | |
"settings": { | |
"type": "object", | |
"defaultValue": { | |
"linuxFxVersion": "DOTNETCORE|3.1", | |
"appSettings": { | |
"Azure__SignalR__ConnectionString":"signalRConnectionString" | |
} | |
} | |
}, | |
"environment": { | |
"defaultValue": "dev", | |
"allowedValues": [ | |
"dev", | |
"test", | |
"sandbox", | |
"preprod", | |
"prod", | |
"pr" | |
], | |
"type": "string" | |
}, | |
"useAppInsights": { | |
"type": "bool" | |
} | |
}, | |
"variables": { | |
"commonSettings": { | |
"ASPNETCORE_ENVIRONMENT": "Production", | |
"WEBSITE_HTTPLOGGING_RETENTION_DAYS": "5", | |
"ASPNETCORE_DETAILEDERRORS": true | |
}, | |
"AISettings": { | |
"TelemetrySettings__InstrumentationKey": "[if(parameters('useAppInsights'), parameters('AppInsightsKey'), '')]", | |
"TelemetrySettings__DisableTelemetry": false | |
}, | |
"appSettingsAI": "[if(parameters('useAppInsights'), union(variables('commonSettings'), variables('AISettings')), variables('commonSettings'))]", | |
"appSettings": "[union(variables('appSettingsAI'), parameters('settings').appSettings)]" | |
}, | |
"resources": [ | |
{ | |
"type": "Microsoft.Web/sites", | |
"apiVersion": "2018-11-01", | |
"name": "[parameters('appName')]", | |
"location": "[resourceGroup().location]", | |
"tags": { | |
"Environment": "[parameters('environment')]" | |
}, | |
"kind": "app, Linux", | |
"identity": { | |
"type": "SystemAssigned" | |
}, | |
"properties": { | |
"enabled": true, | |
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]", | |
"siteConfig": { | |
"linuxFxVersion": "[parameters('settings').linuxFxVersion]", | |
"alwaysOn": true | |
}, | |
"reserved": false, | |
"clientAffinityEnabled": false, | |
"clientCertEnabled": false, | |
"hostNamesDisabled": false, | |
"containerSize": 0, | |
"dailyMemoryTimeQuota": 0, | |
"httpsOnly": true | |
}, | |
"resources": [ | |
{ | |
"type": "config", | |
"apiVersion": "2018-11-01", | |
"name": "web", | |
"location": "[resourceGroup().location]", | |
"tags": { | |
"Environment": "[parameters('environment')]" | |
}, | |
"dependsOn": [ | |
"[parameters('appName')]" | |
], | |
"properties": { | |
"linuxFxVersion": "[parameters('settings').linuxFxVersion]", | |
"httpLoggingEnabled": true, | |
"alwaysOn": true | |
} | |
}, | |
{ | |
"apiVersion": "2016-08-01", | |
"name": "appsettings", | |
"type": "config", | |
"properties": "[variables('appSettings')]", | |
"dependsOn": [ | |
"[parameters('appName')]" | |
] | |
} | |
] | |
} | |
], | |
"outputs": { | |
"principalId": { | |
"type": "string", | |
"value": "[reference(resourceId('Microsoft.Web/sites/', parameters('appName')),'2018-11-01','Full').identity.principalId]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment