From e8bca3d41a8e969bc96fb0014a5b227b1fbe5fdd Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:19:22 +0000 Subject: [PATCH 01/10] access core's appinsights when debugging locally --- templates/core/terraform/azure-monitor/azure-monitor.tf | 4 ++-- templates/core/terraform/azure-monitor/variables.tf | 1 + templates/core/terraform/main.tf | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/core/terraform/azure-monitor/azure-monitor.tf b/templates/core/terraform/azure-monitor/azure-monitor.tf index 3c8ef0a489..361b5d3529 100644 --- a/templates/core/terraform/azure-monitor/azure-monitor.tf +++ b/templates/core/terraform/azure-monitor/azure-monitor.tf @@ -6,7 +6,7 @@ resource "azurerm_log_analytics_workspace" "core" { retention_in_days = 30 sku = "PerGB2018" tags = var.tre_core_tags - internet_ingestion_enabled = false + internet_ingestion_enabled = var.enable_local_debugging ? true : false lifecycle { ignore_changes = [tags] } } @@ -65,7 +65,7 @@ resource "azurerm_application_insights" "core" { resource_group_name = var.resource_group_name workspace_id = azurerm_log_analytics_workspace.core.id application_type = "web" - internet_ingestion_enabled = false + internet_ingestion_enabled = var.enable_local_debugging ? true : false force_customer_storage_for_profiler = true tags = var.tre_core_tags diff --git a/templates/core/terraform/azure-monitor/variables.tf b/templates/core/terraform/azure-monitor/variables.tf index c94c2f3bb6..135f83cab4 100644 --- a/templates/core/terraform/azure-monitor/variables.tf +++ b/templates/core/terraform/azure-monitor/variables.tf @@ -8,3 +8,4 @@ variable "azure_monitor_ods_opinsights_dns_zone_id" {} variable "azure_monitor_agentsvc_dns_zone_id" {} variable "blob_core_dns_zone_id" {} variable "tre_core_tags" {} +variable "enable_local_debugging" {} diff --git a/templates/core/terraform/main.tf b/templates/core/terraform/main.tf index a937dc636d..430519855d 100644 --- a/templates/core/terraform/main.tf +++ b/templates/core/terraform/main.tf @@ -68,6 +68,7 @@ module "azure_monitor" { azure_monitor_agentsvc_dns_zone_id = module.network.azure_monitor_agentsvc_dns_zone_id blob_core_dns_zone_id = module.network.blob_core_dns_zone_id tre_core_tags = local.tre_core_tags + enable_local_debugging = var.enable_local_debugging depends_on = [ module.network From 47737e79c7f723444ed0a977631fbd5758ff274c Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:19:48 +0000 Subject: [PATCH 02/10] appinsights without arm in base workspace --- templates/workspaces/base/porter.yaml | 2 +- .../terraform/azure-monitor/azure-monitor.tf | 140 +++++++----------- .../base/terraform/azure-monitor/outputs.tf | 2 +- .../base/terraform/azure-monitor/variables.tf | 1 + .../workspaces/base/terraform/providers.tf | 5 + .../workspaces/base/terraform/workspace.tf | 1 + 6 files changed, 60 insertions(+), 91 deletions(-) diff --git a/templates/workspaces/base/porter.yaml b/templates/workspaces/base/porter.yaml index 2586d4ed41..38baf49370 100644 --- a/templates/workspaces/base/porter.yaml +++ b/templates/workspaces/base/porter.yaml @@ -1,6 +1,6 @@ --- name: tre-workspace-base -version: 0.3.24 +version: 0.3.25 description: "A base Azure TRE workspace" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf b/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf index bba3efd8e0..3f3c55e565 100644 --- a/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf +++ b/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf @@ -1,10 +1,26 @@ resource "azurerm_log_analytics_workspace" "workspace" { - name = "log-${var.tre_id}-ws-${local.short_workspace_id}" - resource_group_name = var.resource_group_name - location = var.location - retention_in_days = 30 - sku = "PerGB2018" - tags = var.tre_workspace_tags + name = "log-${var.tre_id}-ws-${local.short_workspace_id}" + resource_group_name = var.resource_group_name + location = var.location + retention_in_days = 30 + sku = "PerGB2018" + tags = var.tre_workspace_tags + internet_ingestion_enabled = var.enable_local_debugging ? true : false + + lifecycle { ignore_changes = [tags] } +} + +# Storage account for Application Insights +# Because Private Link is enabled on Application Performance Management (APM), Bring Your Own Storage (BYOS) approach is required +resource "azurerm_storage_account" "app_insights" { + name = lower(replace("stai${var.tre_id}ws${local.short_workspace_id}", "-", "")) + resource_group_name = var.resource_group_name + location = var.location + account_kind = "StorageV2" + account_tier = "Standard" + account_replication_type = "LRS" + allow_nested_items_to_be_public = false + tags = var.tre_workspace_tags lifecycle { ignore_changes = [tags] } } @@ -23,97 +39,43 @@ resource "azurerm_log_analytics_linked_storage_account" "workspace_storage_custo storage_account_ids = [azurerm_storage_account.app_insights.id] } - -# Storage account for Application Insights -# Because Private Link is enabled on Application Performance Management (APM), Bring Your Own Storage (BYOS) approach is required -resource "azurerm_storage_account" "app_insights" { - name = lower(replace("stai${var.tre_id}ws${local.short_workspace_id}", "-", "")) - resource_group_name = var.resource_group_name - location = var.location - account_kind = "StorageV2" - account_tier = "Standard" - account_replication_type = "LRS" - allow_nested_items_to_be_public = false - tags = var.tre_workspace_tags +resource "azurerm_monitor_private_link_scope" "workspace" { + name = "ampls-${var.tre_id}-ws-${local.short_workspace_id}" + resource_group_name = var.resource_group_name + tags = var.tre_workspace_tags lifecycle { ignore_changes = [tags] } } -data "azurerm_resource_group" "resource_group" { - name = var.resource_group_name -} -data "local_file" "app_insights_arm_template" { - filename = "${path.module}/app_insights.json" +resource "azurerm_monitor_private_link_scoped_service" "ampls_log_anaytics" { + name = "ampls-log-anaytics-service" + resource_group_name = var.resource_group_name + scope_name = azurerm_monitor_private_link_scope.workspace.name + linked_resource_id = azurerm_log_analytics_workspace.workspace.id } + + # Application Insights -# Deployed using ARM template, because Terraform's azurerm_application_insights does not support linked storage account -resource "azurerm_resource_group_template_deployment" "app_insights_workspace" { - name = local.app_insights_name - resource_group_name = var.resource_group_name - deployment_mode = "Incremental" - template_content = data.local_file.app_insights_arm_template.content - - parameters_content = jsonencode({ - "app_insights_name" = { - value = local.app_insights_name - } - "location" = { - value = var.location - } - "log_analytics_workspace_id" = { - value = azurerm_log_analytics_workspace.workspace.id - } - "application_type" = { - value = "web" - } - "storage_account_name" = { - value = azurerm_storage_account.app_insights.name - } - "tre_core_tags" = { - value = var.tre_workspace_tags - } - "smartdetectoralertrules_failure_anomalies_name" = { - value = "failure anomalies - ${local.app_insights_name}" - } - "smartdetectoralertrules_failure_anomalies_scope" = { - value = "${data.azurerm_resource_group.resource_group.id}/providers/microsoft.insights/components/${local.app_insights_name}" - } - "smartdetectoralertrules_failure_anomalies_group_id" = { - value = "${data.azurerm_resource_group.resource_group.id}/providers/microsoft.insights/actiongroups/application insights smart detection" - } - }) -} -data "local_file" "ampls_arm_template" { - filename = "${path.module}/ampls.json" +resource "azurerm_application_insights" "workspace" { + name = "appi-${var.tre_id}-ws-${local.short_workspace_id}" + location = var.location + resource_group_name = var.resource_group_name + workspace_id = azurerm_log_analytics_workspace.workspace.id + application_type = "web" + internet_ingestion_enabled = var.enable_local_debugging ? true : false + force_customer_storage_for_profiler = true + tags = var.tre_workspace_tags + + lifecycle { ignore_changes = [tags] } } -resource "azurerm_resource_group_template_deployment" "ampls" { - name = "ampls-${var.tre_id}" - resource_group_name = var.resource_group_name - deployment_mode = "Incremental" - template_content = data.local_file.ampls_arm_template.content - - - parameters_content = jsonencode({ - "private_link_scope_name" = { - value = "ampls-${var.tre_id}-ws-${local.short_workspace_id}" - } - "workspace_name" = { - value = azurerm_log_analytics_workspace.workspace.name - } - "app_insights_name" = { - value = local.app_insights_name - } - "tre_workspace_tags" = { - value = var.tre_workspace_tags - } - }) - depends_on = [ - azurerm_log_analytics_workspace.workspace, - azurerm_resource_group_template_deployment.app_insights_workspace - ] +resource "azurerm_monitor_private_link_scoped_service" "ampls_app_insights" { + name = "ampls-app-insights-service" + resource_group_name = var.resource_group_name + scope_name = azurerm_monitor_private_link_scope.workspace.name + linked_resource_id = azurerm_application_insights.workspace.id } resource "azurerm_private_endpoint" "azure_monitor_private_endpoint" { @@ -126,7 +88,7 @@ resource "azurerm_private_endpoint" "azure_monitor_private_endpoint" { lifecycle { ignore_changes = [tags] } private_service_connection { - private_connection_resource_id = jsondecode(azurerm_resource_group_template_deployment.ampls.output_content).resourceId.value + private_connection_resource_id = azurerm_monitor_private_link_scope.workspace.id name = "psc-ampls-${var.tre_id}-ws-${local.short_workspace_id}" subresource_names = ["azuremonitor"] is_manual_connection = false @@ -145,6 +107,6 @@ resource "azurerm_private_endpoint" "azure_monitor_private_endpoint" { } depends_on = [ - azurerm_resource_group_template_deployment.ampls + azurerm_monitor_private_link_scoped_service.ampls_app_insights, ] } diff --git a/templates/workspaces/base/terraform/azure-monitor/outputs.tf b/templates/workspaces/base/terraform/azure-monitor/outputs.tf index 4ff1d48775..e09791912c 100644 --- a/templates/workspaces/base/terraform/azure-monitor/outputs.tf +++ b/templates/workspaces/base/terraform/azure-monitor/outputs.tf @@ -1,5 +1,5 @@ output "app_insights_connection_string" { - value = jsondecode(azurerm_resource_group_template_deployment.app_insights_workspace.output_content).connectionString.value + value = azurerm_application_insights.workspace.connection_string } output "log_analytics_workspace_id" { diff --git a/templates/workspaces/base/terraform/azure-monitor/variables.tf b/templates/workspaces/base/terraform/azure-monitor/variables.tf index 13bbec8b00..452d974f92 100644 --- a/templates/workspaces/base/terraform/azure-monitor/variables.tf +++ b/templates/workspaces/base/terraform/azure-monitor/variables.tf @@ -9,3 +9,4 @@ variable "azure_monitor_ods_opinsights_dns_zone_id" {} variable "azure_monitor_agentsvc_dns_zone_id" {} variable "blob_core_dns_zone_id" {} variable "tre_resource_id" {} +variable "enable_local_debugging" {} diff --git a/templates/workspaces/base/terraform/providers.tf b/templates/workspaces/base/terraform/providers.tf index 07233a4bcb..d3d6b1e66c 100644 --- a/templates/workspaces/base/terraform/providers.tf +++ b/templates/workspaces/base/terraform/providers.tf @@ -31,6 +31,11 @@ provider "azurerm" { recover_soft_deleted_certificates = true recover_soft_deleted_keys = true } + + # TODO: remove when this is resolved: https://github.com/hashicorp/terraform-provider-azurerm/issues/18026 + resource_group { + prevent_deletion_if_contains_resources = false + } } } diff --git a/templates/workspaces/base/terraform/workspace.tf b/templates/workspaces/base/terraform/workspace.tf index 21c698a9dd..5dbeaeafb7 100644 --- a/templates/workspaces/base/terraform/workspace.tf +++ b/templates/workspaces/base/terraform/workspace.tf @@ -71,6 +71,7 @@ module "azure_monitor" { azure_monitor_ods_opinsights_dns_zone_id = module.network.azure_monitor_ods_opinsights_dns_zone_id azure_monitor_agentsvc_dns_zone_id = module.network.azure_monitor_agentsvc_dns_zone_id blob_core_dns_zone_id = module.network.blobcore_zone_id + enable_local_debugging = var.enable_local_debugging depends_on = [ module.network, ] From 34c04a8f3a20a9cbcc4e3e29fa3f84ddc668a665 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:20:30 +0000 Subject: [PATCH 03/10] bundle build validates terraform --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 95c8b065e6..9bfc9702c8 100644 --- a/Makefile +++ b/Makefile @@ -183,6 +183,7 @@ bundle-build: && . ${MAKEFILE_DIR}/devops/scripts/load_env.sh ${DIR}/.env \ && . ${MAKEFILE_DIR}/devops/scripts/set_docker_sock_permission.sh \ && cd ${DIR} \ + && if [ -d terraform ]; then terraform -chdir=terraform init -backend=false; terraform -chdir=terraform validate; fi \ && FULL_IMAGE_NAME_PREFIX=${FULL_IMAGE_NAME_PREFIX} IMAGE_NAME_PREFIX=${IMAGE_NAME_PREFIX} \ ${MAKEFILE_DIR}/devops/scripts/bundle_runtime_image_build.sh \ && porter build --debug From 658ea7c63ee649c2645688e326423b142128e17e Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 05:46:55 +0000 Subject: [PATCH 04/10] fix --- templates/workspaces/base/porter.yaml | 2 +- .../terraform/azure-monitor/azure-monitor.tf | 19 +++++++++++++++++++ .../workspaces/base/terraform/providers.tf | 6 +++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/templates/workspaces/base/porter.yaml b/templates/workspaces/base/porter.yaml index 38baf49370..a6c1394312 100644 --- a/templates/workspaces/base/porter.yaml +++ b/templates/workspaces/base/porter.yaml @@ -1,6 +1,6 @@ --- name: tre-workspace-base -version: 0.3.25 +version: 0.3.30 description: "A base Azure TRE workspace" dockerfile: Dockerfile.tmpl registry: azuretre diff --git a/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf b/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf index 3f3c55e565..813a8beeb5 100644 --- a/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf +++ b/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf @@ -71,6 +71,25 @@ resource "azurerm_application_insights" "workspace" { lifecycle { ignore_changes = [tags] } } +resource "azurerm_monitor_action_group" "failure_anomalies" { + name = "${azurerm_application_insights.workspace.name}-failure-anomalies-action-group" + resource_group_name = var.resource_group_name + short_name = "Failures" +} + +resource "azurerm_monitor_smart_detector_alert_rule" "example" { + name = "Failure Anomalies - ${local.app_insights_name}" + resource_group_name = var.resource_group_name + severity = "Sev3" + scope_resource_ids = [azurerm_application_insights.workspace.id] + frequency = "PT1M" + detector_type = "FailureAnomaliesDetector" + + action_group { + ids = [azurerm_monitor_action_group.failure_anomalies.id] + } +} + resource "azurerm_monitor_private_link_scoped_service" "ampls_app_insights" { name = "ampls-app-insights-service" resource_group_name = var.resource_group_name diff --git a/templates/workspaces/base/terraform/providers.tf b/templates/workspaces/base/terraform/providers.tf index d3d6b1e66c..a276ddfd6d 100644 --- a/templates/workspaces/base/terraform/providers.tf +++ b/templates/workspaces/base/terraform/providers.tf @@ -33,9 +33,9 @@ provider "azurerm" { } # TODO: remove when this is resolved: https://github.com/hashicorp/terraform-provider-azurerm/issues/18026 - resource_group { - prevent_deletion_if_contains_resources = false - } + # resource_group { + # prevent_deletion_if_contains_resources = false + # } } } From 89c57b43bc71cc21a2a80bf5d3eef94914cdeb4f Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 06:31:01 +0000 Subject: [PATCH 05/10] fix --- templates/workspaces/base/porter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/workspaces/base/porter.yaml b/templates/workspaces/base/porter.yaml index a6c1394312..5659cdfe21 100644 --- a/templates/workspaces/base/porter.yaml +++ b/templates/workspaces/base/porter.yaml @@ -1,6 +1,6 @@ --- name: tre-workspace-base -version: 0.3.30 +version: 0.3.31 description: "A base Azure TRE workspace" dockerfile: Dockerfile.tmpl registry: azuretre From a27dbd4e82ee1ae577876fa94d50ec7ed50abf33 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:06:15 +0000 Subject: [PATCH 06/10] fix --- .../terraform/azure-monitor/azure-monitor.tf | 42 ++++++++++--------- .../workspaces/base/terraform/providers.tf | 5 --- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf b/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf index 813a8beeb5..246d307413 100644 --- a/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf +++ b/templates/workspaces/base/terraform/azure-monitor/azure-monitor.tf @@ -71,25 +71,6 @@ resource "azurerm_application_insights" "workspace" { lifecycle { ignore_changes = [tags] } } -resource "azurerm_monitor_action_group" "failure_anomalies" { - name = "${azurerm_application_insights.workspace.name}-failure-anomalies-action-group" - resource_group_name = var.resource_group_name - short_name = "Failures" -} - -resource "azurerm_monitor_smart_detector_alert_rule" "example" { - name = "Failure Anomalies - ${local.app_insights_name}" - resource_group_name = var.resource_group_name - severity = "Sev3" - scope_resource_ids = [azurerm_application_insights.workspace.id] - frequency = "PT1M" - detector_type = "FailureAnomaliesDetector" - - action_group { - ids = [azurerm_monitor_action_group.failure_anomalies.id] - } -} - resource "azurerm_monitor_private_link_scoped_service" "ampls_app_insights" { name = "ampls-app-insights-service" resource_group_name = var.resource_group_name @@ -129,3 +110,26 @@ resource "azurerm_private_endpoint" "azure_monitor_private_endpoint" { azurerm_monitor_private_link_scoped_service.ampls_app_insights, ] } + +# We don't really need this, but if not present the RG will not be empty and won't be destroyed +# TODO: remove when this is resolved: https://github.com/hashicorp/terraform-provider-azurerm/issues/18026 +resource "azurerm_monitor_action_group" "failure_anomalies" { + name = "${azurerm_application_insights.workspace.name}-failure-anomalies-action-group" + resource_group_name = var.resource_group_name + short_name = "Failures" +} + +# We don't really need this, but if not present the RG will not be empty and won't be destroyed +# TODO: remove when this is resolved: https://github.com/hashicorp/terraform-provider-azurerm/issues/18026 +resource "azurerm_monitor_smart_detector_alert_rule" "failure_anomalies" { + name = "Failure Anomalies - ${local.app_insights_name}" + resource_group_name = var.resource_group_name + severity = "Sev3" + scope_resource_ids = [azurerm_application_insights.workspace.id] + frequency = "PT1M" + detector_type = "FailureAnomaliesDetector" + + action_group { + ids = [azurerm_monitor_action_group.failure_anomalies.id] + } +} diff --git a/templates/workspaces/base/terraform/providers.tf b/templates/workspaces/base/terraform/providers.tf index a276ddfd6d..07233a4bcb 100644 --- a/templates/workspaces/base/terraform/providers.tf +++ b/templates/workspaces/base/terraform/providers.tf @@ -31,11 +31,6 @@ provider "azurerm" { recover_soft_deleted_certificates = true recover_soft_deleted_keys = true } - - # TODO: remove when this is resolved: https://github.com/hashicorp/terraform-provider-azurerm/issues/18026 - # resource_group { - # prevent_deletion_if_contains_resources = false - # } } } From 9579ce54a21bc54a247f02fb6affd928ffb364a3 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:11:29 +0000 Subject: [PATCH 07/10] update change log --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8b42b89e0..842e6f43c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,14 +9,16 @@ FEATURES: -* MySql workspace service ([#2476](https://github.com/microsoft/AzureTRE/issues/2476)) +* MySql workspace service ([#2476](https://github.com/microsoft/AzureTRE/pull/2476)) ENHANCEMENTS: -* 'CreationTime' field was added to Airlock requests ([#2432](https://github.com/microsoft/AzureTRE/issues/2432)) +* 'CreationTime' field was added to Airlock requests ([#2432](https://github.com/microsoft/AzureTRE/pull/2432)) * Bundles mirror Terraform plugins when built ([#2446](https://github.com/microsoft/AzureTRE/pull/2446)) -* 'Get all Airlock requests' endpoint supports filtering ([#2433](https://github.com/microsoft/AzureTRE/pull/2433)). -* API uses user delagation key when generating SAS token for airlock requests. ([#2390](https://github.com/microsoft/AzureTRE/issues/2390)) +* 'Get all Airlock requests' endpoint supports filtering ([#2433](https://github.com/microsoft/AzureTRE/pull/2433)) +* API uses user delagation key when generating SAS token for airlock requests ([#2460](https://github.com/microsoft/AzureTRE/pull/2460)) +* Longer docker caching in Resource Processor ([#2486](https://github.com/microsoft/AzureTRE/pull/2486)) +* Remove AppInsights Profiler support in base workspace bundle and deploy with native Terraform resources ([#2478](https://github.com/microsoft/AzureTRE/pull/2478)) BUG FIXES: From 244c7c2da30849e655732a4ba07813d06b33f695 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:12:31 +0000 Subject: [PATCH 08/10] update porter yaml --- templates/workspaces/base/porter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/workspaces/base/porter.yaml b/templates/workspaces/base/porter.yaml index 5659cdfe21..38baf49370 100644 --- a/templates/workspaces/base/porter.yaml +++ b/templates/workspaces/base/porter.yaml @@ -1,6 +1,6 @@ --- name: tre-workspace-base -version: 0.3.31 +version: 0.3.25 description: "A base Azure TRE workspace" dockerfile: Dockerfile.tmpl registry: azuretre From 6cbc1750f5a9ada15bd40b23dea87414734dc717 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:13:22 +0000 Subject: [PATCH 09/10] remove arm templates --- .../base/terraform/azure-monitor/ampls.json | 64 ------------ .../terraform/azure-monitor/app_insights.json | 99 ------------------- 2 files changed, 163 deletions(-) delete mode 100644 templates/workspaces/base/terraform/azure-monitor/ampls.json delete mode 100644 templates/workspaces/base/terraform/azure-monitor/app_insights.json diff --git a/templates/workspaces/base/terraform/azure-monitor/ampls.json b/templates/workspaces/base/terraform/azure-monitor/ampls.json deleted file mode 100644 index 48e1237917..0000000000 --- a/templates/workspaces/base/terraform/azure-monitor/ampls.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "private_link_scope_name": { - "type": "String" - }, - "workspace_name": { - "type": "String" - }, - "app_insights_name": { - "type": "String" - }, - "tre_workspace_tags": { - "type": "Object" - } - }, - "variables": {}, - "resources": [ - { - "type": "microsoft.insights/privateLinkScopes", - "apiVersion": "2021-07-01-preview", - "name": "[parameters('private_link_scope_name')]", - "location": "global", - "tags": "[parameters('tre_workspace_tags')]", - "properties": { - "accessModeSettings": { - "queryAccessMode":"Open", - "ingestionAccessMode":"Open" - } - } - }, - { - "type": "microsoft.insights/privateLinkScopes/scopedResources", - "apiVersion": "2019-10-17-preview", - "name": "[concat(parameters('private_link_scope_name'), '/', concat(parameters('workspace_name'), '-connection'))]", - "tags": "[parameters('tre_workspace_tags')]", - "dependsOn": [ - "[resourceId('microsoft.insights/privatelinkscopes', parameters('private_link_scope_name'))]" - ], - "properties": { - "linkedResourceId": "[resourceId('microsoft.operationalinsights/workspaces', parameters('workspace_name'))]" - } - }, - { - "type": "microsoft.insights/privateLinkScopes/scopedResources", - "apiVersion": "2019-10-17-preview", - "name": "[concat(parameters('private_link_scope_name'), '/', concat(parameters('app_insights_name'), '-connection'))]", - "tags": "[parameters('tre_workspace_tags')]", - "dependsOn": [ - "[resourceId('microsoft.insights/privateLinkScopes', parameters('private_link_scope_name'))]" - ], - "properties": { - "linkedResourceId": "[resourceId('microsoft.insights/components', parameters('app_insights_name'))]" - } - } - ], - "outputs": { - "resourceId": { - "type": "String", - "value": "[resourceId('microsoft.insights/privateLinkScopes', parameters('private_link_scope_name'))]" - } - } -} diff --git a/templates/workspaces/base/terraform/azure-monitor/app_insights.json b/templates/workspaces/base/terraform/azure-monitor/app_insights.json deleted file mode 100644 index 7703063270..0000000000 --- a/templates/workspaces/base/terraform/azure-monitor/app_insights.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "app_insights_name": { - "type": "String" - }, - "location": { - "type": "String" - }, - "log_analytics_workspace_id": { - "type": "String" - }, - "application_type": { - "type": "String" - }, - "storage_account_name": { - "type": "String" - }, - "tre_core_tags": { - "type": "Object" - }, - "smartdetectoralertrules_failure_anomalies_name": { - "type": "String" - }, - "smartdetectoralertrules_failure_anomalies_scope": { - "type": "String" - }, - "smartdetectoralertrules_failure_anomalies_group_id": { - "type": "String" - } - }, - "variables": {}, - "resources": [ - { - "type": "microsoft.insights/components", - "apiVersion": "2020-02-02", - "name": "[parameters('app_insights_name')]", - "location": "[parameters('location')]", - "kind": "web", - "tags": "[parameters('tre_core_tags')]", - "properties": { - "Application_Type": "[parameters('application_type')]", - "SamplingPercentage": 100, - "RetentionInDays": 90, - "DisableIpMasking": false, - "WorkspaceResourceId": "[parameters('log_analytics_workspace_id')]", - "IngestionMode": "LogAnalytics", - "publicNetworkAccessForIngestion": "Enabled", - "publicNetworkAccessForQuery": "Enabled", - "DisableLocalAuth": false - } - }, - { - "name": "[concat(parameters('app_insights_name'), '/serviceprofiler')]", - "type": "microsoft.insights/components/linkedStorageAccounts", - "apiVersion": "2020-03-01-preview", - "properties": { - "linkedStorageAccount": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storage_account_name'))]" - }, - "dependsOn": [ - "[resourceId('microsoft.insights/components', parameters('app_insights_name'))]" - ] - }, - { - "type": "microsoft.alertsmanagement/smartdetectoralertrules", - "apiVersion": "2021-04-01", - "name": "[parameters('smartdetectoralertrules_failure_anomalies_name')]", - "location": "global", - "properties": { - "description": "Failure Anomalies notifies you of an unusual rise in the rate of failed HTTP requests or dependency calls.", - "state": "Enabled", - "severity": "Sev3", - "frequency": "PT1M", - "detector": { - "id": "FailureAnomaliesDetector" - }, - "scope": [ - "[parameters('smartdetectoralertrules_failure_anomalies_scope')]" - ], - "actionGroups": { - "groupIds": [ - "[parameters('smartdetectoralertrules_failure_anomalies_group_id')]" - ] - } - } - } - ], - "outputs": { - "connectionString": { - "value": "[reference(resourceId('microsoft.insights/components', parameters('app_insights_name')), '2020-02-02').ConnectionString]", - "type": "String" - }, - "appInsightsId": { - "value": "[resourceId('microsoft.insights/components', parameters('app_insights_name'))]", - "type": "String" - } - } -} From 4af829fffac4037b689775e16fbbb38fd7406213 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:17:39 +0000 Subject: [PATCH 10/10] update core version --- templates/core/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/core/version.txt b/templates/core/version.txt index 6ff6db180c..ac1552129d 100644 --- a/templates/core/version.txt +++ b/templates/core/version.txt @@ -1 +1 @@ -__version__ = "0.4.16" +__version__ = "0.4.17"