在 Azure 门户中,我可以设置 Java 版本,如下所示: portal image
在 terraform 配置文件中,我只能使用以下方法设置 Azure Functions 版本:
resource "azurerm_function_app" "function-app" {
name = "test"
location = azurerm_resource_group.resource-group.location
resource_group_name = azurerm_resource_group.resource-group.name
app_service_plan_id = azurerm_app_service_plan.service-plan.id
storage_account_name = azurerm_storage_account.storage-account.name
storage_account_access_key = azurerm_storage_account.storage-account.primary_access_key
app_settings = {
FUNCTION_APP_EDIT_MODE = "readOnly"
WEBSITE_RUN_FROM_PACKAGE = 1
FUNCTIONS_EXTENSION_VERSION = 2
FUNCTIONS_WORKER_RUNTIME = "java"
SCM_DO_BUILD_DURING_DEPLOYMENT = false
}
}
部署上述配置时,只有运行时设置为 java,但由于未设置版本,我的部署无法正常工作。
门户中的结果如下所示: java stack settings
最佳答案
我不知道Nancy Xiong的回答是怎么被接受的,因为它没有回答这个问题,这个问题具体是关于在terraform中为azure function apps设置java版本。 这是正确的做法:
site_config {
linux_fx_version = "JAVA|11"
}
关于java - 使用 Terraform 创建 Azure Function App 时如何设置 java 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63395251/