-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Function app unexpected update in place #1966
Comments
@arichiardi I am not 100% sure but I think when using You can using resource "azurerm_function_app" "lambda_app" {
name = "${local.full_prefix}-app"
location = "${var.location}"
resource_group_name = "${var.resource_group_name}"
app_service_plan_id = "${var.service_plan_id}"
storage_connection_string = "${var.storage_connection_string}"
https_only = "true"
version = "beta"
# https://stackoverflow.com/questions/49842499/deploy-azure-function-using-terraform
app_settings = "${merge(
var.lambda_variables,
map(
"FUNCTIONS_EXTENSION_VERSION", "beta",
"WEBSITE_NODE_DEFAULT_VERSION", "10.6.0",
"HASH", "${base64sha256(file(var.artifact_path))}",
"WEBSITE_RUN_FROM_ZIP", "${azurerm_storage_blob.artifact_blob.url}${var.storage_sas}",
"AZURE_STORAGE_CONNECTION_STRING", "${var.storage_connection_string}"
)
)}"
tags = "${local.tags}"
lifecycle {
ignore_changes = [
"app_settings.KEYNAME",
]
}
} You may have to play with it a bit, to get the correct property. looks like they updated the variable name to Updated, missed |
Thanks a lot for the answer, not at the keyboard but I will definitely work around that by adding the |
@arichiardi lifecycle {
ignore_changes = [
"app_settings.%",
"app_settings.MSDEPLOY_RENAME_LOCKED_FILES",
"site_config.0.scm_type",
]
} For more details on lifecycle |
I did the above, it works, but I needed to add:
|
Hi, I tried in my case to use ignore settings in differents ways, but never works :( way 1 ->
way 2 ->
way 3 ->
etc... everytime, I've TF who want update this settings. Thanks |
This trick behavior has been changed in Terraform 0.12 and is documented here You have to create a fake value to avoid any creation/destroy change.
|
For those having problems with this you need to add a placeholder too. Check this thread. This is what worked for me: resource "azurerm_function_app" "maibeer" {
name = local.env.func_app_name
location = local.env.location
resource_group_name = local.env.resource_group_name
app_service_plan_id = azurerm_app_service_plan.default.id
storage_account_name = azurerm_storage_account.default.name
storage_account_access_key = azurerm_storage_account.default.primary_access_key
os_type = "linux"
version = "~3"
app_settings = {
"FUNCTIONS_WORKER_RUNTIME" = "python"
"MAIBEER_COSMOSDB_CONNECTION_STRING" = azurerm_cosmosdb_account.default.connection_strings[0]
"MAIBEER_KEYVAULT_URI" = azurerm_key_vault.default.vault_uri
"APPINSIGHTS_INSTRUMENTATIONKEY" = azurerm_application_insights.maibeer.instrumentation_key
"WEBSITE_RUN_FROM_PACKAGE" = "ThisWillBeSetToAnURLByAzureDevOpsDeploy", // managed by Azure DevOps (must be not null)
"WEBSITE_ENABLE_SYNC_UPDATE_SITE" = "true" // managed by Azure DevOps (must be not null)
}
site_config {
# only for free plan
use_32_bit_worker_process = local.env.func_use_32_bit_worker_process
}
identity {
type = "SystemAssigned"
}
lifecycle {
ignore_changes = [
app_settings["WEBSITE_RUN_FROM_PACKAGE"],
app_settings["WEBSITE_ENABLE_SYNC_UPDATE_SITE"]
]
}
tags = local.tags
} |
It looks like this functionality will be added to 0.14: hashicorp/terraform#26421 |
Since this issue seems to have been addressed in the latest versions of the provider (or a valid workaround was provided) - I'm going to close it. Please open a new updated bug report if this is still relevant. Thank you. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Hello folks!
I am always receiving the following when
make
-planning my function app:sometimes it's this:
I would not know what that can mean but it always modifies something.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
It should not touch any resource.
Actual Behavior
It always reports an
update in-place
.Steps to Reproduce
terraform plan
The text was updated successfully, but these errors were encountered: