Skip to content

Commit

Permalink
azurerm_linux_web_app + azurerm_linux_web_app_slot - Set ``si…
Browse files Browse the repository at this point in the history
…te_config.always_on`` as configured by the user during an update (hashicorp#25753)

* fix(linux_web_app_*): Set "AlwaysOn" property on update

* tests(linux_web_app_*): Validate "AlwaysOn" property on update
  • Loading branch information
Apokalypt authored and lonegunmanb committed Aug 5, 2024
1 parent e636cfb commit 7abe602
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,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"),
Expand Down

0 comments on commit 7abe602

Please sign in to comment.