diff --git a/main.tf b/main.tf index 524af98..4d3bedb 100644 --- a/main.tf +++ b/main.tf @@ -38,6 +38,11 @@ resource "azurerm_linux_function_app" "this" { virtual_network_subnet_id = var.virtual_network_subnet_id + sticky_settings { + app_setting_names = var.sticky_settings_connection_string_names + connection_string_names = var.sticky_settings_connection_string_names + } + site_config { # Ref: https://learn.microsoft.com/en-us/azure/azure-monitor/app/migrate-from-instrumentation-keys-to-connection-strings application_insights_key = null @@ -165,6 +170,11 @@ resource "azurerm_windows_function_app" "this" { virtual_network_subnet_id = var.virtual_network_subnet_id + sticky_settings { + app_setting_names = var.sticky_settings_connection_string_names + connection_string_names = var.sticky_settings_connection_string_names + } + site_config { # Ref: https://learn.microsoft.com/en-us/azure/azure-monitor/app/migrate-from-instrumentation-keys-to-connection-strings application_insights_key = null diff --git a/variables.tf b/variables.tf index d986928..05d8db2 100644 --- a/variables.tf +++ b/variables.tf @@ -45,6 +45,18 @@ variable "app_settings" { } } +variable "sticky_settings_app_setting_names" { + description = "A list of names of app settings that this Function App will not swap between slots when a swap operation is triggered." + type = list(string) + default = [""] +} + +variable "sticky_settings_connection_string_names" { + description = "A list of names of connection strings that this Function App will not swap between slots when a swap operation is triggered." + type = list(string) + default = [""] +} + variable "functions_extension_version" { description = "Which extension version to use for this Function App." type = string