Terraform - configuring function app to use existing ASE



It is something hard to get the settings rights for terraform, if you don't run it multiple times.
In this example, i had so much errors and i found out that, if you referencing an existing ASE plan, you better make sure it matches - in terms of TIER and SIZE. Otherwise your service plan is as good as no service plan





\resource "azurerm_app_service_plan" "ase-service-plan" {
name = "${var.environment}${var.service_plan_name}"
resource_group_name = "${azurerm_resource_group.azure-rg.name}"
location = "${var.location}"
kind = "FunctionApp"
app_service_environment_id = "/subscriptions/
your-subscription-id/
resourceGroups/yourResourceGroup/providers/Microsoft.Web/
hostingEnvironments/your-ASE-name"
maximum_elastic_worker_count = 1
## required - Isolated ASEV2 ## Best to match this
sku {
tier = "Isolated"
size = "I1"
capacity = 1
}
}


Comments

Catherine Lowe said…
I’ve had similar errors with ASE and only solved them by trial and error. Your point about multiple runs feels very real. Do you think modules make managing complex ASE setups in Terraform easier, or do you prefer keeping the configs flat for clarity?

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type