Azure Functions are open-source, and the v2 of the runtime is using Docker for it deployment. The team released native support for deployment to Kubernetes (wherever it’s deployed) and Service Fabric. You can watch Mark Russinovich demo it on YouTube.

Pre-requisites:

Start by creating a new function project (or use an existing one with runtime v2). In a new directory:

func init --docker

Then create a function (or use an existing one):

func new

Edit the function as you want. Then deploy using the following command:

func deploy --platform kubernetes --registry [URL TO DOCKER IMAGE FOR THIS FUNCTION] --name [FUNCTION NAME]

Other supported parameters are:

  • min and max for the number of instances of that function
  • config pointing to a configuration folder