Skip to content

Commit

Permalink
Fix windows function apps on premium plans (#12553)
Browse files Browse the repository at this point in the history
The settings WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE are required for windows function apps on Premium V1/V2/V3 plans. Currently Terraform removes these settings when functions are hosted on premium plans rendering the function useless as it can't find its code.

This PR checks for the prefix of premium to handle the case when further premium plans are released.

Ref: docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring
Ref: docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentshare
  • Loading branch information
literatesnow authored Jul 12, 2021
1 parent a04f4b5 commit 30dda4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azurerm/internal/services/web/function_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func getBasicFunctionAppAppSettings(d *pluginsdk.ResourceData, appServiceTier, e

// On consumption and premium plans include WEBSITE_CONTENT components, unless it's a Linux consumption plan
// (see https://github.com/Azure/azure-functions-python-worker/issues/598)
if (strings.EqualFold(appServiceTier, "dynamic") || strings.EqualFold(appServiceTier, "elasticpremium")) &&
if (strings.EqualFold(appServiceTier, "dynamic") || strings.EqualFold(appServiceTier, "elasticpremium") || strings.HasPrefix(strings.ToLower(appServiceTier), "premium")) &&
!strings.EqualFold(d.Get("os_type").(string), "linux") {
return append(basicSettings, consumptionSettings...), nil
}
Expand Down

0 comments on commit 30dda4d

Please sign in to comment.