Best Practices for Seamless Redeployment of Azure Function Apps without Downtime

AnMu 20 Reputation points
2025-03-07T16:26:58.3233333+00:00

Setup

I am currently working with IaC (Bicep) and among others use it to create FunctionApps. I create my storage account, function plan and function app together. I use the consumption plan in test environment. But the plan is to use FlexConsumption for prod. The functions itself are HTTP triggered and deployed separately (with the func azure functionapp publish command. We are currently thinking about concepts for Continuous deployments (there is no production environment yet).

Problem

Whenever I redeploy my Function App service (even though nothing has changed in it), the functions I published are deleted.

Questions

  • What would be the best practices for seamless deployments on production level without downtime?
  • I assume the solution involves deployment slots. However, what are the best practices for settings then?
  • Do I use almost no settings in the function App itself, never update that App from IaC again and only change settings on the deployment slots?
  • Do i separate Settings from the App as much as I can?

Thanks in advance!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,526 questions
{count} votes

Accepted answer
  1. Ranashekar Guda 815 Reputation points Microsoft External Staff
    2025-03-07T17:37:55.61+00:00

    Hi @Andrea Müller,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    To achieve seamless deployments of Azure Function Apps without downtime, consider the following best practices:

    Utilize Deployment Slots: Deployment slots enable you to deploy various versions of your code to separate endpoints. This feature allows you to test changes in a staging environment prior to moving them into production. By doing so, you reduce downtime and facilitate rapid rollbacks if needed.

    Manage Application Settings: When utilizing deployment slots, certain application settings are classified as "sticky" meaning they stay associated with the slot rather than being swapped with the code. You can designate these settings as slot-specific by adding "slotSetting": true in your application setting definitions. This enables you to preserve distinct configurations for each slot.

    Limit Changes to the Function App: It is recommended to limit changes to the Function App through Infrastructure as Code (IaC). Instead, prioritize adjusting settings at the deployment slot level. This strategy helps avoid the deletion of functions during redeployment.

    Separate Settings from the App: As much as possible, separate your settings from the Function App. This allows you to update configurations without redeploying the entire app, thus reducing the risk of losing functions or other critical configurations.

    For further clarification, please refer to the following documentations:

    I hope this information helps you understand and resolve your issue. If you have any further concerns, please feel free to reach out.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.