diff --git a/internal/services/appservice/helpers/app_stack.go b/internal/services/appservice/helpers/app_stack.go index 5836bc2220c1..47798eed5f90 100644 --- a/internal/services/appservice/helpers/app_stack.go +++ b/internal/services/appservice/helpers/app_stack.go @@ -128,6 +128,7 @@ func windowsApplicationStackSchema() *pluginsdk.Schema { "~14", "~16", "~18", + "~20", }, false), AtLeastOneOf: windowsApplicationStackConstraint, }, @@ -282,6 +283,7 @@ func windowsApplicationStackSchema() *pluginsdk.Schema { "~14", "~16", "~18", + "~20", }, false) r.Schema["java_version"].AtLeastOneOf = windowsApplicationStackConstraintThreePointX diff --git a/internal/services/appservice/helpers/function_app_schema.go b/internal/services/appservice/helpers/function_app_schema.go index 5ebae00fcad8..5850a023d300 100644 --- a/internal/services/appservice/helpers/function_app_schema.go +++ b/internal/services/appservice/helpers/function_app_schema.go @@ -1006,7 +1006,7 @@ type ApplicationStackLinuxFunctionApp struct { // Note - Function Apps differ to Web Apps here. They do not use the named properties in the SiteConfig block and exclusively use the app_settings map DotNetVersion string `tfschema:"dotnet_version"` // Supported values `3.1`, `6.0`, `7.0` and `8.0`. DotNetIsolated bool `tfschema:"use_dotnet_isolated_runtime"` // Supported values `true` for `dotnet-isolated`, `false` otherwise - NodeVersion string `tfschema:"node_version"` // Supported values `12LTS`, `14LTS`, `16LTS`, `18LTS` + NodeVersion string `tfschema:"node_version"` // Supported values `12LTS`, `14LTS`, `16LTS`, `18LTS, `20LTS`` PythonVersion string `tfschema:"python_version"` // Supported values `3.12`, `3.11`, `3.10`, `3.9`, `3.8`, `3.7` PowerShellCoreVersion string `tfschema:"powershell_core_version"` // Supported values are `7.0`, `7.2` JavaVersion string `tfschema:"java_version"` // Supported values `8`, `11`, `17` @@ -1017,7 +1017,7 @@ type ApplicationStackLinuxFunctionApp struct { type ApplicationStackWindowsFunctionApp struct { DotNetVersion string `tfschema:"dotnet_version"` // Supported values `v3.0`, `v4.0`, `v6.0`, `v7.0` and `v8.0` DotNetIsolated bool `tfschema:"use_dotnet_isolated_runtime"` // Supported values `true` for `dotnet-isolated`, `false` otherwise - NodeVersion string `tfschema:"node_version"` // Supported values `12LTS`, `14LTS`, `16LTS`, `18LTS` + NodeVersion string `tfschema:"node_version"` // Supported values `12LTS`, `14LTS`, `16LTS`, `18LTS, `20LTS` JavaVersion string `tfschema:"java_version"` // Supported values `8`, `11`, `17` PowerShellCoreVersion string `tfschema:"powershell_core_version"` // Supported values are `7.0`, `7.2` CustomHandler bool `tfschema:"use_custom_runtime"` // Supported values `true` @@ -1105,6 +1105,7 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema { "14", "16", "18", // preview LTS Support + "20", }, false), ExactlyOneOf: []string{ "site_config.0.application_stack.0.dotnet_version", @@ -1357,6 +1358,7 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema { "~14", "~16", "~18", + "~20", }, false), ExactlyOneOf: []string{ "site_config.0.application_stack.0.dotnet_version", diff --git a/internal/services/appservice/linux_function_app_resource_test.go b/internal/services/appservice/linux_function_app_resource_test.go index cccf63c7cc6d..09e3f51d7dfe 100644 --- a/internal/services/appservice/linux_function_app_resource_test.go +++ b/internal/services/appservice/linux_function_app_resource_test.go @@ -1147,6 +1147,15 @@ func TestAccLinuxFunctionApp_appStackNodeUpdate(t *testing.T) { ), }, data.ImportStep("site_credential.0.password"), + { + Config: r.appStackNode(data, SkuBasicPlan, "20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp,linux"), + check.That(data.ResourceName).Key("site_config.0.linux_fx_version").HasValue("NODE|20"), + ), + }, + data.ImportStep(), { Config: r.appStackNode(data, SkuBasicPlan, "14"), Check: acceptance.ComposeTestCheckFunc( diff --git a/internal/services/appservice/linux_function_app_slot_resource_test.go b/internal/services/appservice/linux_function_app_slot_resource_test.go index 7bed04f799cf..24ad06b47ad8 100644 --- a/internal/services/appservice/linux_function_app_slot_resource_test.go +++ b/internal/services/appservice/linux_function_app_slot_resource_test.go @@ -868,6 +868,15 @@ func TestAccLinuxFunctionAppSlot_appStackNodeUpdate(t *testing.T) { ), }, data.ImportStep("site_credential.0.password"), + { + Config: r.appStackNode(data, SkuStandardPlan, "20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp,linux"), + check.That(data.ResourceName).Key("site_config.0.linux_fx_version").HasValue("NODE|20"), + ), + }, + data.ImportStep("site_credential.0.password"), { Config: r.appStackNodeUpdateTags(data, SkuStandardPlan, "18"), Check: acceptance.ComposeTestCheckFunc( diff --git a/internal/services/appservice/linux_web_app_resource_test.go b/internal/services/appservice/linux_web_app_resource_test.go index c8cac59a96ac..a89199725687 100644 --- a/internal/services/appservice/linux_web_app_resource_test.go +++ b/internal/services/appservice/linux_web_app_resource_test.go @@ -930,7 +930,7 @@ func TestAccLinuxWebApp_withNode18LTS(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.node(data, "20-lts"), + Config: r.node(data, "18-lts"), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), @@ -939,6 +939,21 @@ func TestAccLinuxWebApp_withNode18LTS(t *testing.T) { }) } +func TestAccLinuxWebApp_withNode20LTS(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_web_app", "test") + r := LinuxWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.node(data, "20-lts"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func TestAccLinuxWebApp_withJre8Java(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_linux_web_app", "test") r := LinuxWebAppResource{} diff --git a/internal/services/appservice/linux_web_app_slot_resource_test.go b/internal/services/appservice/linux_web_app_slot_resource_test.go index c0e6334d23a6..e5b90051ff37 100644 --- a/internal/services/appservice/linux_web_app_slot_resource_test.go +++ b/internal/services/appservice/linux_web_app_slot_resource_test.go @@ -965,6 +965,36 @@ func TestAccLinuxWebAppSlot_withNode16LTS(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_linux_web_app_slot", "test") r := LinuxWebAppSlotResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.node(data, "16-lts"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + +func TestAccLinuxWebAppSlot_withNode18LTS(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_web_app_slot", "test") + r := LinuxWebAppSlotResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.node(data, "18-lts"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + +func TestAccLinuxWebAppSlot_withNode20LTS(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_web_app_slot", "test") + r := LinuxWebAppSlotResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.node(data, "20-lts"), diff --git a/internal/services/appservice/windows_function_app_resource_test.go b/internal/services/appservice/windows_function_app_resource_test.go index a514084a295b..688d4138b1ce 100644 --- a/internal/services/appservice/windows_function_app_resource_test.go +++ b/internal/services/appservice/windows_function_app_resource_test.go @@ -1087,6 +1087,22 @@ func TestAccWindowsFunctionApp_appStackNode18(t *testing.T) { }) } +func TestAccWindowsFunctionApp_appStackNode20(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test") + r := WindowsFunctionAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.appStackNode(data, SkuConsumptionPlan, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp"), + ), + }, + data.ImportStep(), + }) +} + func TestAccWindowsFunctionApp_appStackNodeUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test") r := WindowsFunctionAppResource{} @@ -1116,6 +1132,22 @@ func TestAccWindowsFunctionApp_appStackNodeUpdate(t *testing.T) { ), }, data.ImportStep("site_credential.0.password"), + { + Config: r.appStackNode(data, SkuBasicPlan, "~18"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp"), + ), + }, + data.ImportStep("site_credential.0.password"), + { + Config: r.appStackNode(data, SkuBasicPlan, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp"), + ), + }, + data.ImportStep("site_credential.0.password"), }) } @@ -2810,6 +2842,7 @@ resource "azurerm_windows_function_app" "test" { `, r.template(data, planSku), data.RandomInteger, version) } +// nolint: unparam func (r WindowsFunctionAppResource) appStackNode(data acceptance.TestData, planSku string, nodeVersion string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/appservice/windows_function_app_slot_resource_test.go b/internal/services/appservice/windows_function_app_slot_resource_test.go index 765d1e81491d..2e48b4d61d18 100644 --- a/internal/services/appservice/windows_function_app_slot_resource_test.go +++ b/internal/services/appservice/windows_function_app_slot_resource_test.go @@ -757,6 +757,22 @@ func TestAccWindowsFunctionAppSlot_appStackNode(t *testing.T) { }) } +func TestAccWindowsFunctionAppSlot_appStackNode20(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_function_app_slot", "test") + r := WindowsFunctionAppSlotResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.appStackNode(data, SkuStandardPlan, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp"), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + func TestAccWindowsFunctionAppSlot_appStackNodeUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_function_app_slot", "test") r := WindowsFunctionAppSlotResource{} @@ -778,6 +794,14 @@ func TestAccWindowsFunctionAppSlot_appStackNodeUpdate(t *testing.T) { ), }, data.ImportStep("site_credential.0.password"), + { + Config: r.appStackNode(data, SkuStandardPlan, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp"), + ), + }, + data.ImportStep(), }) } @@ -2221,6 +2245,7 @@ resource "azurerm_windows_function_app_slot" "test" { `, r.template(data, planSku), data.RandomInteger, version) } +// nolint: unparam func (r WindowsFunctionAppSlotResource) appStackNode(data acceptance.TestData, planSku string, nodeVersion string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/appservice/windows_web_app_resource_test.go b/internal/services/appservice/windows_web_app_resource_test.go index fbdf60cf1ee3..2fbe83a33b2a 100644 --- a/internal/services/appservice/windows_web_app_resource_test.go +++ b/internal/services/appservice/windows_web_app_resource_test.go @@ -1076,6 +1076,21 @@ func TestAccWindowsWebApp_withNode18(t *testing.T) { }) } +func TestAccWindowsWebApp_withNode20(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_web_app", "test") + r := WindowsWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.node(data, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + func TestAccWindowsWebApp_withMultiStack(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_web_app", "test") r := WindowsWebAppResource{} diff --git a/internal/services/appservice/windows_web_app_slot_resource_test.go b/internal/services/appservice/windows_web_app_slot_resource_test.go index 09b66ec3f410..57f46a7970a3 100644 --- a/internal/services/appservice/windows_web_app_slot_resource_test.go +++ b/internal/services/appservice/windows_web_app_slot_resource_test.go @@ -788,6 +788,21 @@ func TestAccWindowsWebAppSlot_withNode18(t *testing.T) { }) } +func TestAccWindowsWebAppSlot_withNode20(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_web_app_slot", "test") + r := WindowsWebAppSlotResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.node(data, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + func TestAccWindowsWebAppSlot_withNodeUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_web_app_slot", "test") r := WindowsWebAppSlotResource{} @@ -807,6 +822,13 @@ func TestAccWindowsWebAppSlot_withNodeUpdate(t *testing.T) { ), }, data.ImportStep("site_credential.0.password"), + { + Config: r.node(data, "~20"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("site_credential.0.password"), }) } diff --git a/website/docs/r/linux_function_app.html.markdown b/website/docs/r/linux_function_app.html.markdown index ce666dc233ba..3817f80fc3dc 100644 --- a/website/docs/r/linux_function_app.html.markdown +++ b/website/docs/r/linux_function_app.html.markdown @@ -173,7 +173,7 @@ A `application_stack` block supports the following: * `java_version` - (Optional) The Version of Java to use. Supported versions include `8`, `11` & `17`. -* `node_version` - (Optional) The version of Node to run. Possible values include `12`, `14`, `16` and `18`. +* `node_version` - (Optional) The version of Node to run. Possible values include `12`, `14`, `16`, `18` and `20`. * `python_version` - (Optional) The version of Python to run. Possible values are `3.12`, `3.11`, `3.10`, `3.9`, `3.8` and `3.7`. diff --git a/website/docs/r/linux_function_app_slot.html.markdown b/website/docs/r/linux_function_app_slot.html.markdown index 83ca48869fa3..262182db6cef 100644 --- a/website/docs/r/linux_function_app_slot.html.markdown +++ b/website/docs/r/linux_function_app_slot.html.markdown @@ -636,7 +636,7 @@ An `application_stack` block supports the following: * `java_version` - (Optional) The version of Java to use. Possible values are `8`, `11` & `17` (In-Preview). -* `node_version` - (Optional) The version of Node to use. Possible values include `12`, `14`, `16` and `18` +* `node_version` - (Optional) The version of Node to use. Possible values include `12`, `14`, `16`, `18` and `20` * `powershell_core_version` - (Optional) The version of PowerShell Core to use. Possibles values are `7` , and `7.2`. diff --git a/website/docs/r/windows_function_app.html.markdown b/website/docs/r/windows_function_app.html.markdown index eaa644b4d07a..089d27dabd91 100644 --- a/website/docs/r/windows_function_app.html.markdown +++ b/website/docs/r/windows_function_app.html.markdown @@ -171,7 +171,7 @@ A `application_stack` block supports the following: * `java_version` - (Optional) The Version of Java to use. Supported versions include `1.8`, `11` & `17` (In-Preview). -* `node_version` - (Optional) The version of Node to run. Possible values include `~12`, `~14`, `~16` and `~18`. +* `node_version` - (Optional) The version of Node to run. Possible values include `~12`, `~14`, `~16`, `~18` and `~20`. * `powershell_core_version` - (Optional) The version of PowerShell Core to run. Possible values are `7`, and `7.2`. diff --git a/website/docs/r/windows_function_app_slot.html.markdown b/website/docs/r/windows_function_app_slot.html.markdown index cc89081362af..210494bd7ba5 100644 --- a/website/docs/r/windows_function_app_slot.html.markdown +++ b/website/docs/r/windows_function_app_slot.html.markdown @@ -629,7 +629,7 @@ An `application_stack` block supports the following: * `java_version` - (Optional) The version of Java to use. Possible values are `1.8`, `11` and `17` (In-Preview). -* `node_version` - (Optional) The version of Node to use. Possible values are `~12`, `~14`, `~16` and `~18`. +* `node_version` - (Optional) The version of Node to use. Possible values are `~12`, `~14`, `~16`, `~18` and `~20`. * `powershell_core_version` - (Optional) The PowerShell Core version to use. Possible values are `7`, and `7.2`. diff --git a/website/docs/r/windows_web_app.html.markdown b/website/docs/r/windows_web_app.html.markdown index a0946cf755da..6db5e6f3bfbc 100644 --- a/website/docs/r/windows_web_app.html.markdown +++ b/website/docs/r/windows_web_app.html.markdown @@ -189,7 +189,7 @@ ASP.NET V4.8 | v4.0 ~> **NOTE:** For currently supported versions, please see the official documentation. Some example values include: `1.8`, `1.8.0_322`, `11`, `11.0.14`, `17` and `17.0.2` -* `node_version` - (Optional) The version of node to use when `current_stack` is set to `node`. Possible values are `~12`, `~14`, `~16`, and `~18`. +* `node_version` - (Optional) The version of node to use when `current_stack` is set to `node`. Possible values are `~12`, `~14`, `~16`, `~18` and `~20`. ~> **NOTE:** This property conflicts with `java_version`. diff --git a/website/docs/r/windows_web_app_slot.html.markdown b/website/docs/r/windows_web_app_slot.html.markdown index 8291761e04fa..9ff437ea43e0 100644 --- a/website/docs/r/windows_web_app_slot.html.markdown +++ b/website/docs/r/windows_web_app_slot.html.markdown @@ -184,7 +184,7 @@ An `application_stack` block supports the following: ~> **NOTE:** For compatible combinations of `java_version`, `java_container` and `java_container_version` users can use `az webapp list-runtimes` from command line. -* `node_version` - (Optional) The version of node to use when `current_stack` is set to `node`. Possible values include `~12`, `~14`, `~16`, and `~18`. +* `node_version` - (Optional) The version of node to use when `current_stack` is set to `node`. Possible values include `~12`, `~14`, `~16`, `~18` and `~20`. ~> **NOTE:** This property conflicts with `java_version`.