From 8ceea6fa7b16c266c03ac05a76832859ec77f6c4 Mon Sep 17 00:00:00 2001 From: Apokalypt <58733915+Apokalypt@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:15:46 +0200 Subject: [PATCH 1/2] fix(linux_web_app_*): Set "AlwaysOn" property on update --- internal/services/appservice/helpers/linux_web_app_schema.go | 1 + internal/services/appservice/helpers/web_app_slot_schema.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/services/appservice/helpers/linux_web_app_schema.go b/internal/services/appservice/helpers/linux_web_app_schema.go index 3e57ebc42377..102e8c09946a 100644 --- a/internal/services/appservice/helpers/linux_web_app_schema.go +++ b/internal/services/appservice/helpers/linux_web_app_schema.go @@ -888,6 +888,7 @@ func (s *SiteConfigLinux) ExpandForCreate(appSettings map[string]string) (*webap func (s *SiteConfigLinux) ExpandForUpdate(metadata sdk.ResourceMetaData, existing *webapps.SiteConfig, appSettings map[string]string) (*webapps.SiteConfig, error) { expanded := *existing + expanded.AlwaysOn = pointer.To(s.AlwaysOn) expanded.AcrUseManagedIdentityCreds = pointer.To(s.UseManagedIdentityACR) expanded.AutoHealEnabled = pointer.To(s.AutoHeal) expanded.HTTP20Enabled = pointer.To(s.Http2Enabled) diff --git a/internal/services/appservice/helpers/web_app_slot_schema.go b/internal/services/appservice/helpers/web_app_slot_schema.go index d74bfee62789..c9124da50930 100644 --- a/internal/services/appservice/helpers/web_app_slot_schema.go +++ b/internal/services/appservice/helpers/web_app_slot_schema.go @@ -678,6 +678,7 @@ func (s *SiteConfigLinuxWebAppSlot) ExpandForCreate(appSettings map[string]strin func (s *SiteConfigLinuxWebAppSlot) ExpandForUpdate(metadata sdk.ResourceMetaData, existing *webapps.SiteConfig, appSettings map[string]string) (*webapps.SiteConfig, error) { expanded := *existing + expanded.AlwaysOn = pointer.To(s.AlwaysOn) expanded.AcrUseManagedIdentityCreds = pointer.To(s.UseManagedIdentityACR) expanded.AutoHealEnabled = pointer.To(s.AutoHeal) expanded.HTTP20Enabled = pointer.To(s.Http2Enabled) From 495b4b1b0da1ed853207928af8e0c0c99ba36246 Mon Sep 17 00:00:00 2001 From: Apokalypt <58733915+Apokalypt@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:15:57 +0200 Subject: [PATCH 2/2] tests(linux_web_app_*): Validate "AlwaysOn" property on update --- internal/services/appservice/linux_web_app_resource_test.go | 1 + internal/services/appservice/linux_web_app_slot_resource_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/services/appservice/linux_web_app_resource_test.go b/internal/services/appservice/linux_web_app_resource_test.go index daf4f419b006..dc5c2ae7c7d6 100644 --- a/internal/services/appservice/linux_web_app_resource_test.go +++ b/internal/services/appservice/linux_web_app_resource_test.go @@ -81,6 +81,7 @@ func TestAccLinuxWebApp_completeUpdated(t *testing.T) { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("site_config.0.always_on").HasValue("true"), ), }, data.ImportStep("site_credential.0.password"), diff --git a/internal/services/appservice/linux_web_app_slot_resource_test.go b/internal/services/appservice/linux_web_app_slot_resource_test.go index d13e01a88b6e..8aa5f949af0e 100644 --- a/internal/services/appservice/linux_web_app_slot_resource_test.go +++ b/internal/services/appservice/linux_web_app_slot_resource_test.go @@ -159,6 +159,7 @@ func TestAccLinuxWebAppSlot_completeUpdate(t *testing.T) { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("site_config.0.always_on").HasValue("true"), ), }, data.ImportStep("site_credential.0.password"),