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_linux_web_app , azurerm_windows_web_app, azurerm_linux_function_app, azurerm_windows_function_app - Add support for .NET 7 in app service resources #19232

Merged
merged 2 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions internal/services/appservice/helpers/function_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ func SiteConfigSchemaWindowsFunctionAppComputed() *pluginsdk.Schema {

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`.
DotNetVersion string `tfschema:"dotnet_version"` // Supported values `3.1`, `6.0` and `7.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`
PythonVersion string `tfschema:"python_version"` // Supported values `3.9`, `3.8`, `3.7`
Expand All @@ -985,7 +985,7 @@ type ApplicationStackLinuxFunctionApp struct {
}

type ApplicationStackWindowsFunctionApp struct {
DotNetVersion string `tfschema:"dotnet_version"` // Supported values `3.1`. Version 6 is in preview on Windows Only
DotNetVersion string `tfschema:"dotnet_version"` // Supported values `3.1`, `6` and `7`
DotNetIsolated bool `tfschema:"use_dotnet_isolated_runtime"` // Supported values `true` for `dotnet-isolated`, `false` otherwise
NodeVersion string `tfschema:"node_version"` // Supported values `12LTS`, `14LTS`
JavaVersion string `tfschema:"java_version"` // Supported values `8`, `11`, `17` (In-Preview)
Expand Down Expand Up @@ -1014,6 +1014,7 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema {
ValidateFunc: validation.StringInSlice([]string{
"3.1",
"6.0",
"7.0",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand All @@ -1024,7 +1025,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 .Net. Possible values are `3.1` and `6.0`",
Description: "The version of .Net. Possible values are `3.1`, `6.0` and `7.0`",
},

"use_dotnet_isolated_runtime": {
Expand Down Expand Up @@ -1285,6 +1286,7 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema {
ValidateFunc: validation.StringInSlice([]string{
"3.1",
"6",
"7",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand All @@ -1293,7 +1295,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 version of .Net. Possible values are `3.1` and `6`",
Description: "The version of .Net. Possible values are `3.1` `6` and `7`",
},

"use_dotnet_isolated_runtime": {
Expand Down
5 changes: 4 additions & 1 deletion internal/services/appservice/helpers/web_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,14 +888,16 @@ func windowsApplicationStackSchema() *pluginsdk.Schema {
"core3.1",
"v4.0",
"v5.0",
"v6.0"}, false)
"v6.0",
"v7.0"}, false)
}
return validation.StringInSlice([]string{
"v2.0",
"core3.1",
"v4.0",
"v5.0",
"v6.0",
"v7.0",
}, false)
}(),
AtLeastOneOf: []string{
Expand Down Expand Up @@ -1142,6 +1144,7 @@ func linuxApplicationStackSchema() *pluginsdk.Schema {
"3.1",
"5.0",
"6.0",
"7.0",
}, false),
AtLeastOneOf: []string{
"site_config.0.application_stack.0.docker_image",
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 @@ -598,6 +598,21 @@ func TestAccLinuxWebApp_withDotNet60(t *testing.T) {
})
}

func TestAccLinuxWebApp_withDotNet70(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_web_app", "test")
r := LinuxWebAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.dotNet(data, "7.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccLinuxWebApp_withPhp74(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 @@ -611,6 +611,21 @@ func TestAccLinuxWebAppSlot_withDotNet60(t *testing.T) {
})
}

func TestAccLinuxWebAppSlot_withDotNet70(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_web_app_slot", "test")
r := LinuxWebAppSlotResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.dotNet(data, "7.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccLinuxWebAppSlot_withPhp74(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_web_app_slot", "test")
r := LinuxWebAppSlotResource{}
Expand Down
30 changes: 30 additions & 0 deletions internal/services/appservice/windows_web_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,36 @@ func TestAccWindowsWebApp_withDotNet5(t *testing.T) {
})
}

func TestAccWindowsWebApp_withDotNet60(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_web_app", "test")
r := WindowsWebAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.dotNet(data, "v6.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccWindowsWebApp_withDotNet70(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_web_app", "test")
r := WindowsWebAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.dotNet(data, "v7.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccWindowsWebApp_withPhp(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 @@ -574,6 +574,21 @@ func TestAccWindowsWebAppSlot_withDotNet6(t *testing.T) {
})
}

func TestAccWindowsWebAppSlot_withDotNet7(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_web_app_slot", "test")
r := WindowsWebAppSlotResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.dotNet(data, "v7.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccWindowsWebAppSlot_withPhp74(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_web_app_slot", "test")
r := WindowsWebAppSlotResource{}
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 @@ -148,7 +148,7 @@ A `application_stack` block supports the following:

* `docker` - (Optional) One or more `docker` blocks as defined below.

* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1` and `6.0`.
* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `6.0` and `7.0`.

* `use_dotnet_isolated_runtime` - (Optional) Should the DotNet process use an isolated runtime. Defaults to `false`.

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 @@ -388,7 +388,7 @@ An `application_stack` block supports the following:

* `docker` - (Optional) a `docker` block as detailed below.

* `dotnet_version` - (Optional) The version of .Net. Possible values are `3.1` and `6.0`.
* `dotnet_version` - (Optional) The version of .Net. Possible values are `3.1`, `6.0` and `7.0`.

* `use_dotnet_isolated_runtime` - (Optional) Should the DotNet process use an isolated runtime. Defaults to `false`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/linux_web_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ An `application_stack` block supports the following:

* `docker_image_tag` - (Optional) The image Tag to use. e.g. `latest`.

* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `5.0`, and `6.0`.
* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `5.0`, `6.0` and `7.0`.

* `java_server` - (Optional) The Java server type. Possible values include `JAVA`, `TOMCAT`, and `JBOSSEAP`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/linux_web_app_slot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ An `application_stack` block supports the following:

* `docker_image_tag` - (Optional) The image Tag to use. e.g. `latest`.

* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `5.0`, and `6.0`.
* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `6.0` and `7.0`.

* `java_server` - (Optional) The Java server type. Possible values include `JAVA`, `TOMCAT`, and `JBOSSEAP`.

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 @@ -146,7 +146,7 @@ An `active_directory` block supports the following:

A `application_stack` block supports the following:

* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1` and `6`.
* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `6` and `7`.

* `use_dotnet_isolated_runtime` - (Optional) Should the DotNet process use an isolated runtime. Defaults to `false`.

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 @@ -381,7 +381,7 @@ An `app_service_logs` block supports the following:

An `application_stack` block supports the following:

* `dotnet_version` - (Optional) The version of .Net. Possible values are `3.1` and `6`
* `dotnet_version` - (Optional) The version of .Net. Possible values are `3.1`, `6` and `7`

* `use_dotnet_isolated_runtime` - (Optional) Should the DotNet process use an isolated runtime. Defaults to `false`.

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 @@ -146,7 +146,7 @@ An `application_stack` block supports the following:

* `docker_container_tag` - (Optional) The Image Tag of the specified Docker Container to use. For example `latest`

* `dotnet_version` - (Optional) The version of .NET to use when `current_stack` is set to `dotnet`. Possible values include `v2.0`,`v3.0`,`core3.1`, `v4.0`, `v5.0`, and `v6.0`.
* `dotnet_version` - (Optional) The version of .NET to use when `current_stack` is set to `dotnet`. Possible values include `v2.0`,`v3.0`,`core3.1`, `v4.0`, `v5.0`, `v6.0` and `v7.0`.

* `java_container` - (Optional) The Java container type to use when `current_stack` is set to `java`. Possible values include `JAVA`, `JETTY`, and `TOMCAT`. Required with `java_version` and `java_container_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 @@ -150,7 +150,7 @@ A `application_stack` block supports the following:

* `docker_container_tag` - (Optional) The Image Tag of the specified Docker Container to use. For example `latest`

* `dotnet_version` - (Optional) The version of .NET to use when `current_stack` is set to `dotnet`. Possible values include `v3.0`, `v4.0`, `v5.0`, and `v6.0`.
* `dotnet_version` - (Optional) The version of .NET to use when `current_stack` is set to `dotnet`. Possible values include `v3.0`, `v4.0`, `v5.0`, `v6.0` and `v7.0` .

* `java_container` - (Optional) The Java container type to use when `current_stack` is set to `java`. Possible values include `JAVA`, `JETTY`, and `TOMCAT`. Required with `java_version` and `java_container_version`.

Expand Down