How to automatically backup App Service & Function App configurations?

Reid Moffat 0 Reputation points
2023-06-19T20:26:32.6266667+00:00

My team has many app services and function apps, and we've had issues with configuration files being edited incorrectly before, so I'd like to create regular backups of the config files - both the Web.config file in Kudu for app services, and the json file for each Function app (application settings + connection strings).

How would I go about doing this? I had two potential ideas, but don't know how to get either of them to work:

  1. In azure, do automatic backups when there is a change (or at regular intervals) - couldn't find any backup option?
  2. Within my .net code, connect to Kudu to upload a backup file from my api/funcapp directly - could just find how to manually upload file to kudu, I want my code to do it automatically?

Any other option that works is welcome also!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,934 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andriy Bilous 11,821 Reputation points MVP Volunteer Moderator
    2023-06-20T04:38:51.57+00:00

    Hello @Reid Moffat

    In Azure App Service, you can easily restore app backups. You can also make on-demand custom backups or configure scheduled custom backups. You can restore a backup by overwriting an existing app by restoring to a new app or slot. This article shows you how to restore a backup and make custom backups.

    Back up and restore are supported in Basic, Standard, Premium, and Isolated tiers. For Basic tier, only the production slot can be backed up and restored.

    Azure functions deployed to consumption and premium plans don't provide access to custom and automatic backups. Function app's content is in an Azure storage account. Use Azure Storage redundancy options to ensure your storage account meets its availability and durability targets during an outage.

    https://learn.microsoft.com/en-us/azure/app-service/manage-backup?tabs=portal

    Another approach for backing up Azure App Service and Azure Functions is using Infrastructure as Code approach with such tools as Terraform, Bicep or ARM templates

    0 comments No comments

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.