From d0f469dbe1f57288fea6546226199e447eefb8f5 Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Mon, 25 Dec 2023 13:22:29 +0800 Subject: [PATCH] `azurerm_logic_app_standard` - fix a crash --- internal/services/logic/logic_app_standard_resource.go | 2 +- .../services/logic/logic_app_standard_resource_test.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/services/logic/logic_app_standard_resource.go b/internal/services/logic/logic_app_standard_resource.go index 0dc8ff2ea385..020b22f8828c 100644 --- a/internal/services/logic/logic_app_standard_resource.go +++ b/internal/services/logic/logic_app_standard_resource.go @@ -183,7 +183,7 @@ func resourceLogicAppStandard() *pluginsdk.Resource { 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 7553bcba99f4..3725a7798af7 100644 --- a/internal/services/logic/logic_app_standard_resource_test.go +++ b/internal/services/logic/logic_app_standard_resource_test.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -29,7 +30,12 @@ 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("~4"), + func() pluginsdk.TestCheckFunc { + if features.FourPointOhBeta() { + return check.That(data.ResourceName).Key("version").HasValue("~4") + } + return check.That(data.ResourceName).Key("version").HasValue("~3") + }(), 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(),