{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "environment": { "type": "string" }, "location": { "type": "string" }, "pricingTier": { "type": "string" } }, "variables": { "environment": "[toLower(parameters('environment'))]", "prefix": "[concat('lunchrun-', variables('environment'))]", "appServicePlan": "[concat(variables('prefix'), '-web-host')]", "web": "[concat(variables('prefix'), '-web')]", "storage": "[concat('lunchrun', variables('environment'), 'storage')]", "insights": "[concat(variables('prefix'), '-insights')]" }, "resources": [ { "type": "Microsoft.Insights/components", "kind": "web", "name": "[variables('insights')]", "location": "[parameters('location')]", "apiVersion": "2014-04-01", "scale": null, "tags": { "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('web'))]": "Resource", "displayName": "AppInsightsComponent" }, "properties": { "name": "[variables('insights')]" } }, { "type": "Microsoft.Storage/storageAccounts", "sku": { "name": "Standard_LRS", "tier": "Standard" }, "kind": "Storage", "name": "[variables('storage')]", "apiVersion": "2017-10-01", "location": "[parameters('location')]", "tags": {} }, { "type": "Microsoft.Web/serverfarms", "sku": { "name": "[parameters('pricingTier')]" }, "name": "[variables('appServicePlan')]", "apiVersion": "2016-09-01", "location": "[parameters('location')]", "properties": { "name": "[variables('appserviceplan')]", "perSiteScaling": false, "reserved": false } }, { "type": "Microsoft.Web/sites", "name": "[variables('web')]", "apiVersion": "2016-08-01", "location": "[parameters('location')]", "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlan'))]", "siteConfig": { "appSettings": [ { "name": "public_path", "value": "./public" }, { "name": "APPINSIGHTS_INSTRUMENTATIONKEY", "value": "[reference(concat('Microsoft.Insights/components/', variables('insights'))).InstrumentationKey]" }, { "name": "STORAGE_CONNECTIONSTRING", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts/', variables('storage')), '2017-10-01').keys[0].value)]" } ] } }, "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlan'))]", "[resourceId('Microsoft.Storage/storageAccounts/', variables('storage'))]", "[resourceId('Microsoft.Insights/components/', variables('insights'))]" ], "resources": [ { "apiVersion": "2016-08-01", "name": "Microsoft.ApplicationInsights.AzureWebSites", "type": "siteextensions", "dependsOn": [ "[resourceId('Microsoft.Web/sites/', variables('web'))]" ], "properties": {} } ] } ], "outputs": { "webAppName": { "type": "string", "value": "[variables('web')]" }, "webAppPassword": { "type": "string", "value": "[list(resourceId('Microsoft.Web/sites/config', variables('web'), 'publishingcredentials'), '2014-06-01').properties.publishingPassword]" } } }