How an Azure Functions app can be copied?

I have an Azure Functions app working for development purposes, using a Table Storage account with test data. Now I want to have a separate environment (same Functions app with different storage config/conn-string) for production.

So, how can I "copy" my Azure Functions App in order to avoid manual recreation of it in the Azure portal?

Upvotes: 8

Views: 12759

Answers (3)

juntunen
juntunen

Reputation: 217

By using the Azure Functions CLI, you can just copy a directory, then publish using func azure functionapp publish

Source: https://learn.microsoft.com/en-us/answers/questions/123779/azure-clone-a-function.html

Upvotes: 0

Fabio Cavalcante
Fabio Cavalcante

Reputation: 12538

There are a couple of ways you can move the content from one Function App to another. The simplest is to copy the contents of your wwwroot folder to the other environment, which you can do by using Kudu, FTP, etc.

Another way that is often simpler and less error prone is to setup CI/CD so that different branches will trigger deployments to different environments. You can learn more about the continuous deployment options here.

Upvotes: 6

4c74356b41
4c74356b41

Reputation: 72171

  1. Stop Azure Function
  2. Open up the browser, navigate to https://{functionName}.scm.azurewebsites.net/DebugConsole
  3. Navigate to site/wwwroot
  4. Create a new folder (which would represent your new functions) and copy the contents of your function app (which is one of the folder in this directory) into that folder. Folder names = Function Names
  5. Start Azure Function

Upvotes: 2

Related Questions