hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

Inconsistent node_version usage between apps (linux, windows, function, app) #20009

Open laurilarjo opened 1 year ago

laurilarjo commented 1 year ago

Is there an existing issue for this?

Community Note

This isn't strictly a bug report, but a change in behaviour that's probably not intended.

I just upgraded to 3.39 from 3.37 and noticed this issue. Depending on the app type, the node_version now needs to be set with different strings. This is very confusing.

windows_web_app Screenshot 2023-01-13 at 17 02 48

windows_function_app Screenshot 2023-01-13 at 17 03 14

linux_function_app Screenshot 2023-01-13 at 17 03 51

linux_web_app Screenshot 2023-01-13 at 17 04 07

I don't really care whether the right term is to use 14-lts, 14 or ~14, but it needs to be consistent across the modules.

Thanks for making things better :)

Terraform Version

1.3.7

AzureRM Provider Version

3.39.0

Affected Resource(s)/Data Source(s)

windows_web_app, windows_function_app, linux_function_app, linux_web_app

Terraform Configuration Files

screenshots explain the issue

Debug Output/Panic Output

-

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

xiaxyi commented 1 year ago

Thanks @laurilarjo for raising this issue. The accepted node value for windows and linux platforms is difference from API side and we made Terraform behavior to match with API. The behavior may not be change for now, at least in 3.0 provider, we can consider the change in 4.0, but can you let me know how does the difference impact your production?

xiaxyi commented 1 year ago

@laurilarjo may I know if you have any follow up questions?

Joseluismantilla commented 1 year ago

Azure is migrating the versions with"~" symbol to "LTS", therefore you'll have to update in windows and linux, the changes started on Linux, for that reason if you validate them in az cli -- that doesn't show linux or windows -- you'll see:

$ az webapp list-runtimes
    "NODE:18-lts",
    "NODE:18LTS",
"linux": [
    "DOTNETCORE:7.0",
    "DOTNETCORE:6.0",
    "NODE:18-lts",
    "NODE:16-lts",
    "NODE:14-lts", 
...
 "windows": [
    "dotnet:7",
    "dotnet:6",
    "ASPNET:V4.8",
    "ASPNET:V3.5",
    "NODE:18LTS",
    "NODE:16LTS",
    "NODE:14LTS"

Today you can deploy the ~18 but once the sync finishes, you'll need to replace it by 18-tls.