diff --git a/modules/webapps/appservice/main.tf b/modules/webapps/appservice/main.tf index cdd9aaa111..682442ae8c 100644 --- a/modules/webapps/appservice/main.tf +++ b/modules/webapps/appservice/main.tf @@ -27,12 +27,14 @@ locals { arm_filename = "${path.module}/arm_site_config.json" - app_settings = merge(try(var.app_settings, {}), try(local.dynamic_settings_to_process, {}), var.application_insight == null ? {} : - { + app_settings = merge( + var.application_insight == null ? {} : { "APPINSIGHTS_INSTRUMENTATIONKEY" = var.application_insight.instrumentation_key, "APPLICATIONINSIGHTS_CONNECTION_STRING" = var.application_insight.connection_string, "ApplicationInsightsAgent_EXTENSION_VERSION" = "~2" - } + }, + try(var.app_settings, {}), + try(local.dynamic_settings_to_process, {}) ) backup_storage_account = can(var.settings.backup) ? var.storage_accounts[try(var.settings.backup.lz_key, var.client_config.landingzone_key)][var.settings.backup.storage_account_key] : null diff --git a/modules/webapps/function_app/main.tf b/modules/webapps/function_app/main.tf index 1cc33b7edc..a401486a5e 100644 --- a/modules/webapps/function_app/main.tf +++ b/modules/webapps/function_app/main.tf @@ -27,12 +27,14 @@ locals { arm_filename = "${path.module}/arm_site_config.json" - app_settings = merge(try(var.app_settings, {}), try(local.dynamic_settings_to_process, {}), var.application_insight == null ? {} : - { + app_settings = merge( + var.application_insight == null ? {} : { "APPINSIGHTS_INSTRUMENTATIONKEY" = var.application_insight.instrumentation_key, "APPLICATIONINSIGHTS_CONNECTION_STRING" = var.application_insight.connection_string, "ApplicationInsightsAgent_EXTENSION_VERSION" = "~2" - } + }, + try(var.app_settings, {}), + try(local.dynamic_settings_to_process, {}) ) -} \ No newline at end of file +}