skip to Main Content

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


  1. Use below modified terraform code for deploying a standard Logic app with Private endpoints.

    provider "azurerm" {
      features{}
    }
    data "azurerm_resource_group" "example"{
    name = "caroline"
    }
    resource "azurerm_virtual_network" "example" {
      name                = "jahnetwork"
      location            = data.azurerm_resource_group.example.location
      resource_group_name = data.azurerm_resource_group.example.name
      address_space       = ["10.0.0.0/16"]
      dns_servers         = ["10.0.0.4", "10.0.0.5"]
    
      subnet {
        name           = "subnet1"
        address_prefix = "10.0.1.0/24"
      }
      }
      
    resource "azurerm_subnet" "example" {
      name                 = "servicejah"
      resource_group_name  = data.azurerm_resource_group.example.name
      virtual_network_name = azurerm_virtual_network.example.name
      address_prefixes     = ["10.0.2.0/24"]
      delegation {
        name = "delegation"
    
        service_delegation {
          name    = "Microsoft.Web/serverFarms"
          actions = ["Microsoft.Network/virtualNetworks/subnets/join/action", "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"]
        }
      }
    }
    resource "azurerm_subnet" "service" {
      name                 = "servicejah"
      resource_group_name  = data.azurerm_resource_group.example.name
      virtual_network_name = azurerm_virtual_network.example.name
      address_prefixes     = ["10.0.2.0/24"]
    
      enforce_private_link_service_network_policies = true
    }
    
    data "azurerm_storage_account" "example" {
      name                     = "strplatlasta"
      resource_group_name      = data.azurerm_resource_group.example.name
    }
    
    resource "azurerm_storage_share" "example" {
      name                 = "newstshj"
      storage_account_name = data.azurerm_storage_account.example.name
      quota                = 50
      depends_on = [
        data.azurerm_storage_account.example
      ]
    }
    
    resource "azurerm_private_dns_zone" "example" {
      name                = "mydomain.com"
      resource_group_name = data.azurerm_resource_group.example.name
    }
    
    resource "azurerm_private_dns_zone_virtual_network_link" "example" {
      name                  = "testjah"
      resource_group_name   = data.azurerm_resource_group.example.name
      private_dns_zone_name = azurerm_private_dns_zone.example.name
      virtual_network_id    = azurerm_virtual_network.example.id
    }
    
    resource "azurerm_private_endpoint" "endpoint" {
      name                = "jahpe"
      location            = data.azurerm_resource_group.example.location
      resource_group_name = data.azurerm_resource_group.example.name
      subnet_id           = azurerm_subnet.service.id
      tags                = {}
      private_service_connection {
        name                           = "newjpsc"
        is_manual_connection           = false
        private_connection_resource_id = azurerm_logic_app_standard.logic_app.id
        subresource_names              = ["sites"]
      }
    }
    
    resource "azurerm_app_service_plan" "example" {
      name                = "azurelogicervice-plan"
      location            = data.azurerm_resource_group.example.location
      resource_group_name = data.azurerm_resource_group.example.name
      kind                = "elastic"
    
    
      sku {
        tier = "WorkflowStandard"
        size = "WS1"
      }
    }
    
    resource "azurerm_logic_app_standard" "logic_app" {
      name                       = "mylatestjap"
      location                   = data.azurerm_resource_group.example.location
      resource_group_name        = data.azurerm_resource_group.example.name
      app_service_plan_id        = azurerm_app_service_plan.example.id
      storage_account_name       = data.azurerm_storage_account.example.name
      storage_account_access_key = data.azurerm_storage_account.example.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.example
      ]
    }
    

    Deployment succeeded:

    enter image description here

    enter image description here

    enter image description here

    Login or Signup to reply.
  2. I got it resolved after updating the LogicApp (Standard) Configuration setting "AzureFunctionsJobHost__extensionBundle__version"

    from default versions range

    [1.*, 2.0.0)
    

    to specific version

    [1.31.12] 
    

    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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search