Skip to content
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_web_app, azurerm_windows_web_app_slot, azurerm_linux_web_app, azurerm_linux_web_app_slot, azurerm_windows_function_app, azurerm_windows_function_app_slot, azurerm_linux_function_app, azurerm_linux_function_app_slot - add runtime update #24073

Merged
merged 11 commits into from
Mar 11, 2024
2 changes: 2 additions & 0 deletions internal/services/appservice/helpers/function_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema {
"14",
"16",
"18", // preview LTS Support
"20",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand Down Expand Up @@ -1303,6 +1304,7 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema {
"~14",
"~16",
"~18",
"~20",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,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(),
{
Config: r.appStackNodeUpdateTags(data, SkuStandardPlan, "18"),
Check: acceptance.ComposeTestCheckFunc(
Expand Down
15 changes: 15 additions & 0 deletions internal/services/appservice/linux_web_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,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{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,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{}
Expand Down Expand Up @@ -2746,6 +2762,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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,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(),
})
}

Expand Down Expand Up @@ -2140,6 +2148,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" {
Expand Down
15 changes: 15 additions & 0 deletions internal/services/appservice/windows_web_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,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(),
})
}

func TestAccWindowsWebApp_withMultiStack(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_web_app", "test")
r := WindowsWebAppResource{}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/linux_function_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/linux_function_app_slot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,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`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/windows_function_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/windows_function_app_slot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,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`.

Expand Down
Loading