I’m trying to deploy an Azure standard Logic app with Private endpoints using Terraform. It creates the resources and successfully completed without an errors but it is displaying below error when trying to access the logic app from the portal and also workflow creation is also failing.
Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type ‘Microsoft.Azure.WebJobs.Host.Listeners.IListenerDecorator’ from assembly ‘Microsoft.Azure.WebJobs.Host, Version=3.0.38.0, Culture=neutral, PublicKeyToken=’.
How can I fix the issue?
Terraform code:
locals {
app_service_name = "mmgetdatabyemailla"
sku_sizes = {
small = "WS1"
medium = "WS2"
premium = "WS3"
}
}
resource "azurerm_resource_group" "resource_group_name" {
name = var.resource_group_name
location = var.location
}
data "azurerm_subnet" "integration_subnet_name" {
name = var.integration_subnet_name
resource_group_name = var.vnet_resource_group_name
virtual_network_name = var.virtual_network_name
}
data "azurerm_subnet" "private_endpoint_subnet_name" {
name = var.private_endpoint_subnet_name
resource_group_name = var.vnet_resource_group_name
virtual_network_name = var.virtual_network_name
}
data "azurerm_storage_account" "storage_account" {
name = var.storage_account_name
resource_group_name = var.storage_account_rg
}
resource "azurerm_app_service_plan" "service_plan" {
name = var.app_service_plan_name
location = var.location
resource_group_name = azurerm_resource_group.resource_group_name.name
kind = "elastic"
sku {
tier = "WorkflowStandard"
size = local.sku_sizes[var.size]
}
}
resource "azurerm_storage_share" "logicApp" {
name = "${local.app_service_name}-content"
storage_account_name = var.storage_account_name
quota = 5000
depends_on = [
data.azurerm_storage_account.storage_account
]
}
resource "azurerm_logic_app_standard" "logic_app" {
name = var.logic_app_name
location = var.location
version = var.logic_app_version
resource_group_name = var.resource_group_name
app_service_plan_id = azurerm_app_service_plan.service_plan.id
storage_account_name = data.azurerm_storage_account.storage_account.name
storage_account_access_key = data.azurerm_storage_account.storage_account.primary_access_key
https_only = true
app_settings = {
"WEBSITE_CONTENTOVERVNET" = "1"
"WEBSITE_VNET_ROUTE_ALL" = "1"
"FUNCTIONS_WORKER_RUNTIME" = "node"
"WEBSITE_NODE_DEFAULT_VERSION" = "~14"
}
site_config {
use_32_bit_worker_process = true
ftps_state = "Disabled"
websockets_enabled = false
min_tls_version = "1.2"
runtime_scale_monitoring_enabled = false
vnet_route_all_enabled = true
}
identity {
type = "SystemAssigned"
}
depends_on = [
azurerm_storage_share.logicApp
]
lifecycle {
ignore_changes = [
identity,
app_settings,
virtual_network_subnet_id,
]
}
}
resource "azurerm_app_service_virtual_network_swift_connection" "network_swift_connection" {
app_service_id = azurerm_logic_app_standard.logic_app.id
subnet_id = data.azurerm_subnet.integration_subnet_name.id
}
resource "azurerm_private_endpoint" "endpoint" {
name = "${local.app_service_name}pe"
location = var.location
resource_group_name = var.resource_group_name
subnet_id = data.azurerm_subnet.private_endpoint_subnet_name.id
tags = {}
private_service_connection {
name = "${local.app_service_name}psc"
is_manual_connection = false
private_connection_resource_id = azurerm_logic_app_standard.logic_app.id
subresource_names = ["sites"]
}
lifecycle {
ignore_changes = [
network_interface,
subnet_id,
]
}
}
2
Answers
Use below modified terraform code for deploying a standard Logic app with Private endpoints.
Deployment succeeded:
I got it resolved after updating the LogicApp (Standard) Configuration setting "AzureFunctionsJobHost__extensionBundle__version"
from default versions range
to specific version
For future deployments to prevent overwriting the changes in app, Extension bundles file shall be updated in the project/template code base.
Some more details about upgrading the LogicApp to use Functions version 4 shall be referred here Azure Logic Apps Standard now supports Azure Functions v4