azure - 如何使用 Terraform 设置我的 azure 函数的平台?

标签 azure terraform azure-functions

我正在尝试将我的 Azure 函数的平台更改为 64 位,以与新的 dll 或项目需求兼容。我只是无法找到相应的 terraform 键来设置此 azure 函数字段。 问题是 terraform 目前默认为 32 位,因此每当我部署字段时都会发生变化。 enter image description here 任何帮助,将不胜感激。谢谢!

我尝试使用 Microsoft documentation 中的一些 app_settings 键进行探索,但它们似乎都与平台版本没有明显的联系。我也尝试过查看这里的键 terraform documentation 我也没有想到这些。

这是我的 terraform 未显示 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
}

最佳答案

管理工作线程配置的资源是 azurerm_function_app 资源。

设置属性use_32_bit_worker_process设置为 true 将在 32 位平台上运行应用程序,这是默认值。

use_32_bit_worker_process 显式设置为 false,并确保使用除免费或共享之外的任何其他层,如文档中所述:

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

关于azure - 如何使用 Terraform 设置我的 azure 函数的平台?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75462785/

相关文章:

azure - 使用 Teraform 部署的 NSG 安全规则 azure 中源、源服务标记和目标字段的等效参数字段是什么

azure - 使用 Terraform 创建 Ansible 库存

azure - 哪些 Azure 服务可以帮助我摆脱 VM?

c# - 将参数作为查询字符串传递给 URL 中的 Azure 函数 (HttpTrigger)

azure - 如何使用 Graph API 查找 azure AD guest 用户邀请是否已兑换

authentication - 使用从另一个 IdP 返回的 SAML 2.0 工件在 MS Azure AD 中进行身份验证

amazon-web-services - 无法使用 Terraform 启动 EC2

node.js - 列出 AWS key ,然后迭代返回每个 key 值

azure - 使用 AzureFileCopy 任务覆盖 Azure Blob 存储中的文件

json - 如何在 Node js 中反序列化代理消息的正文?