Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Consolidating Log Analytics References & Definitions #1679

Merged
Merged
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0298cb6
Consolidating Log Analytics References & Definitons.
nharper285 Feb 24, 2022
782ce70
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 1, 2022
4b03041
Updating variable name.
nharper285 Mar 1, 2022
21516a0
Adding vm insights var name.
nharper285 Mar 1, 2022
99b5118
removing bad files.
nharper285 Mar 1, 2022
31b330a
Bad file.
nharper285 Mar 1, 2022
5575473
Fixing var.
nharper285 Mar 1, 2022
108f3e6
Adding new variables for all resources names.
nharper285 Mar 1, 2022
9fef521
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 2, 2022
e2190bd
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 3, 2022
2f11e98
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 3, 2022
2792b59
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 4, 2022
3a75db2
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 4, 2022
5e1eea2
Removing autoscale changes.
nharper285 Mar 4, 2022
5e6ab95
Merge branch 'user/noharper/merge-la-workspaces' of https://github.co…
nharper285 Mar 4, 2022
0d13a31
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 14, 2022
7ca613a
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 15, 2022
06b5092
Merge branch 'main' into user/noharper/merge-la-workspaces
hayleycall Mar 16, 2022
7b61bc3
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 21, 2022
4090d34
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 28, 2022
1f70b54
Merge branch 'main' into user/noharper/merge-la-workspaces
nharper285 Mar 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 74 additions & 76 deletions src/deployment/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
"variables": {
"autoscale_name": "[concat('onefuzz-autoscale-', uniquestring(resourceGroup().id))]",
"log_retention": 30,
"monitorAccountName": "[concat('logs-wb-', uniquestring(resourceGroup().id))]",
"appInsightsName": "[parameters('name')]",
"functionAppName": "[parameters('name')]",
"serverFarmName": "[parameters('name')]",
"monitorAccountName": "[parameters('name')]",
"vmInsightsName": "[concat('VMInsights', '(', variables('monitorAccountName'), ')')]",
nharper285 marked this conversation as resolved.
Show resolved Hide resolved
"scaleset_identity": "[concat(parameters('name'), '-scalesetid')]",
"signalr-name": "[concat('onefuzz-', uniquestring(resourceGroup().id))]",
"storage_account_sas": {
Expand Down Expand Up @@ -124,7 +128,7 @@
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"objectId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2019-08-01', 'full').identity.principalId]",
"objectId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2019-08-01', 'full').identity.principalId]",
"tenantId": "[subscription().tenantId]",
"permissions": {
"secrets": [
Expand All @@ -148,7 +152,7 @@
},
{
"apiVersion": "2018-11-01",
"name": "[parameters('name')]",
"name": "[variables('functionAppName')]",
"type": "Microsoft.Web/sites",
"kind": "functionapp,linux",
"location": "[resourceGroup().location]",
Expand All @@ -157,8 +161,8 @@
},
"dependsOn": [
"[resourceId('Microsoft.SignalRService/SignalR', variables('signalr-name'))]",
"[resourceId('microsoft.insights/components/', parameters('name'))]",
"[resourceId('Microsoft.Web/serverFarms', parameters('name'))]",
"[resourceId('microsoft.insights/components/', variables('appInsightsName'))]",
"[resourceId('Microsoft.Web/serverFarms', variables('serverFarmName'))]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountNameFunc'))]"
],
Expand All @@ -172,7 +176,7 @@
"name": "logs",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Web/sites/', parameters('name'))]",
"[concat('Microsoft.Web/sites/', variables('functionAppName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountNameFunc'))]"
],
"properties": {
Expand All @@ -187,7 +191,7 @@
}
],
"properties": {
"name": "[parameters('name')]",
"name": "[variables('functionAppName')]",
"siteConfig": {
"appSettings": [
{
Expand All @@ -204,11 +208,11 @@
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', parameters('name')), '2015-05-01').InstrumentationKey]"
"value": "[reference(resourceId('microsoft.insights/components/', variables('appInsightsName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "APPINSIGHTS_APPID",
"value": "[reference(resourceId('microsoft.insights/components/', parameters('name')), '2015-05-01').AppId]"
"value": "[reference(resourceId('microsoft.insights/components/', variables('appInsightsName')), '2015-05-01').AppId]"
},
{
"name": "ONEFUZZ_TELEMETRY",
Expand Down Expand Up @@ -288,21 +292,21 @@
"isAadAutoProvisioned": false
}
},
"serverFarmId": "[resourceId('Microsoft.Web/serverFarms', parameters('name'))]",
"serverFarmId": "[resourceId('Microsoft.Web/serverFarms', variables('serverFarmName'))]",
"hostingEnvironment": "",
"clientAffinityEnabled": false,
"httpsOnly": true
}
},
{
"apiVersion": "2018-02-01",
"name": "[parameters('name')]",
"name": "[variables('serverFarmName')]",
"type": "Microsoft.Web/serverFarms",
"location": "[resourceGroup().location]",
"kind": "linux",
"dependsOn": [],
"properties": {
"name": "[parameters('name')]",
"name": "[variables('serverFarmName')]",
"reserved": true
},
"sku": {
Expand All @@ -322,12 +326,12 @@
"type": "microsoft.insights/autoscalesettings",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverFarms', parameters('name'))]"
"[resourceId('Microsoft.Web/serverFarms', variables('serverFarmName'))]"
],
"properties": {
"name": "[variables('autoscale_name')]",
"enabled": true,
"targetResourceUri": "[resourceId('Microsoft.Web/serverFarms/', parameters('name'))]",
"targetResourceUri": "[resourceId('Microsoft.Web/serverFarms/', variables('serverFarmName'))]",
"profiles": [
{
"name": "Auto scale condition",
Expand All @@ -347,7 +351,7 @@
"metricTrigger": {
"metricName": "CpuPercentage",
"metricNamespace": "microsoft.web/serverfarms",
"metricResourceUri": "[resourceId('Microsoft.Web/serverFarms/', parameters('name'))]",
"metricResourceUri": "[resourceId('Microsoft.Web/serverFarms/', variables('serverFarmName'))]",
"operator": "GreaterThanOrEqual",
"statistic": "Average",
"threshold": 20,
Expand All @@ -368,7 +372,7 @@
"metricTrigger": {
"metricName": "CpuPercentage",
"metricNamespace": "microsoft.web/serverfarms",
"metricResourceUri": "[resourceId('Microsoft.Web/serverFarms/', parameters('name'))]",
"metricResourceUri": "[resourceId('Microsoft.Web/serverFarms/', variables('serverFarmName'))]",
"operator": "LessThan",
"statistic": "Average",
"threshold": 20,
Expand All @@ -390,52 +394,6 @@
}
},

{
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2020-08-01",
"name": "[parameters('name')]",
"location": "[resourceGroup().location]",
"properties": {}
},

{
"apiVersion": "2020-02-02-preview",
"name": "[parameters('name')]",
"type": "microsoft.insights/components",
"location": "[resourceGroup().location]",
"kind": "",
"properties": {
"ApplicationId": "[parameters('name')]",
"Application_Type": "other",
"RetentionInDays": "[variables('log_retention')]",
"WorkspaceResourceId" : "[resourceId('Microsoft.OperationalInsights/workspaces', parameters('name'))]"
},
"tags": {
"OWNER": "[parameters('owner')]"
},
"dependsOn" : [
"[resourceId('Microsoft.OperationalInsights/workspaces', parameters('name'))]"
],
"resources": [
{
"name": "df20765c-ed5b-46f9-a47b-20f4aaf7936d",
"type": "microsoft.insights/workbooks",
"location": "[resourceGroup().location]",
"apiVersion": "2018-06-17-preview",
"dependsOn": [
"[resourceId('microsoft.insights/components', parameters('name'))]"
],
"kind": "shared",
"properties": {
"displayName": "LibFuzzer Job Dashboard",
"serializedData": "[parameters('workbookData').libFuzzerJob]",
"version": "1.0",
"sourceId": "[resourceId('microsoft.insights/components', parameters('name'))]",
"category": "tsg"
}
}
]
},
{
"type": "Microsoft.OperationalInsights/workspaces",
"name": "[variables('monitorAccountName')]",
Expand All @@ -456,7 +414,7 @@
{
"apiVersion": "2015-11-01-preview",
"location": "[resourceGroup().location]",
"name": "[concat('VMInsights', '(', variables('monitorAccountName'), ')')]",
"name": "[variables('vmInsightsName')]",
"type": "Microsoft.OperationsManagement/solutions",
"dependsOn": [
"[resourceId('Microsoft.OperationalInsights/workspaces', variables('monitorAccountName'))]"
Expand All @@ -465,7 +423,7 @@
"workspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('monitorAccountName'))]"
},
"plan": {
"name": "[concat('VMInsights', '(', variables('monitorAccountName'), ')')]",
"name": "[variables('vmInsightsName')]",
"publisher": "Microsoft",
"product": "[Concat('OMSGallery/', 'VMInsights')]",
"promotionCode": ""
Expand Down Expand Up @@ -583,6 +541,46 @@
}
]
},

{
"apiVersion": "2020-02-02-preview",
"name": "[variables('appInsightsName')]",
"type": "microsoft.insights/components",
"location": "[resourceGroup().location]",
"kind": "",
"properties": {
"ApplicationId": "[variables('appInsightsName')]",
"Application_Type": "other",
"RetentionInDays": "[variables('log_retention')]",
"WorkspaceResourceId" : "[resourceId('Microsoft.OperationalInsights/workspaces', variables('monitorAccountName'))]"
},
"tags": {
"OWNER": "[parameters('owner')]"
},
"dependsOn" : [
"[resourceId('Microsoft.OperationalInsights/workspaces', variables('monitorAccountName'))]"
],
"resources": [
{
"name": "df20765c-ed5b-46f9-a47b-20f4aaf7936d",
"type": "microsoft.insights/workbooks",
"location": "[resourceGroup().location]",
"apiVersion": "2018-06-17-preview",
"dependsOn": [
"[resourceId('microsoft.insights/components', variables('appInsightsName'))]"
],
"kind": "shared",
"properties": {
"displayName": "LibFuzzer Job Dashboard",
"serializedData": "[parameters('workbookData').libFuzzerJob]",
"version": "1.0",
"sourceId": "[resourceId('microsoft.insights/components', variables('appInsightsName'))]",
"category": "tsg"
}
}
]
},

{
"apiVersion": "2019-06-01",
"type": "Microsoft.Storage/storageAccounts",
Expand Down Expand Up @@ -751,10 +749,10 @@
"name": "[guid(concat(resourceGroup().id, '-vmss'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('Virtual Machine Contributor'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
Expand All @@ -766,10 +764,10 @@
"name": "[guid(concat(resourceGroup().id, '-storage'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('Storage Account Contributor'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
Expand All @@ -781,10 +779,10 @@
"name": "[guid(concat(resourceGroup().id, '-network'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('Network Contributor'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
Expand All @@ -796,10 +794,10 @@
"name": "[guid(concat(resourceGroup().id, '-logs'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('Log Analytics Contributor'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
Expand All @@ -811,10 +809,10 @@
"name": "[guid(concat(resourceGroup().id, '-user_managed_idenity'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('Managed Identity Operator'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
Expand All @@ -826,10 +824,10 @@
"name": "[guid(concat(resourceGroup().id, '-auto_scale'))]",
"properties": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', variables('OneFuzz Deployment'))]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', parameters('name')), '2018-02-01', 'Full').identity.principalId]"
"principalId": "[reference(resourceId('Microsoft.Web/sites', variables('functionAppName')), '2018-02-01', 'Full').identity.principalId]"
},
"DependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('name'))]"
"[resourceId('Microsoft.Web/sites', variables('functionAppName'))]"
],
"tags": {
"OWNER": "[parameters('owner')]"
Expand Down