From 19a42a3c266730d7d054a82e1658373fe96f22d3 Mon Sep 17 00:00:00 2001 From: Harshavardhan Musanalli Date: Tue, 19 Dec 2023 17:08:28 +0100 Subject: [PATCH] #24134: Default logic app versions to ~4 --- internal/services/logic/logic_app_standard_resource.go | 8 +++++++- .../services/logic/logic_app_standard_resource_test.go | 6 +++--- website/docs/r/logic_app_standard.html.markdown | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/services/logic/logic_app_standard_resource.go b/internal/services/logic/logic_app_standard_resource.go index 4f74724c7e07..0dc8ff2ea385 100644 --- a/internal/services/logic/logic_app_standard_resource.go +++ b/internal/services/logic/logic_app_standard_resource.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/validate" @@ -177,7 +178,12 @@ func resourceLogicAppStandard() *pluginsdk.Resource { "version": { Type: pluginsdk.TypeString, Optional: true, - Default: "~3", + Default: func() interface{} { + if !features.FourPointOhBeta() { + return "~3" + } + return "~4" + }, }, "tags": tags.Schema(), diff --git a/internal/services/logic/logic_app_standard_resource_test.go b/internal/services/logic/logic_app_standard_resource_test.go index 201efecac485..7553bcba99f4 100644 --- a/internal/services/logic/logic_app_standard_resource_test.go +++ b/internal/services/logic/logic_app_standard_resource_test.go @@ -29,7 +29,7 @@ func TestAccLogicAppStandard_basic(t *testing.T) { Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), acceptance.TestCheckResourceAttr(data.ResourceName, "kind", "functionapp,workflowapp"), - check.That(data.ResourceName).Key("version").HasValue("~3"), + check.That(data.ResourceName).Key("version").HasValue("~4"), check.That(data.ResourceName).Key("outbound_ip_addresses").Exists(), check.That(data.ResourceName).Key("possible_outbound_ip_addresses").Exists(), check.That(data.ResourceName).Key("custom_domain_verification_id").Exists(), @@ -780,7 +780,7 @@ func TestAccLogicAppStandard_dotnetVersion5(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.dotnetVersion(data, "~3", "v5.0"), + Config: r.dotnetVersion(data, "~4", "v5.0"), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("site_config.0.dotnet_framework_version").HasValue("v5.0"), @@ -1858,7 +1858,7 @@ resource "azurerm_logic_app_standard" "test" { app_service_plan_id = azurerm_app_service_plan.test.id storage_account_name = azurerm_storage_account.test.name storage_account_access_key = azurerm_storage_account.test.primary_access_key - version = "~3" + version = "~4" site_config { pre_warmed_instance_count = 1 diff --git a/website/docs/r/logic_app_standard.html.markdown b/website/docs/r/logic_app_standard.html.markdown index 5eff9eab07ba..04613aa9fdcb 100644 --- a/website/docs/r/logic_app_standard.html.markdown +++ b/website/docs/r/logic_app_standard.html.markdown @@ -151,7 +151,9 @@ The following arguments are supported: ~> **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use_32_bit_worker_process` must be set to `true`. -* `version` - (Optional) The runtime version associated with the Logic App. Defaults to `~3`. +* `version` - (Optional) The runtime version associated with the Logic App. Defaults to `~4`. + +~> **Note:** Logic App version `3.x` will be out of support from December 3 2022. For more details refer [Logic Apps Standard Support for Functions Runtime V4](https://azure.microsoft.com/en-us/updates/logic-apps-standard-support-for-functions-runtime-v4/) * `virtual_network_subnet_id` - (Optional) The subnet id which will be used by this resource for [regional virtual network integration](https://docs.microsoft.com/en-us/azure/app-service/overview-vnet-integration#regional-virtual-network-integration).