Skip to content

Commit

Permalink
remove old node workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Jan 6, 2023
1 parent 4a08434 commit 51689c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/services/appservice/windows_web_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func (r WindowsWebAppResource) Read() sdk.ResourceFunc {
state.SiteConfig[0].ApplicationStack = make([]helpers.ApplicationStackWindows, 0)
}
state.SiteConfig[0].ApplicationStack[0].NodeVersion = nodeVer
delete(state.AppSettings, "WEBSITE_NODE_DEFAULT_VERSION") // TODO - Allow this to be set directly in app_settings?
delete(state.AppSettings, "WEBSITE_NODE_DEFAULT_VERSION")
}

// Zip Deploys are not retrievable, so attempt to get from config. This doesn't matter for imports as an unexpected value here could break the deployment.
Expand Down
10 changes: 4 additions & 6 deletions internal/services/appservice/windows_web_app_slot_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,11 @@ func (r WindowsWebAppSlotResource) Read() sdk.ResourceFunc {
state.SiteConfig = helpers.FlattenSiteConfigWindowsAppSlot(webAppSiteConfig.SiteConfig, currentStack, healthCheckCount)

if nodeVer, ok := state.AppSettings["WEBSITE_NODE_DEFAULT_VERSION"]; ok {
if nodeVer != "6.9.1" { // Slots appear to have an invalid value for this by default?
if state.SiteConfig[0].ApplicationStack == nil {
state.SiteConfig[0].ApplicationStack = make([]helpers.ApplicationStackWindows, 0)
}
state.SiteConfig[0].ApplicationStack[0].NodeVersion = nodeVer
if state.SiteConfig[0].ApplicationStack == nil {
state.SiteConfig[0].ApplicationStack = make([]helpers.ApplicationStackWindows, 0)
}
delete(state.AppSettings, "WEBSITE_NODE_DEFAULT_VERSION") // TODO - Allow this to be set directly in app_settings?
state.SiteConfig[0].ApplicationStack[0].NodeVersion = nodeVer
delete(state.AppSettings, "WEBSITE_NODE_DEFAULT_VERSION")
}

// Zip Deploys are not retrievable, so attempt to get from config. This doesn't matter for imports as an unexpected value here could break the deployment.
Expand Down

0 comments on commit 51689c0

Please sign in to comment.