-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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_windows_function_app dotnet version not set correctly #16417
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Likewise, I have the same issue. PS C:\Users\ryan.stanley\Downloads\Function> terraform version
Terraform v1.1.9
on windows_amd64
+ provider registry.terraform.io/aztfmod/azurecaf v2.0.0-preview-2
+ provider registry.terraform.io/hashicorp/azurerm v3.3.0
+ provider registry.terraform.io/hashicorp/local v2.2.2 Upon further investigation, I have found in the azure resource browser: The configuration "netFrameworkVersion": "v4.0",
"phpVersion": "",
"pythonVersion": "",
"nodeVersion": "",
"powerShellVersion": "",
"linuxFxVersion": "",
"windowsFxVersion": "DotNet|6",
Upon creating the resource manually via the azure ui/portal: "netFrameworkVersion": "v6.0",
"phpVersion": "",
"pythonVersion": "",
"nodeVersion": "",
"powerShellVersion": "",
"linuxFxVersion": "",
"windowsFxVersion": null, NOTE: the Upon manually updating the attributes via the eddittor the UPDATE: az functionapp config set --net-framework-version v6.0 -n $Function -g $resourceGroup This setep is run within my automation during the software deployment phase as I use PowerShell to deploy the functions contents, therefore, this is the most logical I'm my instance. |
Guide/info here also. |
I am experiencing the same problem with the azurerm_linux_function_app. Any updates on the triage? |
A workaround is to use app_settings = {
"FUNCTIONS_EXTENSION_VERSION" = "~4"
"FUNCTIONS_WORKER_RUNTIME" = "dotnet-isolated"
} |
This didn't work for me, though the error messages has gone in the portal, when you check the resource its still got the wrong netFrameworkVersion
|
I think the Terraform logic that checks/sets the value of WindowsFxVersion for Windows Function Apps isn't right (I've seen LinuxFxVersion mentioned in the documentation but not WindowsFxVersion - is WindowsFxVersion relevant at all to Windows Function Apps?). For example, I created windows function apps with 4 different runtimes using powershell with debug enabled and the following is what Microsoft command line sends to Azure ARM - none of these calls set WindowsFxVersion: dotnet 6: dotnet 3.1: java 11: node 14: |
There are numerous issues with this resource type over the old one - it also won't generate host keys either. #17750 I've switched back to the old resource azurerm_function_app - these new ones just don't work. The fact that this issue was raised in April and its now nearly August proves my point. I've no idea why these where introduced in this state. |
Same issue here, also see this link https://docs.microsoft.com/en-us/answers/questions/835272/azure-functions-pinned-to-unsupported-dotnet-runti.html that says it's fixable in an ARM template by setting To note though, even though there is a warning in the Azure portal, your .NET6 function may still be working fine, during the ~winter we upgraded our functions to .NET6 and changed our "FUNCTION_EXTENSION_VERSION" variables to "~4", and they are all working. Today is the 1st time I've seen the warning banner on the Function runtime settings page, since it's buried in the configuration tabs. Reading through the documentation it looks like we have some extra work to do to fully upgrade to .NET 6. |
Thanks guys for raising the issue. For the newly created windows functions, we will set the .NetFrameworkVersion to v6.0 if dotnet_version sets to 6 in the TF config, it should fix the issue custom ~4. As mentioned in our docs, function runtime 4.0 requires the underlying .Net version6, if the functions are created before, please aslo set the .net version to 6 when upgrading the function worker runtime to 4 and it should resolve custom ~4 situation. |
@xiaxyi I'm creating a new Function as per your comment on the 24th Aug 2022, but still get the same warning and my netFrameworkVersion is still "v4.0" Is there anything that screams incorrect? Any help would be greatly appreicated |
@CRhodes1510 the fix is in the mentioned pr. Can you try setting that property via api and see if its working? |
@xiaxyi setting via Azure CLI, works a treat :) |
It's not working for me with AZ CLI commands. Just stuck with this issue. |
It's not working for me with AZ CLI commands. Just stuck with this issue. |
Please someone help me with AZ CLI command. I can see ~4 is updated, but defaulted to custom field. Has anyone succeeded with the FUNCTIONS_EXTENSION_VERSION to ~4 |
Using the below Powershell code and executing as SPN in DevOps Azure CLI task, got rid of the warning for me
|
Is there any update on this? Ideally I just want to run the Terraform without needing the additional CLI step |
We experience the same issue. It seems to be a pretty easy fix for TF azurerm to add another parameter similar to the app service resource. Thanks. |
I'm using AzAPI provider to resolve any of these types of issues. New deploy reference: Update existing example:
|
@kahawai-sre @royjia , the issue should be fixed now, can you confirm if the app stack for windows dotnet function is set correctly? Thanks! |
Thanks for taking the time to submit this issue. It looks like this has been resolved as of #19685. As such, I am going to mark this issue as closed. |
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. |
Is there an existing issue for this?
Community Note
Terraform Version
1.1.8
AzureRM Provider Version
3.2.0
Affected Resource(s)/Data Source(s)
azurerm_windows_function_app
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The expected behavior is to deploy a windows function app with function runtime ~4.
Actual Behaviour
The actual result of deployment is runtime version "custom" and the only supported drop down is ~3. I'm assuming the reason for "custom" is the function app was created with dotnet version 3.1 and does not support runtime ~4 only ~3, however I specified dotnet 6 in TF. When I create manually in azure portal the function app is created with the correct dotnet 6. I can even import the manually created function app to the same resource in terraform state with no issues.
Steps to Reproduce
Just try to create a function app using the new azurerm_windows_function_app with dotnet 6 and runtime ~4.
I'm assuming the configuration for dotnet 6 is under application stack and runtime version is under functions_extension_version.
functions_extension_version = "~4"
application_stack {
dotnet_version = "6"
I tried both options 3.1 and 6 (as documented) both yield the same result.
Important Factoids
no
References
no
The text was updated successfully, but these errors were encountered: