We provisioned a solution with terraform in azure one of the steps is provisioning a function app
a seperate pipelines installs the software function in the function app
when i rerun terraform apply (for updating something) the software functions are removed from the azure function app
Using terraform version 1.22 is this expected behavior ?
Extending from the original question. I believe the change today from terraform 1.21 to 1.22 added an extra appsetting to the function app. which seemed to redploy the entire function app instead of just adding the application setting and by this destroying the functionality because the functions are gone.
I'm not sure if this is a bug or the expected behavior but at least it is something we were not expecting.
Since I do not want to deploy something again just because of the change of an appsetting. Is anyone running into this and do you have a work around or is their a workflow that I missed in the terraform documentation.
Extra info Edit 2:
Azure function created like this
resource "azurerm_function_app" "xxx"{
name = "xxx-status2signalr-func"
location = "${var.region}"
resource_group_name = "${azurerm_resource_group.xxx.name}"
app_service_plan_id = "${azurerm_app_service_plan.xxx.id}"
storage_connection_string = "${azurerm_storage_account.xxx.primary_connection_string}"
enable_builtin_logging = "false"
app_settings {
"blabladosmomethingEventhub" = "${var.blabla-something-eventhub}"
"blabladosomethingChangedEventhubConsumer" = "${var.blabla-dosomething-eventhub-consumer}"
"blablasomethingEventhubConnectionkeyListen" = "${var.xxxblabladosomethingchangedlisten}"
"AzureSignalRConnectionString" = "${azurerm_signalr_service.xxx.primary_connection_string}"
"WEBSITE_RUN_FROM_PACKAGE" = "1"
}
enabled="true"
version="~2"
}
Function created nicely The we deployed the software part of the function currently using visual studio right click deploy
Everything working
Now we made the following change to the appsettings key's
resource "azurerm_function_app" "xxx"{
name = "xxx-status2signalr-func"
location = "${var.region}"
resource_group_name = "${azurerm_resource_group.xxx.name}"
app_service_plan_id = "${azurerm_app_service_plan.xxx.id}"
storage_connection_string = "${azurerm_storage_account.xxx.primary_connection_string}"
enable_builtin_logging = "false"
app_settings {
"APPINSIGHTS_INSTRUMENTATIONKEY" = "${azurerm_application_insights.xxx.instrumentation_key}"
"blabladosmomethingEventhub" = "${var.blabla-something-eventhub}"
"blabladosomethingChangedEventhubConsumer" = "${var.blabla-dosomething-eventhub-consumer}"
"blablasomethingEventhubConnectionkeyListen" = "${var.xxxblabladosomethingchangedlisten}"
"AzureSignalRConnectionString" = "${azurerm_signalr_service.xxx.primary_connection_string}"
"WEBSITE_RUN_FROM_PACKAGE" = "1"
}
enabled="true"
version="~2"
}
the output of the plan showed update 1 "APPINSIGHTS_INSTRUMENTATIONKEY" = "${azurerm_application_insights.xxx.instrumentation_key}"
When checking the appsetting key was nicely added but the deployed software was gone.
Any pointers on this are very welcome.