skip to Main Content

I am trying to change my Azure function’s Platform to 64 bit to be compatible with a new dll or project needs. I just have not been able to find the corresponding terraform key to set this azure function field.
The problem is that terraform is currently defaulting to 32 bit, so whenever I deploy the field changes.enter image description here
Any help would be appreciated. Thank you!

I’ve tried poking around with some app_settings keys from Microsoft documentation, but none of them seem obviously connected to the platform version. I have also tried looking at the keys here terraform documentation and none of those jump out to me either.

Here is my terraform not showing app_settings

resource "azurerm_app_service_plan" "plan" {
  count               = length(var.resource_groups)
  name                = "${var.name}-asp${count.index + 1}"
  location            = var.resource_groups[count.index].location
  resource_group_name = var.resource_groups[count.index].name
  kind                = "FunctionApp"

  sku {
    tier = var.app_service_plan_tier
    size = var.app_service_plan_size
  }

  tags = var.tags
}

resource "azurerm_function_app" "function" {
  count                     = length(azurerm_app_service_plan.plan.*)
  name                      = "${var.name}${count.index + 1}"
  location                  = azurerm_app_service_plan.plan[count.index].location
  resource_group_name       = azurerm_app_service_plan.plan[count.index].resource_group_name
  app_service_plan_id       = azurerm_app_service_plan.plan[count.index].id
  storage_account_name      = var.storage_account_name
  storage_account_access_key = var.storage_account_access_key
  app_settings              = local.app_settings
  version                   = "~2"
  https_only                = true
  tags                      = var.tags
}

3

Answers


  1. The resource that manages the configuration of the worker is the azurerm_function_app resource.

    Setting the attribute use_32_bit_worker_process to true will run the applications in a 32-bit platform, which it’s the default value.

    Explicitly set use_32_bit_worker_process to false and be sure to use any other tiers than Free or Shared, as stated in the docs:

    when using an App Service Plan in the Free or Shared Tiers use_32_bit_worker_process must be set to true.

    Login or Signup to reply.
  2. You are able to set the bitness of your worker in the azurerm_windows_function_app resource.

    Set use_32_bit_worker to false.

    Note: azurerm_function_app is deprecated and has been superseeded by windows_function_app or azurerm_linux_function_app

    Login or Signup to reply.
  3. javierlga is correct,

    set use_32_bit_worker_process to false inside site_config block.

    site_config = {
      use_32_bit_worker_process  = false
    }
    

    More info:

    https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/function_app#use_32_bit_worker_process

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