-
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
azure function os_type linux doesn't work #6931
Comments
Alright so I managed to create a functionapp,linux by: but now I have a problem that every time I run apply it's trying to recreate the service plan just as mentioned in #5971 Terraform will perform the following actions:
# module.factoryone_graphql_function.azurerm_app_service_plan.asp-factoryone must be replaced
-/+ resource "azurerm_app_service_plan" "xxxxxx" {
~ id = "/subscriptions/xxxxx/resourceGroups/xxxxxx-staging/providers/Microsoft.Web/serverfarms/xxxxxxxx" -> (known after apply)
- is_xenon = false -> null
~ kind = "functionapp" -> "Linux" # forces replacement
location = "westeurope"
reserved = true
....
~ sku {
~ capacity = 0 -> (known after apply)
size = "Y1"
tier = "Dynamic"
}
timeouts {}
}
# module.xxxxxx.azurerm_function_app.xxxxxxx will be updated in-place
~ resource "azurerm_function_app" "xxxxx" {
~ app_service_plan_id = "/subscriptions/xxxxxxx/resourceGroups/factory-one-staging/providers/Microsoft.Web/serverfarms/xxxxxx" -> (known after apply)
app_settings = {
"APPINSIGHTS_INSTRUMENTATIONKEY" = ""
"FUNCTIONS_WORKER_RUNTIME" = "node"
"WEBSITE_NODE_DEFAULT_VERSION" = "10.4.1"
"WEBSITE_RUN_FROM_PACKAGE" = ""
}
kind = "functionapp,linux"
location = "westeurope"
os_type = "linux"
version = "~2"
....
}
}
Plan: 1 to add, 1 to change, 1 to destroy. |
Another finding. If I change This is however just a workaround and I believe should be fixed and documented. |
There is a typo in the code where osType is "Linux" instead of "linux". The format does not match with checks and other parts of the code such as in row 354. Current behaviour causes the function app to be generated as Windows despite the value of os_type. This fixes #6931 for example.
I submitted a pull request which I thought would fix this. However, the real problem still persists. The issue is that there are checks to verify that Perhaps there should be alternative option to specify something like Here is the full working configuration:
I am making another pull request with a working example for the documentation at least. |
I added documentation about specific arguments to use when deploying a linux function app. There is currently also checks missing that the azurerm_app_service_plan should also have `reserved=true` specifically when linked to linux function apps. Note added here, but the check should also be added. See hashicorp#6931 for more details.
I added documentation about specific arguments to use when deploying a linux function app. There is currently also checks missing that the azurerm_app_service_plan should also have `reserved=true` specifically when linked to linux function apps. Note added here, but the check should also be added. See #6931 for more details.
This has been released in version 2.13.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.13.0"
}
# ... other configuration ... |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.25
Affected Resource(s)
azurerm_function_app
Terraform Configuration Files
Debug Output
https://gist.github.com/Duchynko/13f2c854e3ce374e340628cecaaa6285
Panic Output
Expected Behavior
(1.) Function App should be created as functionapp,linux
2. Function App shouldn't be recreated on every
apply
runActual Behavior
Function App is being created as Windows app and therefore is forced to be recreated every time I run
terraform apply
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: