diff --git a/internal/services/appservice/helpers/function_app_schema.go b/internal/services/appservice/helpers/function_app_schema.go index 79292d984875..b4fc9cea41b8 100644 --- a/internal/services/appservice/helpers/function_app_schema.go +++ b/internal/services/appservice/helpers/function_app_schema.go @@ -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` @@ -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` @@ -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", @@ -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", diff --git a/internal/services/appservice/linux_function_app_resource_test.go b/internal/services/appservice/linux_function_app_resource_test.go index a83a105377a3..0316cf7810ad 100644 --- a/internal/services/appservice/linux_function_app_resource_test.go +++ b/internal/services/appservice/linux_function_app_resource_test.go @@ -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{} diff --git a/internal/services/appservice/windows_function_app_resource_test.go b/internal/services/appservice/windows_function_app_resource_test.go index 80e91dee804f..469eb8b25827 100644 --- a/internal/services/appservice/windows_function_app_resource_test.go +++ b/internal/services/appservice/windows_function_app_resource_test.go @@ -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{} diff --git a/website/docs/r/linux_function_app.html.markdown b/website/docs/r/linux_function_app.html.markdown index 58e1a5868746..e725e358723e 100644 --- a/website/docs/r/linux_function_app.html.markdown +++ b/website/docs/r/linux_function_app.html.markdown @@ -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. --- @@ -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`. diff --git a/website/docs/r/linux_function_app_slot.html.markdown b/website/docs/r/linux_function_app_slot.html.markdown index 09282b54052a..c4920b270939 100644 --- a/website/docs/r/linux_function_app_slot.html.markdown +++ b/website/docs/r/linux_function_app_slot.html.markdown @@ -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`. diff --git a/website/docs/r/windows_function_app.html.markdown b/website/docs/r/windows_function_app.html.markdown index 95194b0fb9b6..832f7a4745d2 100644 --- a/website/docs/r/windows_function_app.html.markdown +++ b/website/docs/r/windows_function_app.html.markdown @@ -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. --- @@ -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`. diff --git a/website/docs/r/windows_function_app_slot.html.markdown b/website/docs/r/windows_function_app_slot.html.markdown index f4c763c88f3e..a0a703713b10 100644 --- a/website/docs/r/windows_function_app_slot.html.markdown +++ b/website/docs/r/windows_function_app_slot.html.markdown @@ -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`.