7
votes

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?

3

3 Answers

6
votes

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.

2
votes
  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
0
votes

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

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