From d406daa06369f58565ed6961b283770509362c4c Mon Sep 17 00:00:00 2001 From: John Folberth Date: Thu, 20 Aug 2020 11:36:55 -0400 Subject: [PATCH 01/12] Initial checkin for quickstart to include necessary configuration for Application Inisghts to send data to Log Analytics --- .gitignore | 1 + 201-web-app-loganalytics/README.md | 21 ++ 201-web-app-loganalytics/azuredeploy.json | 180 ++++++++++++++++++ .../azuredeploy.parameters.json | 6 + 201-web-app-loganalytics/metadata.json | 9 + 5 files changed, 217 insertions(+) create mode 100644 201-web-app-loganalytics/README.md create mode 100644 201-web-app-loganalytics/azuredeploy.json create mode 100644 201-web-app-loganalytics/azuredeploy.parameters.json create mode 100644 201-web-app-loganalytics/metadata.json diff --git a/.gitignore b/.gitignore index 9c6f8dc9c9ba..0fd6c5e180f2 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ test/template-validation-tests/mochawesome-report/* test/AzTemplateToolKit.zip test/arm-template-toolkit.zip test/ci-scripts/azuredeploy.parameters.new.json +/.vs diff --git a/201-web-app-loganalytics/README.md b/201-web-app-loganalytics/README.md new file mode 100644 index 000000000000..1e8d4cc7e05b --- /dev/null +++ b/201-web-app-loganalytics/README.md @@ -0,0 +1,21 @@ +# Azure SQL Database + +![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/PublicLastTestDate.svg) +![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/PublicDeployment.svg) + +![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/FairfaxLastTestDate.svg) +![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/FairfaxDeployment.svg) + +![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/BestPracticeResult.svg) +![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/CredScanResult.svg) + +[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F201-web-app-loganalytics%2Fazuredeploy.json) +[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F201-web-app-loganalytics%2Fazuredeploy.json) +[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F201-web-app-loganalytics%2Fazuredeploy.json) + +This template will is to help support the new API versions of microsoft.insights/components. Starting with 2020-02-02-preview an [Workspace Resource ID](https://docs.microsoft.com/en-us/azure/templates/microsoft.insights/2020-02-02-preview/components) will be required. +This template will deploy the App Service Plan, App Service, Application Insights, Log Analytics Workspace and hook it all together. + +`Tags: Azure, App Service Plan, App Service, Log Analytics, Application Insights` + + diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json new file mode 100644 index 000000000000..261a07cfde84 --- /dev/null +++ b/201-web-app-loganalytics/azuredeploy.json @@ -0,0 +1,180 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "skuName": { + "type": "string", + "metadata": { + "description": "Which Pricing tier our App Service Plan to" + }, + "defaultValue": "S1" + }, + "skuCapacity": { + "type": "int", + "metadata": { + "description": "How many instances of our app service will be scaled out to" + }, + "defaultValue": 1 + + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + } + }, + "appName": { + "type": "string", + "defaultValue": "[uniqueString(resourceGroup().id)]" + } + }, + "variables": { + "appServicePlanName": "[toLower(concat('asp-', parameters('appName')))]", + "webSiteName": "[toLower(concat('wapp-', parameters('appName')))]", + "appInsightName": "[toLower(concat('appi-',parameters('appName')))]", + "logAnalyticsName": "[toLower(concat('la-',parameters('appName')))]" + }, + "resources": [ + { + "apiVersion": "2020-06-01", + "name": "[variables('appServicePlanName')]", + "type": "Microsoft.Web/serverfarms", + "location": "[parameters('location')]", + "tags": { + "displayName": "HostingPlan", + "ProjectName": "[parameters('appName')]" + }, + "sku": { + "name": "[parameters('skuName')]", + "capacity": "[parameters('skuCapacity')]" + }, + "properties": { + "name": "[variables('appServicePlanName')]" + } + }, + + { + "apiVersion": "2020-06-01", + "name": "[variables('webSiteName')]", + "type": "Microsoft.Web/sites", + "location": "[parameters('location')]", + "tags": { + "displayName": "Website", + "ProjectName": "[parameters('appName')]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]", + "[resourceId('Microsoft.OperationalInsights/workspaces',variables('logAnalyticsName'))]" + ], + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", + "httpsOnly": true, + "siteConfig": { + "phpVersion": "", + "minTlsVersion": "1.2" + } + }, + "resources": [ + { + "apiVersion": "2020-06-01", + "name": "appsettings", + "type": "config", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "Microsoft.ApplicationInsights.AzureWebSites", + "[resourceId('microsoft.insights/components/', variables('appInsightName'))]" + + ], + "properties": { + "APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(concat('microsoft.insights/components/', variables('appInsightName'))).InstrumentationKey]" + } + }, + { + "apiVersion": "2020-06-01", + "name": "Microsoft.ApplicationInsights.AzureWebSites", + "type": "siteextensions", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "[resourceId('microsoft.insights/components/', variables('appInsightName'))]" + ] + }, + + { + "apiVersion": "2020-06-01", + "name": "logs", + "type": "config", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]" + ], + "properties": { + "applicationLogs": { + "fileSystem": { + "level": "Warning" + } + }, + "httpLogs": { + "fileSystem": { + "retentionInMb": 40, + "enabled": true + } + }, + "failedRequestsTracing": { + "enabled": true + }, + "detailedErrorMessages": { + "enabled": true + } + } + } + ] + }, + + { + "name": "[variables('appInsightName')]", + "type": "microsoft.insights/components", + "apiVersion": "2020-02-02-preview", + "location": "[parameters('location')]", + "tags": { + "displayName": "AppInsight", + "ProjectName": "[parameters('appName')]" + }, + "kind": "string", + "properties": { + "Application_Type": "web", + "applicationId": "[variables('appInsightName')]", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" + ] + }, + { + "type": "Microsoft.OperationalInsights/workspaces", + "name": "[variables('logAnalyticsName')]", + "tags": { + "displayName": "Log Analytics", + "ProjectName": "[parameters('appName')]" + }, + "apiVersion": "2020-03-01-preview", + "location": "[parameters('location')]", + "properties": { + "sku": { + "name": "CapacityReservation", + "capacityReservationLevel": 100 + }, + "retentionInDays": 120, + "features": { + "searchVersion": 1, + "legacy": 0, + "enableLogAccessUsingOnlyResourcePermissions": true + } + } + } + + ] +} \ No newline at end of file diff --git a/201-web-app-loganalytics/azuredeploy.parameters.json b/201-web-app-loganalytics/azuredeploy.parameters.json new file mode 100644 index 000000000000..9c313f06f698 --- /dev/null +++ b/201-web-app-loganalytics/azuredeploy.parameters.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + } +} \ No newline at end of file diff --git a/201-web-app-loganalytics/metadata.json b/201-web-app-loganalytics/metadata.json new file mode 100644 index 000000000000..58d98b4d6316 --- /dev/null +++ b/201-web-app-loganalytics/metadata.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", + "type": "QuickStart", + "itemDisplayName": "Create a Web App with Application Insights sending to Log Analytics", + "description": "This template will is to help support the new API versions of microsoft.insights/components. Starting with 2020-02-02-preview WorkspaceID will be required when creating Application Inisghts.This template will deploy the App Service Plan, App Service, Application Insights, Log Analytics Workspace and hook it all together.", + "summary": "Create a Web App with Application Insights sending to Log Analytics", + "githubUsername": "JFolberth", + "dateUpdated": "2020-08-20" +} From 77c3f3fea646afc59ad2c9e54e3b1ade0b8c6ab0 Mon Sep 17 00:00:00 2001 From: John Folberth Date: Thu, 20 Aug 2020 11:44:05 -0400 Subject: [PATCH 02/12] updates --- .gitignore | 1 - 201-web-app-loganalytics/README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0fd6c5e180f2..9c6f8dc9c9ba 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,3 @@ test/template-validation-tests/mochawesome-report/* test/AzTemplateToolKit.zip test/arm-template-toolkit.zip test/ci-scripts/azuredeploy.parameters.new.json -/.vs diff --git a/201-web-app-loganalytics/README.md b/201-web-app-loganalytics/README.md index 1e8d4cc7e05b..0a610398372a 100644 --- a/201-web-app-loganalytics/README.md +++ b/201-web-app-loganalytics/README.md @@ -1,4 +1,4 @@ -# Azure SQL Database +# Web App with Application Insights sending to Log Analytics ![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/PublicLastTestDate.svg) ![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/201-web-app-loganalytics/PublicDeployment.svg) From 98f9d67a021a2c232f55014f0a0de93368dda816 Mon Sep 17 00:00:00 2001 From: John Folberth Date: Thu, 20 Aug 2020 11:54:40 -0400 Subject: [PATCH 03/12] Updated itemDescription for length and APPINSIGHTS_INSTRUMENTATIONKEY to reference rather than concat --- 201-web-app-loganalytics/azuredeploy.json | 3 ++- 201-web-app-loganalytics/metadata.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index 261a07cfde84..752f15fdfc0f 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -33,6 +33,7 @@ "appServicePlanName": "[toLower(concat('asp-', parameters('appName')))]", "webSiteName": "[toLower(concat('wapp-', parameters('appName')))]", "appInsightName": "[toLower(concat('appi-',parameters('appName')))]", + "appInisghtsReference": "[concat('microsoft.insights/components/',variables('appInsightsName'))]", "logAnalyticsName": "[toLower(concat('la-',parameters('appName')))]" }, "resources": [ @@ -90,7 +91,7 @@ ], "properties": { - "APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(concat('microsoft.insights/components/', variables('appInsightName'))).InstrumentationKey]" + "APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(variables('appInisghtsReference')).InstrumentationKey]" } }, { diff --git a/201-web-app-loganalytics/metadata.json b/201-web-app-loganalytics/metadata.json index 58d98b4d6316..e1bb83650a53 100644 --- a/201-web-app-loganalytics/metadata.json +++ b/201-web-app-loganalytics/metadata.json @@ -1,7 +1,7 @@ { "$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#", "type": "QuickStart", - "itemDisplayName": "Create a Web App with Application Insights sending to Log Analytics", + "itemDisplayName": "Web App w/ Application Insights sending to Log Analytics", "description": "This template will is to help support the new API versions of microsoft.insights/components. Starting with 2020-02-02-preview WorkspaceID will be required when creating Application Inisghts.This template will deploy the App Service Plan, App Service, Application Insights, Log Analytics Workspace and hook it all together.", "summary": "Create a Web App with Application Insights sending to Log Analytics", "githubUsername": "JFolberth", From d540a2139c5d1f2aab353090222eb81044b40c2d Mon Sep 17 00:00:00 2001 From: John Folberth Date: Thu, 20 Aug 2020 12:02:11 -0400 Subject: [PATCH 04/12] Removed empty property --- 201-web-app-loganalytics/azuredeploy.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index 752f15fdfc0f..255e5f096bbe 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -33,7 +33,7 @@ "appServicePlanName": "[toLower(concat('asp-', parameters('appName')))]", "webSiteName": "[toLower(concat('wapp-', parameters('appName')))]", "appInsightName": "[toLower(concat('appi-',parameters('appName')))]", - "appInisghtsReference": "[concat('microsoft.insights/components/',variables('appInsightsName'))]", + "appInisghtsReference": "[concat('microsoft.insights/components/',variables('appInsightName'))]", "logAnalyticsName": "[toLower(concat('la-',parameters('appName')))]" }, "resources": [ @@ -75,7 +75,6 @@ "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", "httpsOnly": true, "siteConfig": { - "phpVersion": "", "minTlsVersion": "1.2" } }, From 62157a82c205fb61a6b723a891dc4959d7d622d4 Mon Sep 17 00:00:00 2001 From: John Folberth Date: Mon, 24 Aug 2020 23:05:12 -0400 Subject: [PATCH 05/12] Downgraded api version to 2019-08-01 to support government cloud --- 201-web-app-loganalytics/azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index 255e5f096bbe..5db1cf50b0d7 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -38,7 +38,7 @@ }, "resources": [ { - "apiVersion": "2020-06-01", + "apiVersion": "2019-08-01", "name": "[variables('appServicePlanName')]", "type": "Microsoft.Web/serverfarms", "location": "[parameters('location')]", From 2e2ac23349426d3a6d98bd01f5d631e061994492 Mon Sep 17 00:00:00 2001 From: John Folberth Date: Tue, 25 Aug 2020 10:49:13 -0400 Subject: [PATCH 06/12] Update to retrigger release --- 201-web-app-loganalytics/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/201-web-app-loganalytics/README.md b/201-web-app-loganalytics/README.md index 0a610398372a..9023c137cc8f 100644 --- a/201-web-app-loganalytics/README.md +++ b/201-web-app-loganalytics/README.md @@ -16,6 +16,6 @@ This template will is to help support the new API versions of microsoft.insights/components. Starting with 2020-02-02-preview an [Workspace Resource ID](https://docs.microsoft.com/en-us/azure/templates/microsoft.insights/2020-02-02-preview/components) will be required. This template will deploy the App Service Plan, App Service, Application Insights, Log Analytics Workspace and hook it all together. -`Tags: Azure, App Service Plan, App Service, Log Analytics, Application Insights` +`Tags: Azure, App Service Plan, App Service, Log Analytics, Application Insights` From b1e883eb085faf5afe24eaaf2a63cb5df38cef88 Mon Sep 17 00:00:00 2001 From: John Folberth Date: Tue, 25 Aug 2020 10:59:47 -0400 Subject: [PATCH 07/12] Downgrading API version for US Government support --- 201-web-app-loganalytics/azuredeploy.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index 5db1cf50b0d7..a5d0a0b787db 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -56,7 +56,7 @@ }, { - "apiVersion": "2020-06-01", + "apiVersion": "2019-08-01", "name": "[variables('webSiteName')]", "type": "Microsoft.Web/sites", "location": "[parameters('location')]", @@ -80,7 +80,7 @@ }, "resources": [ { - "apiVersion": "2020-06-01", + "apiVersion": "2019-08-01", "name": "appsettings", "type": "config", "dependsOn": [ @@ -104,7 +104,7 @@ }, { - "apiVersion": "2020-06-01", + "apiVersion": "2019-08-01", "name": "logs", "type": "config", "dependsOn": [ From de5fccdd261c8e33be1f4669ca07dfe59ecba9c5 Mon Sep 17 00:00:00 2001 From: John Folberth Date: Tue, 25 Aug 2020 11:32:00 -0400 Subject: [PATCH 08/12] Downgrade for us gov cloud --- 201-web-app-loganalytics/azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index a5d0a0b787db..b89b59857454 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -94,7 +94,7 @@ } }, { - "apiVersion": "2020-06-01", + "apiVersion": "2019-08-01", "name": "Microsoft.ApplicationInsights.AzureWebSites", "type": "siteextensions", "dependsOn": [ From 18237c592aaa855c378caa67e7d62068dd2623ee Mon Sep 17 00:00:00 2001 From: John Folberth Date: Sat, 5 Sep 2020 21:50:15 -0400 Subject: [PATCH 09/12] Updates per comments to align with best practices --- 201-web-app-loganalytics/azuredeploy.json | 55 +++++++++++------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index b89b59857454..f3ffd379628e 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -4,17 +4,16 @@ "parameters": { "skuName": { "type": "string", + "defaultValue": "S1", "metadata": { "description": "Which Pricing tier our App Service Plan to" - }, - "defaultValue": "S1" + } }, "skuCapacity": { - "type": "int", + "type": "int", "defaultValue": 1 "metadata": { "description": "How many instances of our app service will be scaled out to" - }, - "defaultValue": 1 + } }, "location": { @@ -38,38 +37,38 @@ }, "resources": [ { + "type": "Microsoft.Web/serverfarms", "apiVersion": "2019-08-01", "name": "[variables('appServicePlanName')]", - "type": "Microsoft.Web/serverfarms", "location": "[parameters('location')]", - "tags": { - "displayName": "HostingPlan", - "ProjectName": "[parameters('appName')]" - }, "sku": { "name": "[parameters('skuName')]", "capacity": "[parameters('skuCapacity')]" }, + "tags": { + "displayName": "HostingPlan", + "ProjectName": "[parameters('appName')]" + }, "properties": { "name": "[variables('appServicePlanName')]" } }, { + "type": "Microsoft.Web/sites", "apiVersion": "2019-08-01", "name": "[variables('webSiteName')]", - "type": "Microsoft.Web/sites", "location": "[parameters('location')]", - "tags": { - "displayName": "Website", - "ProjectName": "[parameters('appName')]" + "identity": { + "type": "SystemAssigned" }, "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]", "[resourceId('Microsoft.OperationalInsights/workspaces',variables('logAnalyticsName'))]" ], - "identity": { - "type": "SystemAssigned" + "tags": { + "displayName": "Website", + "ProjectName": "[parameters('appName')]" }, "properties": { "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", @@ -80,9 +79,9 @@ }, "resources": [ { + "type": "config", "apiVersion": "2019-08-01", "name": "appsettings", - "type": "config", "dependsOn": [ "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", "Microsoft.ApplicationInsights.AzureWebSites", @@ -94,9 +93,9 @@ } }, { + "type": "siteextensions", "apiVersion": "2019-08-01", "name": "Microsoft.ApplicationInsights.AzureWebSites", - "type": "siteextensions", "dependsOn": [ "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", "[resourceId('microsoft.insights/components/', variables('appInsightName'))]" @@ -104,9 +103,9 @@ }, { + "type": "config", "apiVersion": "2019-08-01", "name": "logs", - "type": "config", "dependsOn": [ "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]" ], @@ -134,34 +133,34 @@ }, { - "name": "[variables('appInsightName')]", "type": "microsoft.insights/components", "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightName')]", "location": "[parameters('location')]", + "kind": "string", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" + ], "tags": { "displayName": "AppInsight", "ProjectName": "[parameters('appName')]" }, - "kind": "string", "properties": { "Application_Type": "web", "applicationId": "[variables('appInsightName')]", "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", - "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" - ] + } }, { "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2020-03-01-preview", "name": "[variables('logAnalyticsName')]", + "location": "[parameters('location')]", "tags": { "displayName": "Log Analytics", "ProjectName": "[parameters('appName')]" }, - "apiVersion": "2020-03-01-preview", - "location": "[parameters('location')]", "properties": { "sku": { "name": "CapacityReservation", From e57223a8e9b5b72c4aedd979a149c1b134cae13e Mon Sep 17 00:00:00 2001 From: John Folberth Date: Sat, 5 Sep 2020 21:52:17 -0400 Subject: [PATCH 10/12] forgot a ',' --- 201-web-app-loganalytics/azuredeploy.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index f3ffd379628e..cd4d6872405e 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -10,7 +10,8 @@ } }, "skuCapacity": { - "type": "int", "defaultValue": 1 + "type": "int", + "defaultValue": 1, "metadata": { "description": "How many instances of our app service will be scaled out to" } From dc0a91845c7c32b6ed3ae8a6ebbd1c6ccb223151 Mon Sep 17 00:00:00 2001 From: JFolberth Date: Tue, 8 Sep 2020 22:49:11 -0400 Subject: [PATCH 11/12] changed pricing tier --- 201-web-app-loganalytics/azuredeploy.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index cd4d6872405e..9ea3d971fae7 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -164,8 +164,7 @@ }, "properties": { "sku": { - "name": "CapacityReservation", - "capacityReservationLevel": 100 + "name": "pergb2018" }, "retentionInDays": 120, "features": { From 5cc4005a4d62aed20ce33ce913fb4ed1d2579efe Mon Sep 17 00:00:00 2001 From: Brian Moore Date: Wed, 9 Sep 2020 09:51:42 -0500 Subject: [PATCH 12/12] Update azuredeploy.json --- 201-web-app-loganalytics/azuredeploy.json | 327 +++++++++++----------- 1 file changed, 161 insertions(+), 166 deletions(-) diff --git a/201-web-app-loganalytics/azuredeploy.json b/201-web-app-loganalytics/azuredeploy.json index 9ea3d971fae7..beb60534feb5 100644 --- a/201-web-app-loganalytics/azuredeploy.json +++ b/201-web-app-loganalytics/azuredeploy.json @@ -1,179 +1,174 @@ { - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "skuName": { - "type": "string", - "defaultValue": "S1", - "metadata": { - "description": "Which Pricing tier our App Service Plan to" - } - }, - "skuCapacity": { - "type": "int", - "defaultValue": 1, - "metadata": { - "description": "How many instances of our app service will be scaled out to" - } + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "skuName": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "Which Pricing tier our App Service Plan to" + } + }, + "skuCapacity": { + "type": "int", + "defaultValue": 1, + "metadata": { + "description": "How many instances of our app service will be scaled out to" + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + } + }, + "appName": { + "type": "string", + "defaultValue": "[uniqueString(resourceGroup().id)]" + } }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - }, - "appName": { - "type": "string", - "defaultValue": "[uniqueString(resourceGroup().id)]" - } - }, - "variables": { - "appServicePlanName": "[toLower(concat('asp-', parameters('appName')))]", - "webSiteName": "[toLower(concat('wapp-', parameters('appName')))]", - "appInsightName": "[toLower(concat('appi-',parameters('appName')))]", - "appInisghtsReference": "[concat('microsoft.insights/components/',variables('appInsightName'))]", - "logAnalyticsName": "[toLower(concat('la-',parameters('appName')))]" - }, - "resources": [ - { - "type": "Microsoft.Web/serverfarms", - "apiVersion": "2019-08-01", - "name": "[variables('appServicePlanName')]", - "location": "[parameters('location')]", - "sku": { - "name": "[parameters('skuName')]", - "capacity": "[parameters('skuCapacity')]" - }, - "tags": { - "displayName": "HostingPlan", - "ProjectName": "[parameters('appName')]" - }, - "properties": { - "name": "[variables('appServicePlanName')]" - } + "variables": { + "appServicePlanName": "[toLower(concat('asp-', parameters('appName')))]", + "webSiteName": "[toLower(concat('wapp-', parameters('appName')))]", + "appInsightName": "[toLower(concat('appi-',parameters('appName')))]", + "logAnalyticsName": "[toLower(concat('la-',parameters('appName')))]" }, - - { - "type": "Microsoft.Web/sites", - "apiVersion": "2019-08-01", - "name": "[variables('webSiteName')]", - "location": "[parameters('location')]", - "identity": { - "type": "SystemAssigned" - }, - "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]", - "[resourceId('Microsoft.OperationalInsights/workspaces',variables('logAnalyticsName'))]" - ], - "tags": { - "displayName": "Website", - "ProjectName": "[parameters('appName')]" - }, - "properties": { - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", - "httpsOnly": true, - "siteConfig": { - "minTlsVersion": "1.2" - } - }, - "resources": [ + "resources": [ { - "type": "config", - "apiVersion": "2019-08-01", - "name": "appsettings", - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", - "Microsoft.ApplicationInsights.AzureWebSites", - "[resourceId('microsoft.insights/components/', variables('appInsightName'))]" - - ], - "properties": { - "APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(variables('appInisghtsReference')).InstrumentationKey]" - } - }, - { - "type": "siteextensions", - "apiVersion": "2019-08-01", - "name": "Microsoft.ApplicationInsights.AzureWebSites", - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", - "[resourceId('microsoft.insights/components/', variables('appInsightName'))]" - ] + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2019-08-01", + "name": "[variables('appServicePlanName')]", + "location": "[parameters('location')]", + "sku": { + "name": "[parameters('skuName')]", + "capacity": "[parameters('skuCapacity')]" + }, + "tags": { + "displayName": "HostingPlan", + "ProjectName": "[parameters('appName')]" + }, + "properties": { + "name": "[variables('appServicePlanName')]" + } }, - { - "type": "config", - "apiVersion": "2019-08-01", - "name": "logs", - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]" - ], - "properties": { - "applicationLogs": { - "fileSystem": { - "level": "Warning" - } + "type": "Microsoft.Web/sites", + "apiVersion": "2019-08-01", + "name": "[variables('webSiteName')]", + "location": "[parameters('location')]", + "identity": { + "type": "SystemAssigned" }, - "httpLogs": { - "fileSystem": { - "retentionInMb": 40, - "enabled": true - } + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]", + "[resourceId('Microsoft.OperationalInsights/workspaces',variables('logAnalyticsName'))]" + ], + "tags": { + "displayName": "Website", + "ProjectName": "[parameters('appName')]" }, - "failedRequestsTracing": { - "enabled": true + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]", + "httpsOnly": true, + "siteConfig": { + "minTlsVersion": "1.2" + } }, - "detailedErrorMessages": { - "enabled": true - } - } - } - ] - }, + "resources": [ + { + "type": "config", + "apiVersion": "2019-08-01", + "name": "appsettings", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "Microsoft.ApplicationInsights.AzureWebSites", + "[resourceId('microsoft.insights/components', variables('appInsightName'))]" - { - "type": "microsoft.insights/components", - "apiVersion": "2020-02-02-preview", - "name": "[variables('appInsightName')]", - "location": "[parameters('location')]", - "kind": "string", - "dependsOn": [ - "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", - "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" - ], - "tags": { - "displayName": "AppInsight", - "ProjectName": "[parameters('appName')]" - }, - "properties": { - "Application_Type": "web", - "applicationId": "[variables('appInsightName')]", - "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" - } - }, - { - "type": "Microsoft.OperationalInsights/workspaces", - "apiVersion": "2020-03-01-preview", - "name": "[variables('logAnalyticsName')]", - "location": "[parameters('location')]", - "tags": { - "displayName": "Log Analytics", - "ProjectName": "[parameters('appName')]" - }, - "properties": { - "sku": { - "name": "pergb2018" + ], + "properties": { + "APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components',variables('appInsightName'))).InstrumentationKey]" + } + }, + { + "type": "siteextensions", + "apiVersion": "2019-08-01", + "name": "Microsoft.ApplicationInsights.AzureWebSites", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "[resourceId('microsoft.insights/components', variables('appInsightName'))]" + ] + }, + { + "type": "config", + "apiVersion": "2019-08-01", + "name": "logs", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]" + ], + "properties": { + "applicationLogs": { + "fileSystem": { + "level": "Warning" + } + }, + "httpLogs": { + "fileSystem": { + "retentionInMb": 40, + "enabled": true + } + }, + "failedRequestsTracing": { + "enabled": true + }, + "detailedErrorMessages": { + "enabled": true + } + } + } + ] }, - "retentionInDays": 120, - "features": { - "searchVersion": 1, - "legacy": 0, - "enableLogAccessUsingOnlyResourcePermissions": true + { + "type": "microsoft.insights/components", + "apiVersion": "2020-02-02-preview", + "name": "[variables('appInsightName')]", + "location": "[parameters('location')]", + "kind": "string", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', variables('WebsiteName'))]", + "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" + ], + "tags": { + "displayName": "AppInsight", + "ProjectName": "[parameters('appName')]" + }, + "properties": { + "Application_Type": "web", + "applicationId": "[variables('appInsightName')]", + "WorkspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('logAnalyticsName'))]" + } + }, + { + "type": "Microsoft.OperationalInsights/workspaces", + "apiVersion": "2020-03-01-preview", + "name": "[variables('logAnalyticsName')]", + "location": "[parameters('location')]", + "tags": { + "displayName": "Log Analytics", + "ProjectName": "[parameters('appName')]" + }, + "properties": { + "sku": { + "name": "pergb2018" + }, + "retentionInDays": 120, + "features": { + "searchVersion": 1, + "legacy": 0, + "enableLogAccessUsingOnlyResourcePermissions": true + } + } } - } - } - - ] -} \ No newline at end of file + ] +}