Skip to content

Commit

Permalink
azurerm_linux_function_app - fix filtering of app_settings for `WEB…
Browse files Browse the repository at this point in the history
…SITE_CONTENTSHARE` and `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING` (#14815)
  • Loading branch information
jackofallops authored Jan 6, 2022
1 parent fa08dfb commit 2547b7f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/services/appservice/linux_function_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (r LinuxFunctionAppResource) Read() sdk.ResourceFunc {
}
state.SiteConfig = []helpers.SiteConfigLinuxFunctionApp{*siteConfig}

state.unpackLinuxFunctionAppSettings(appSettingsResp)
state.unpackLinuxFunctionAppSettings(appSettingsResp, metadata)

state.ConnectionStrings = helpers.FlattenConnectionStrings(connectionStrings)

Expand Down Expand Up @@ -815,7 +815,7 @@ func (r LinuxFunctionAppResource) CustomizeDiff() sdk.ResourceFunc {
}
}

func (m *LinuxFunctionAppModel) unpackLinuxFunctionAppSettings(input web.StringDictionary) {
func (m *LinuxFunctionAppModel) unpackLinuxFunctionAppSettings(input web.StringDictionary, metadata sdk.ResourceMetaData) {
if input.Properties == nil {
return
}
Expand All @@ -831,7 +831,13 @@ func (m *LinuxFunctionAppModel) unpackLinuxFunctionAppSettings(input web.StringD

case "WEBSITE_NODE_DEFAULT_VERSION": // Note - This is only set if it's not the default of 12, but we collect it from LinuxFxVersion so can discard it here
case "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING":
if _, ok := metadata.ResourceData.GetOk("app_settings.WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"); ok {
appSettings[k] = utils.NormalizeNilableString(v)
}
case "WEBSITE_CONTENTSHARE":
if _, ok := metadata.ResourceData.GetOk("app_settings.WEBSITE_CONTENTSHARE"); ok {
appSettings[k] = utils.NormalizeNilableString(v)
}
case "WEBSITE_HTTPLOGGING_RETENTION_DAYS":
case "FUNCTIONS_WORKER_RUNTIME":
if m.SiteConfig[0].ApplicationStack != nil {
Expand All @@ -847,7 +853,7 @@ func (m *LinuxFunctionAppModel) unpackLinuxFunctionAppSettings(input web.StringD
case "DOCKER_REGISTRY_SERVER_PASSWORD":
dockerSettings.RegistryPassword = utils.NormalizeNilableString(v)

case "WEBSITES_ENABLE_APP_SERVICE_STORAGE": // TODO - Support this as a configurable bool, default `false` - Ref: https://docs.microsoft.com/en-us/azure/app-service/faq-app-service-linux#i-m-using-my-own-custom-container--i-want-the-platform-to-mount-an-smb-share-to-the---home---directory-
// case "WEBSITES_ENABLE_APP_SERVICE_STORAGE": // TODO - Support this as a configurable bool, default `false` - Ref: https://docs.microsoft.com/en-us/azure/app-service/faq-app-service-linux#i-m-using-my-own-custom-container--i-want-the-platform-to-mount-an-smb-share-to-the---home---directory-

case "APPINSIGHTS_INSTRUMENTATIONKEY":
m.SiteConfig[0].AppInsightsInstrumentationKey = utils.NormalizeNilableString(v)
Expand Down

0 comments on commit 2547b7f

Please sign in to comment.