Azure – How to… copy Function Apps

How to Azure – copy Function Apps on MS Azure

Once upon a time I was going to make a copy of an environment that had a lot of “Function Apps” in it. So I launched ‘ARM Template‘, which created App Service Plan and “Function Apps“. The Function Apps created were empty, with no function code inside, and had to be done separately.

Describe the 2 methods I used. However, keep in mind that Azure is constantly changing and the blog tips may become obsolete after some time.

First you need to download zip files with function files. You can do it via portal.azure.com by searching for a function and in the “Overview” tab select “Download app content” and download “Site content” without any application settings.

Azure App Service plans
Azure App Service plans - apps
Azure App Service plans - download app

Once you have your zips with functions, you need to edit the function.json file. From the function directory and remove the “generatedBy” entry: “Microsoft.NET.Sdk.Functions-1.0.0.0”, otherwise you will have a read-only function.

1. Dodawanie funkcji przez GUI:

Now it’s time to add the downloaded features to the new environment. Log in to portal.azure.com, find your feature, click on the “Platform features” tab and select “Advanced tools (Kudu)“.

Azure App Functions
Azure App Functions - KUDU

A new tab will open, select “Debug console / CMD“, and to the “D: \home\site\wwwroot” directory, upload the contents of the zip you downloaded earlier.

Azure App Functions - KUDU - cmd

2. Adding Functions Using CLI:

Run command prompt and login to azure. Make sure you have a good subscription, if not, choose the correct one:

az login
az account set --subscription SUBSCRIPTION_NAME)

Run this command for all functionapp specifying the appropriate group, application name and zip location as in the example:

az functionapp deployment source config-zip -g GROUP_NAME -n APPFUNCTION_NAME --src 'C:\LOCALIZATION\PACZKA.zip'

Documentation on Function Apps can be found on the microsoft website at https://docs.microsoft.com/en-us/azure/azure-functions/

If you liked the article "Azure - copy Function Apps" and would like more, you can find the rest of Microsoft Azure articles in the Azure_en category https://lepczynski.it/en/category/azure_en/.
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *