From 3f73471917b2c22b75c43a4ded1d4f232c735d15 Mon Sep 17 00:00:00 2001 From: Michal Pipal Date: Wed, 1 Nov 2023 16:29:33 +0100 Subject: [PATCH] Fixed VNET integration definition for Func Apps --- modules/azure/function_app_linux/main.tf | 8 ++++++++ modules/azure/function_app_linux_managed_identity/main.tf | 8 ++++++++ modules/azure/function_app_windows/main.tf | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/modules/azure/function_app_linux/main.tf b/modules/azure/function_app_linux/main.tf index 09497b3d..a4d7a5f4 100644 --- a/modules/azure/function_app_linux/main.tf +++ b/modules/azure/function_app_linux/main.tf @@ -70,6 +70,14 @@ resource "azurerm_linux_function_app" "function_app" { identity { type = "SystemAssigned" } + + /* + * VNet integration is set by a separate resource 'vnet_integration' below, so this must be ignored, see 'NOTE on regional virtual network integration:' here + * https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_function_app + */ + lifecycle { + ignore_changes = [virtual_network_subnet_id] + } } # VNet integration diff --git a/modules/azure/function_app_linux_managed_identity/main.tf b/modules/azure/function_app_linux_managed_identity/main.tf index d767d27e..ef8f7de1 100644 --- a/modules/azure/function_app_linux_managed_identity/main.tf +++ b/modules/azure/function_app_linux_managed_identity/main.tf @@ -94,6 +94,14 @@ resource "azurerm_linux_function_app" "function_app" { identity { type = "SystemAssigned" } + + /* + * VNet integration is set by a separate resource 'vnet_integration' below, so this must be ignored, see 'NOTE on regional virtual network integration:' here + * https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_function_app + */ + lifecycle { + ignore_changes = [virtual_network_subnet_id] + } } diff --git a/modules/azure/function_app_windows/main.tf b/modules/azure/function_app_windows/main.tf index a7f4c485..1dbccea0 100644 --- a/modules/azure/function_app_windows/main.tf +++ b/modules/azure/function_app_windows/main.tf @@ -70,6 +70,14 @@ resource "azurerm_windows_function_app" "function_app" { identity { type = "SystemAssigned" } + + /* + * VNet integration is set by a separate resource below, so this must be ignored, see 'NOTE on regional virtual network integration:' here + * https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_function_app + */ + lifecycle { + ignore_changes = [virtual_network_subnet_id] + } } # Host keys