From 4296848483fe35cfab989a1d828723324b4bde66 Mon Sep 17 00:00:00 2001 From: Marcelo Zambrana Villarroel Date: Wed, 15 May 2024 14:06:13 -0400 Subject: [PATCH] Adding support for PowerShell 7.4 (#25980) --- .../appservice/helpers/function_app_schema.go | 12 ++++++----- .../linux_function_app_resource_test.go | 20 +++++++++++++++++++ .../windows_function_app_resource_test.go | 19 ++++++++++++++++++ .../docs/r/linux_function_app.html.markdown | 2 +- .../r/linux_function_app_slot.html.markdown | 2 +- .../docs/r/windows_function_app.html.markdown | 2 +- .../r/windows_function_app_slot.html.markdown | 2 +- 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/internal/services/appservice/helpers/function_app_schema.go b/internal/services/appservice/helpers/function_app_schema.go index 06b5fa4d9041..596d2b4c8c1d 100644 --- a/internal/services/appservice/helpers/function_app_schema.go +++ b/internal/services/appservice/helpers/function_app_schema.go @@ -1123,8 +1123,9 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - "7", // Deprecated / not available in the portal - "7.2", + "7", // Deprecated / not available in the portal + "7.2", // preview LTS Support + "7.4", // current LTS Support }, false), ExactlyOneOf: []string{ "site_config.0.application_stack.0.dotnet_version", @@ -1135,7 +1136,7 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema { "site_config.0.application_stack.0.docker", "site_config.0.application_stack.0.use_custom_runtime", }, - Description: "The version of PowerShell Core to use. Possibles values are `7`, and `7.2`", + Description: "The version of PowerShell Core to use. Possibles values are `7`, `7.2`, and `7.4`", }, "java_version": { @@ -1392,8 +1393,9 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - "7", + "7", // Deprecated / not available in the portal "7.2", // preview LTS Support + "7.4", // current LTS Support }, false), ExactlyOneOf: []string{ "site_config.0.application_stack.0.dotnet_version", @@ -1402,7 +1404,7 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema { "site_config.0.application_stack.0.powershell_core_version", "site_config.0.application_stack.0.use_custom_runtime", }, - Description: "The PowerShell Core version to use. Possible values are `7`, and `7.2`", + Description: "The PowerShell Core version to use. Possible values are `7`, `7.2`, and `7.4`", }, "use_custom_runtime": { diff --git a/internal/services/appservice/linux_function_app_resource_test.go b/internal/services/appservice/linux_function_app_resource_test.go index 50fc0c932a6e..7decb0cab24d 100644 --- a/internal/services/appservice/linux_function_app_resource_test.go +++ b/internal/services/appservice/linux_function_app_resource_test.go @@ -1318,6 +1318,23 @@ func TestAccLinuxFunctionApp_appStackPowerShellCore72(t *testing.T) { }) } +func TestAccLinuxFunctionApp_appStackPowerShellCore74(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test") + r := LinuxFunctionAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.appStackPowerShellCore(data, SkuBasicPlan, "7.4"), + 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("POWERSHELL|7.4"), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + // (@jackofallops) - The portal does not allow the active stack to be changed currently, however, the API accepts it and the changes are reflected in the portal. func TestAccLinuxFunctionApp_appStackUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test") @@ -2918,6 +2935,9 @@ resource "azurerm_linux_function_app" "test" { powershell_core_version = "%s" } } + + ftp_publish_basic_authentication_enabled = false + webdeploy_publish_basic_authentication_enabled = false } `, r.template(data, planSku), data.RandomInteger, version) } diff --git a/internal/services/appservice/windows_function_app_resource_test.go b/internal/services/appservice/windows_function_app_resource_test.go index adf49544cbbc..3cd0821971c9 100644 --- a/internal/services/appservice/windows_function_app_resource_test.go +++ b/internal/services/appservice/windows_function_app_resource_test.go @@ -1295,6 +1295,22 @@ func TestAccWindowsFunctionApp_appStackPowerShellCore72(t *testing.T) { }) } +func TestAccWindowsFunctionApp_appStackPowerShellCore74(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test") + r := WindowsFunctionAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.appStackPowerShellCore(data, SkuBasicPlan, "7.4"), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("kind").HasValue("functionapp"), + ), + }, + data.ImportStep("site_credential.0.password"), + }) +} + // Others func TestAccWindowsFunctionApp_updateServicePlan(t *testing.T) { @@ -2981,6 +2997,9 @@ resource "azurerm_windows_function_app" "test" { powershell_core_version = "%s" } } + + ftp_publish_basic_authentication_enabled = false + webdeploy_publish_basic_authentication_enabled = false } `, r.template(data, planSku), data.RandomInteger, version) } diff --git a/website/docs/r/linux_function_app.html.markdown b/website/docs/r/linux_function_app.html.markdown index 2ae1db4f1834..54749723f888 100644 --- a/website/docs/r/linux_function_app.html.markdown +++ b/website/docs/r/linux_function_app.html.markdown @@ -177,7 +177,7 @@ A `application_stack` block supports the following: * `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`. -* `powershell_core_version` - (Optional) The version of PowerShell Core to run. Possible values are `7`, and `7.2`. +* `powershell_core_version` - (Optional) The version of PowerShell Core to run. Possible values are `7`, `7.2`, and `7.4`. * `use_custom_runtime` - (Optional) Should the Linux Function App use a custom runtime? diff --git a/website/docs/r/linux_function_app_slot.html.markdown b/website/docs/r/linux_function_app_slot.html.markdown index e27f68233d4f..fadd640500ef 100644 --- a/website/docs/r/linux_function_app_slot.html.markdown +++ b/website/docs/r/linux_function_app_slot.html.markdown @@ -640,7 +640,7 @@ An `application_stack` block supports the following: * `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`. +* `powershell_core_version` - (Optional) The version of PowerShell Core to use. Possibles values are `7` , `7.2`, and `7.4`. * `python_version` - (Optional) The version of Python to use. Possible values are `3.12`, `3.11`, `3.10`, `3.9`, `3.8` and `3.7`. diff --git a/website/docs/r/windows_function_app.html.markdown b/website/docs/r/windows_function_app.html.markdown index eebcf8105295..052f52cd7b23 100644 --- a/website/docs/r/windows_function_app.html.markdown +++ b/website/docs/r/windows_function_app.html.markdown @@ -173,7 +173,7 @@ A `application_stack` block supports the following: * `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`. +* `powershell_core_version` - (Optional) The version of PowerShell Core to run. Possible values are `7`, `7.2`, and `7.4`. ~> **NOTE:** A value of `7` will provide the latest stable version. `7.2` is in preview at the time of writing. diff --git a/website/docs/r/windows_function_app_slot.html.markdown b/website/docs/r/windows_function_app_slot.html.markdown index b7cbda5b920e..496322e7ca8f 100644 --- a/website/docs/r/windows_function_app_slot.html.markdown +++ b/website/docs/r/windows_function_app_slot.html.markdown @@ -633,7 +633,7 @@ An `application_stack` block supports the following: * `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`. +* `powershell_core_version` - (Optional) The PowerShell Core version to use. Possible values are `7`, `7.2`, and `7.4`. * `use_custom_runtime` - (Optional) Does the Function App use a custom Application Stack?