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/app_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func windowsApplicationStackSchema() *pluginsdk.Schema {
"~14",
"~16",
"~18",
"~20",
}, false),
AtLeastOneOf: windowsApplicationStackConstraint,
},
Expand Down Expand Up @@ -282,6 +283,7 @@ func windowsApplicationStackSchema() *pluginsdk.Schema {
"~14",
"~16",
"~18",
"~20",
}, false)
r.Schema["java_version"].AtLeastOneOf = windowsApplicationStackConstraintThreePointX

Expand Down
6 changes: 4 additions & 2 deletions internal/services/appservice/helpers/function_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1357,6 +1358,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 @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 16 additions & 1 deletion internal/services/appservice/linux_web_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand All @@ -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{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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"),
})
}

Expand Down Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -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(),
})
}

Expand Down Expand Up @@ -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" {
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 @@ -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{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand All @@ -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"),
})
}

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 @@ -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`.

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 @@ -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`.

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

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

Expand Down
Loading