Search code examples
azureazure-functionsazure-resource-managerazure-marketplace

How to deploy Azure Function app including code using ARM template from Azure marketplace


I want to deploy a Function App including code using an ARM template that is going to be published in the Azure Marketplace as a Managed App.

I've seen in the docs that you can add a sourcecontrols element in the ARM template that you can use to point to e.g. a GitHub repository. However, I don't want to use a repository, I want to code to be uploaded to the Function App.

I also know you can upload the code using the Azure CLI or powershell, however this will not be possible when publishing the app in the marketplace.

Is there a way to have a package that contains everything including the code and have that uploaded to the Function App all using an ARM template in the Azure Marketplace?


Solution

  • You should take a look at Run-From-Zip. Basically, you host the zip package somewhere (typically storage blob), and in ARM template you just set a WEBSITE_RUN_FROM_ZIP App Setting pointing to it.

    As an alternative, you could use the ARM msdeploy extension, and point it to the zip package (e.g. something like this).