Skip to content

Commit

Permalink
appservice Add dotnet_version 8 to both linux and windows function …
Browse files Browse the repository at this point in the history
…apps (#23638)
  • Loading branch information
AdamCoulterOz committed Nov 17, 2023
1 parent 2d82dde commit d431aa2
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 8 deletions.
6 changes: 4 additions & 2 deletions internal/services/appservice/helpers/function_app_schema.go
Expand Up @@ -978,7 +978,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.0` and `7.0`.
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`
PythonVersion string `tfschema:"python_version"` // Supported values `3.11`, `3.10`, `3.9`, `3.8`, `3.7`
Expand All @@ -989,7 +989,7 @@ type ApplicationStackLinuxFunctionApp struct {
}

type ApplicationStackWindowsFunctionApp struct {
DotNetVersion string `tfschema:"dotnet_version"` // Supported values `3.1`, `6` and `7`
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`
JavaVersion string `tfschema:"java_version"` // Supported values `8`, `11`, `17`
Expand Down Expand Up @@ -1019,6 +1019,7 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema {
"3.1",
"6.0",
"7.0",
"8.0",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand Down Expand Up @@ -1296,6 +1297,7 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema {
"v4.0",
"v6.0",
"v7.0",
"v8.0",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand Down
51 changes: 51 additions & 0 deletions internal/services/appservice/linux_function_app_resource_test.go
Expand Up @@ -963,6 +963,57 @@ func TestAccLinuxFunctionApp_appStackDotNet6Isolated(t *testing.T) {
})
}

func TestAccLinuxFunctionApp_appStackDotNet8(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test")
r := LinuxFunctionAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackDotNet(data, SkuBasicPlan, "8.0"),
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("DOTNET|8.0"),
),
},
data.ImportStep(),
})
}

func TestAccLinuxFunctionApp_appStackDotNet8ConsumptionPlan(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test")
r := LinuxFunctionAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackDotNet(data, SkuConsumptionPlan, "8.0"),
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("DOTNET|8.0"),
),
},
data.ImportStep(),
})
}

func TestAccLinuxFunctionApp_appStackDotNet8Isolated(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test")
r := LinuxFunctionAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackDotNetIsolated(data, SkuBasicPlan, "8.0"),
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("DOTNET-ISOLATED|8.0"),
),
},
data.ImportStep(),
})
}

func TestAccLinuxFunctionApp_appStackPython(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_linux_function_app", "test")
r := LinuxFunctionAppResource{}
Expand Down
32 changes: 32 additions & 0 deletions internal/services/appservice/windows_function_app_resource_test.go
Expand Up @@ -957,6 +957,38 @@ func TestAccWindowsFunctionApp_appStackDotNet6Isolated(t *testing.T) {
})
}

func TestAccWindowsFunctionApp_appStackDotNet8(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test")
r := WindowsFunctionAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackDotNet(data, SkuBasicPlan, "v8.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
),
},
data.ImportStep(),
})
}

func TestAccWindowsFunctionApp_appStackDotNet8Isolated(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test")
r := WindowsFunctionAppResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackDotNetIsolated(data, SkuBasicPlan, "v8.0"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
),
},
data.ImportStep(),
})
}

func TestAccWindowsFunctionApp_appStackNode(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_windows_function_app", "test")
r := WindowsFunctionAppResource{}
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/linux_function_app.html.markdown
Expand Up @@ -144,7 +144,7 @@ The following arguments are supported:
~> **NOTE:** Setting this value to true will disable the ability to use `zip_deploy_file` which currently relies on the default publishing profile.

* `zip_deploy_file` - (Optional) The local path and filename of the Zip packaged application to deploy to this Linux Function App.

~> **Note:** Using this value requires either `WEBSITE_RUN_FROM_PACKAGE=1` or `SCM_DO_BUILD_DURING_DEPLOYMENT=true` to be set on the App in `app_settings`. Refer to the [Azure docs](https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies) for further details.

---
Expand All @@ -167,7 +167,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`, `6.0` and `7.0`.
* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `3.1`, `6.0`, `7.0` and `8.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
Expand Up @@ -626,7 +626,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`, `6.0` and `7.0`.
* `dotnet_version` - (Optional) The version of .Net. Possible values are `3.1`, `6.0`, `7.0` and `8.0`.

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

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/windows_function_app.html.markdown
Expand Up @@ -144,7 +144,7 @@ The following arguments are supported:
~> **NOTE:** Setting this value to true will disable the ability to use `zip_deploy_file` which currently relies on the default publishing profile.

* `zip_deploy_file` - (Optional) The local path and filename of the Zip packaged application to deploy to this Windows Function App.

~> **Note:** Using this value requires `WEBSITE_RUN_FROM_PACKAGE=1` to be set on the App in `app_settings`. Refer to the [Azure docs](https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies) for further details.

---
Expand All @@ -165,7 +165,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 `v3.0`, `v4.0` `v6.0` and `v7.0`. Defaults to `v4.0`.
* `dotnet_version` - (Optional) The version of .NET to use. Possible values include `v3.0`, `v4.0` `v6.0`, `v7.0` and `v8.0`. Defaults to `v4.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/windows_function_app_slot.html.markdown
Expand Up @@ -619,7 +619,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 `v3.0`, `v4.0`, `v6.0` and `v7.0`. Defaults to `v4.0`.
* `dotnet_version` - (Optional) The version of .Net. Possible values are `v3.0`, `v4.0`, `v6.0`, `v7.0` and `v8.0`. Defaults to `v4.0`.

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

Expand Down

0 comments on commit d431aa2

Please sign in to comment.