Terraform --> Azure 应用服务计划:区域不支持请求的功能
Terraform --> Azure App Service Plan: Requested features are not supported in region
我正在尝试使用 Terraform 部署具有高级消费计划的 Azure Functions 应用程序。在其他资源中,有根据 terraform 文档需要的应用程序服务计划。
尝试创建 svc 计划时,遇到以下错误。
Error: Error creating/updating App Service Plan "task-scheduler-svc-plan" (Resource Group "tasks"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Requested features are not supported in region." Details=[{"Message":"Requested features are not supported in region."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"59911","Message":"Requested features are not supported in region.","MessageTemplate":"Requested features are not supported in region.","Parameters":[]}}]
我的所有资源都有 westeurope
区域。不幸的是,该错误没有给出任何导致此问题的功能的指示..
请在下面找到我的 tf 模板。有人发现错误了吗?
provider "azurerm" {
version = "=1.33.1"
}
resource "azurerm_resource_group" "tasks" {
name = "tasks"
location = "${var.location}"
tags = "${var.tags}"
}
# AZURE FUNCTIONS
resource "azurerm_app_service_plan" "tasks" {
name = "${var.app-svc-plan-name}-svc-plan"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
kind = "elastic"
is_xenon = true
per_site_scaling = false
maximum_elastic_worker_count = 5
sku {
tier = "ElasticPremium"
size = "EP1"
capacity = 1
}
}
resource "azurerm_app_service" "tasks" {
name = "az-func-svc"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
app_service_plan_id = "${azurerm_app_service_plan.tasks.id}"
https_only = true
site_config {
# allow inbound connections only FROM
ip_restriction {
ip_address = "${data.azurerm_key_vault_secret.external-ip-range.value}"
}
use_32_bit_worker_process = false
# for access INTO vnet
# requires a delegated subnet
virtual_network_name = "${data.azurerm_virtual_network.vnet.name}"
}
}
resource "azurerm_storage_account" "az-func-tasks" {
name = "azfunctasks"
resource_group_name = "${azurerm_resource_group.tasks.name}"
location = "${var.location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_application_insights" "az-func" {
name = "az-func-ai"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
application_type = "Web"
}
resource "azurerm_function_app" "az-func-app" {
name = "az-func-app"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
app_service_plan_id = "${azurerm_app_service_plan.tasks.id}"
storage_connection_string = "${azurerm_storage_account.az-func-tasks.primary_connection_string}"
version = "~2"
app_settings = {
APPINSIGHTS_INSTRUMENTATIONKEY = "${azurerm_application_insights.az-func.instrumentation_key}"
FUNCTIONS_WORKER_RUNTIME = "powershell"
}
identity {
type = "SystemAssigned"
}
}
我假设您使用的变量 app-svc-plan-name
的值为 task-scheduler
。所以我猜 azurerm_app_service_plan
是你出错的原因。也许改变一些参数?在 terraform 示例中,他们使用 is_xenon PremiumContainer 层。也许这就是问题所在,因为您使用 ElasticPremium。
Terraform : azurerm_app_service_plan.
我正在尝试使用 Terraform 部署具有高级消费计划的 Azure Functions 应用程序。在其他资源中,有根据 terraform 文档需要的应用程序服务计划。
尝试创建 svc 计划时,遇到以下错误。
Error: Error creating/updating App Service Plan "task-scheduler-svc-plan" (Resource Group "tasks"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Requested features are not supported in region." Details=[{"Message":"Requested features are not supported in region."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"59911","Message":"Requested features are not supported in region.","MessageTemplate":"Requested features are not supported in region.","Parameters":[]}}]
我的所有资源都有 westeurope
区域。不幸的是,该错误没有给出任何导致此问题的功能的指示..
请在下面找到我的 tf 模板。有人发现错误了吗?
provider "azurerm" {
version = "=1.33.1"
}
resource "azurerm_resource_group" "tasks" {
name = "tasks"
location = "${var.location}"
tags = "${var.tags}"
}
# AZURE FUNCTIONS
resource "azurerm_app_service_plan" "tasks" {
name = "${var.app-svc-plan-name}-svc-plan"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
kind = "elastic"
is_xenon = true
per_site_scaling = false
maximum_elastic_worker_count = 5
sku {
tier = "ElasticPremium"
size = "EP1"
capacity = 1
}
}
resource "azurerm_app_service" "tasks" {
name = "az-func-svc"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
app_service_plan_id = "${azurerm_app_service_plan.tasks.id}"
https_only = true
site_config {
# allow inbound connections only FROM
ip_restriction {
ip_address = "${data.azurerm_key_vault_secret.external-ip-range.value}"
}
use_32_bit_worker_process = false
# for access INTO vnet
# requires a delegated subnet
virtual_network_name = "${data.azurerm_virtual_network.vnet.name}"
}
}
resource "azurerm_storage_account" "az-func-tasks" {
name = "azfunctasks"
resource_group_name = "${azurerm_resource_group.tasks.name}"
location = "${var.location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_application_insights" "az-func" {
name = "az-func-ai"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
application_type = "Web"
}
resource "azurerm_function_app" "az-func-app" {
name = "az-func-app"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tasks.name}"
app_service_plan_id = "${azurerm_app_service_plan.tasks.id}"
storage_connection_string = "${azurerm_storage_account.az-func-tasks.primary_connection_string}"
version = "~2"
app_settings = {
APPINSIGHTS_INSTRUMENTATIONKEY = "${azurerm_application_insights.az-func.instrumentation_key}"
FUNCTIONS_WORKER_RUNTIME = "powershell"
}
identity {
type = "SystemAssigned"
}
}
我假设您使用的变量 app-svc-plan-name
的值为 task-scheduler
。所以我猜 azurerm_app_service_plan
是你出错的原因。也许改变一些参数?在 terraform 示例中,他们使用 is_xenon PremiumContainer 层。也许这就是问题所在,因为您使用 ElasticPremium。
Terraform : azurerm_app_service_plan.