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.
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
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
tofalse
and be sure to use any other tiers than Free or Shared, as stated in the docs: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
orazurerm_linux_function_app
javierlga is correct,
set use_32_bit_worker_process to false inside site_config block.
More info:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/function_app#use_32_bit_worker_process