I'm using Terraform and right now I'm in a situation where all my appsettings for my apps is being populated as the infrastructure might change. This way it's all automatic.
However, I've got a problem with my linux consumption plan Functions app that has an appsetting that needs to be set during deployment. WEBSITE_RUN_FROM_PACKAGE is the value that is set to a URL during deployment.
My problem is that terraform will remove this value or set it to whatever I set it to.
How can I get this value to stay as is during terraform deployment?
Either getting the value from azure or ignoring the value in terraform?
I found this but it does not seem to work for the appsettings section.
https://www.terraform.io/docs/configuration/resources.html#ignore_changes
My test:
resource "azurerm_function_app" "shipping-broker-msw-func" {
name = "shipping-broker-msw-func"
...
app_settings = {
...
"WEBSITE_RUN_FROM_PACKAGE" = "URL_Form_CD"
}
lifecycle {
ignore_changes = [
app_settings["WEBSITE_RUN_FROM_PACKAGE"],
]
}
}