-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_app_service_plan replaces Linux App-Plans on every apply #4396
Comments
Have you tried setting the kind to: FunctionApp It looks like that is the cause of the replacement and is a valid kind. |
Hm, with FunctionApp it seems to work, but what I found out was also that if I change the Plan to Basic B1 for example the Linux kind works perfectly fine.
|
I believe that kind "FunctionApp" on the plan will accept both Windows & Linux and that is then specified by the Function App itself. I could be wrong on this however as I haven't dived in to the code to check. I also think SKU in Terraform validations just checks that it is a valid SKU for the resource type rather than the type and kind. There is a couple of instances where we have had issues around SKU being incorrect and defaulting. |
Similar issue: #4116, but about function. |
#6931 also seems to be related |
tried this morning with release 2.21.0 and could make it work with kind = "FunctionApp" and reserved = true (and no need to ignore lifecycle changes. These settings actually produce a Linux capable App Service Plan. So for me 2.21.0 fixed this issue, along with #7960 . |
Hi All, I have fired another PR to change the doc of FunctionApp could use windows or linux platform, which is controlled by |
I still have this problem
resource "azurerm_app_service_plan" "My-p-appServicePlan-01" {
name = "My-p-appServicePlan-01"
location = azurerm_resource_group.functionApp.location
resource_group_name = azurerm_resource_group.functionApp.name
kind = "FunctionApp"
reserved = true
sku {
tier = "PremiumV2"
size = "P1v2"
}
} Each time Terraform runs it tries to change # azurerm_app_service_plan.My-p-appServicePlan-01 must be replaced
-/+ resource "azurerm_app_service_plan" "My-p-appServicePlan-01" {
~ id = "/subscriptions/4****************/resourceGroups/My-p-functionApp-rg/providers/Microsoft.Web/serverfarms/My-p-appServicePlan-01" -> (known after apply)
- is_xenon = false -> null
~ kind = "linux" -> "FunctionApp" # forces replacement
location = "westeurope"
~ maximum_elastic_worker_count = 1 -> (known after apply)
~ maximum_number_of_workers = 30 -> (known after apply)
name = "My-p-appServicePlan-01"
- per_site_scaling = false -> null
reserved = true
resource_group_name = "My-p-functionApp-rg"
- tags = {} -> null
~ sku {
~ capacity = 1 -> (known after apply)
size = "P1v2"
tier = "PremiumV2"
}
} only solution is to set: lifecycle {
ignore_changes = [
kind,
]
}``` |
To all who stumbles on this issue, azurerm_app_service_plan is deprecated now in favour of azurerm_service_plan. I don't have this issue anymore. terraform {
required_version = "1.5"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.60.0"
}
}
}
resource "azurerm_service_plan" "sp" {
name = module.naming.app_service_plan.name
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
os_type = "Linux"
sku_name = "S1"
worker_count = 1
zone_balancing_enabled = false
per_site_scaling_enabled = false
} |
Hey all i am going to close this because as @vikas027 has mentioned the If this is still an issue with |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Hi there,
I tried to terraform a Linux FunctionApp using the AzureRM Provider v1.34.0 and terraform 0.12.8.
Here the configuration
With this I created the App-Serviceplan and following my App and even though the App is working if I reapply terraform, I got changes for the App-Serviceplan which requires a replacement.
And the App itself will be replaced too and here the kind is set to
functionapp,linux
This is a really annoying behavior. Do I miss something or is this a bug?
The text was updated successfully, but these errors were encountered: