Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sticky settings variables #76

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading