Skip to content

Commit

Permalink
Added diagnostic settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindelmont committed Dec 16, 2024
1 parent 4a869b3 commit 6f4b1b1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions function_app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ module "windows_function_apps" {
service_plan_id = can(each.value.service_plan_id) || can(each.value.app_service_plan_key) == false ? try(each.value.app_service_plan_id, null) : local.combined_objects_app_service_plans[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.app_service_plan_key].id
settings = each.value.settings
application_insight = try(each.value.application_insight_key, null) == null ? null : module.azurerm_application_insights[each.value.application_insight_key]
diagnostic_profiles = try(each.value.diagnostic_profiles, null)
diagnostics = local.combined_diagnostics
identity = try(each.value.identity, null)
connection_strings = try(each.value.connection_strings, {})
storage_account_name = try(data.azurerm_storage_account.windows_function_apps[each.key].name, null)
Expand Down
9 changes: 9 additions & 0 deletions modules/webapps/windows_function_app/diagnostic.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module "diagnostics" {
source = "../../diagnostics"
count = var.diagnostic_profiles == null ? 0 : 1

resource_id = azurerm_windows_function_app.windows_function_app.id
resource_location = local.location
diagnostics = var.diagnostics
profiles = var.diagnostic_profiles
}
8 changes: 8 additions & 0 deletions modules/webapps/windows_function_app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,11 @@ variable "storage_account_access_key" {
variable "dynamic_app_settings" {
default = {}
}

variable "diagnostic_profiles" {
default = {}
}

variable "diagnostics" {
default = null
}

0 comments on commit 6f4b1b1

Please sign in to comment.