Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows function apps (and slots) on standard plans #13218

Closed
wants to merge 1 commit into from

Conversation

literatesnow
Copy link
Contributor

The settings WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE are required for windows function apps on Standard plans.

Fixes issue #13135

Related PR #12553 (function app on premium plans)
Related PR #12778 (function app slots on premium plans)

…UREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE settings.
@shibayan
Copy link
Contributor

shibayan commented Sep 6, 2021

This condition should not be added. If WEBSITE_CONTENTAZUREFILECONNECTIONSTRING is added to a Function App that is already running, the deployed application will be lost. I have confirmed that when I apply changes using v2.76.0 to resources created using v2.66.0, applications deployed to Premium V2 are lost.

I deployed from Azure Portal for all Azure Functions platform combinations and checked if WEBSITE_CONTENTAZUREFILECONNECTIONSTRING exists. ⭕ means that it existed.

  • Windows
    • ⭕ Consumption
    • ⭕ Premium Plan (Elastic Premium)
    • ❌ App Service Plan (Standard / Premium v2, v3)
  • Linux
    • ❌ Consumption
    • ⭕ Premium Plan (Elastic Premium)
    • ❌ App Service Plan (Standard / Premium v2, v3)

The documentation states that it only supports Consumption Plan and Premium Plan (not Premium v2/v3) for Windows, but in fact it was also used for Premium Plan for Linux.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring

@shibayan
Copy link
Contributor

shibayan commented Sep 6, 2021

It seems that #12553 and #12778 already contain changes that may cause you to lose existing applications that use Premium v1/v2/v3. Fortunately, the changes will not be reflected unless you change the App Settings, but I would like to recommend that you make the conditions consistent with when you created it from the Azure Portal.

@literatesnow
Copy link
Contributor Author

literatesnow commented Sep 7, 2021

You're right, the docs for WEBSITE_CONTENTAZUREFILECONNECTIONSTRING says "where the function app code and configuration are stored in event-driven scaling plans running on Windows" which is key for the next sentence "Only used when deploying to a Premium plan or to a Consumption plan running on Windows".

Therefore, Elastic Premium (EP) requires WEBSITE_CONTENTAZUREFILECONNECTIONSTRING which is different to the dedicated hosting Premium (P) plans that does not require it.

My function apps had WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and when they were moved to the non-elastic Premium P3V1 plan, Terraform was removing the app setting causing them not to load. I unfortunately missed the difference of elastic premium vs non-elastic premium in PR's #12553 / #12778.

Logic should be:

  • Add WEBSITE_CONTENTAZUREFILECONNECTIONSTRING for Elastic Premium/Consumption if it doesn't exist (as per table above)
  • All other plan types, if WEBSITE_CONTENTAZUREFILECONNECTIONSTRING exists, don't remove it (which will allow apps that move between plan types to still start)

I'll circle back on this PR and fix the logic when I can.

Thanks for taking the time @shibayan.

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants