Skip to content

Commit

Permalink
chore(Terraform): remove slot setting config
Browse files Browse the repository at this point in the history
No longer necessary since we aren't using slots.
  • Loading branch information
afeld committed Oct 26, 2022
1 parent ae70819 commit e44e05c
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions terraform/app_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,41 +45,6 @@ resource "azurerm_linux_web_app" "main" {
}
}

# Confusingly named argument; these are settings / environment variables that should be unique to each slot. Also known as "deployment slot settings".
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app#app_setting_names
# https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#which-settings-are-swapped
sticky_settings {
# sort them so that they don't change when we rearrange them
app_setting_names = sort([
# custom config
"ANALYTICS_KEY",
"DJANGO_ALLOWED_HOSTS",
"DJANGO_LOAD_SAMPLE_DATA",
"DJANGO_LOG_LEVEL",
"DJANGO_MIGRATIONS_DIR",
"DJANGO_RECAPTCHA_SECRET_KEY",
"DJANGO_RECAPTCHA_SITE_KEY",
"DJANGO_TRUSTED_ORIGINS",

# populated through auto-instrumentation
# https://docs.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps#enable-application-insights
"APPINSIGHTS_INSTRUMENTATIONKEY",
"APPINSIGHTS_PROFILERFEATURE_VERSION",
"APPINSIGHTS_SNAPSHOTFEATURE_VERSION",
"APPLICATIONINSIGHTS_CONFIGURATION_CONTENT",
"APPLICATIONINSIGHTS_CONNECTION_STRING",
"ApplicationInsightsAgent_EXTENSION_VERSION",
"DiagnosticServices_EXTENSION_VERSION",
"InstrumentationEngine_EXTENSION_VERSION",
"SnapshotDebugger_EXTENSION_VERSION",
"XDT_MicrosoftApplicationInsights_BaseExtensions",
"XDT_MicrosoftApplicationInsights_Mode",
"XDT_MicrosoftApplicationInsights_NodeJS",
"XDT_MicrosoftApplicationInsights_PreemptSdk",
"XDT_MicrosoftApplicationInsightsJava",
])
}

storage_account {
access_key = azurerm_storage_account.main.primary_access_key
account_name = azurerm_storage_account.main.name
Expand All @@ -91,7 +56,7 @@ resource "azurerm_linux_web_app" "main" {

lifecycle {
prevent_destroy = true
ignore_changes = [app_settings, tags]
ignore_changes = [app_settings, sticky_settings, tags]
}
}

Expand Down

0 comments on commit e44e05c

Please sign in to comment.