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.
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-220.127.116.11”, 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)“.
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.
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/.