Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Azure Functions on Linux Preview
Access the Azure Functions Linux Consumption preview
Anyone can access the preview without requiring a sign-up step.
For the first 60 days the Azure Functions Linux Consumption preview is free of charge for your serverless hosting.
Azure Functions Linux Consumption preview overview
The Azure Functions Linux Consumption preview is enabled by the cross-platform Functions runtime 2.0 and by Service Fabric Mesh. Linux and Mac based development can translate seamlessly to Linux serverless hosting in the cloud with the same excellent development experience Azure Functions is famous for.
The Linux Consumption hosting model is an early preview and would greatly benefit from your feedback. Please share feedback and issues via our GitHub repos or the email alias listed above for preview access. A list of known issues is available here. Please note during the early preview timeframe scale for a function app is limited to 2 instances.
The following georegions are available for the Azure Functions Linux Consumption preview:
- West US
- East US
- West Europe
- East Asia
The Azure Functions Linux Consumption preview supports Python preview functions. You can follow the Python preview instructions to create functions locally. You can create Azure Functions resources in the cloud and deploy the functions developed locally using the instructions below.
To build and test locally:
Install the latest version of Azure Core Tools
Follow Python preview instructions to develop Python functions in your local development environment.
To publish and run in Azure:
Install the Azure CLI version 2.x or later.
az login az account set -s 'subscription name or ID' az extension add --source <path to the Azure CLI extension whl file saved locally> # If you had already have an older version of the extension you can check by doing az extension list # Current version is 0.0.2. To update do az extension remove -n functionapp az extension add --source <path to the Azure CLI extension whl file saved locally>
Install the last Visual Studio Code and the latest Visual Studio Code Azure Functions extension
Enable the Azure Functions Linux Consumption preview for VS Code via settings.json:
Create your Azure Functions Linux Consumption preview function app with the Azure CLI
Use the Azure CLI to create your first serverless function app running on Linux. The function app provides an environment for executing your function code. It lets you group functions as a logical unit for easier management, deployment, and sharing of resources.
Create Azure resources
Run the following commands using a unique function app name in place of the
<app_name> placeholder, the storage account name for
<storage_name>, and the
<resource_group> placeholder. The
<app_name> is also the default DNS domain for the function app. This name needs to be unique across all apps in Azure.
az group create -n <resource_group> -l "WestUS" az storage account create -n <storage_name> -l "WestUS" -g <resource_group> --sku Standard_LRS az functionapp createpreviewapp -n <app_name> -g <resource_group> -l "WestUS" -s <storage_name> --runtime <dotnet/node/python> --is-linux
[!NOTE] Use a new resource group. You can't host both Windows and Linux apps in the same resource group.
After the function app has been created, you will see the following message:
Your Linux, Consumption plan, function app <app_name> has been successfully created but is not active until content is published using Azure Portal or the Functions Core Tools.
You are now ready to publish your local functions project to the Function App in Azure. If you don't already have a local project follow Python preview instructions to develop Python functions in your local development environment.
Deploy the function app project to Azure
Using the Azure Functions Core Tools, run the following command. Replace
<app_name> with the name of your app from the previous step.
func azure functionapp publish <app_name>
You will see something like the following output, which has been truncated for readability.
Getting site publishing info... ... Preparing archive... Uploading content... Upload completed successfully. Deployment completed successfully. Syncing triggers...
Develop your Linux Consumption preview function app with Visual Studio Code
As noted in the prerequisites please enable the Azure Functions Linux Consumption preview for Visual Studio Code via settings.json:
Follow VS Code instructions here to create a new project from the Azure Functions extension, add functions, run locally, and publish from the Azure Functions extension.
Create a Linux Consumption preview function app in the Azure portal
Use the aka.ms/functions-consumptionlinux-portal link to access the Azure portal and activate the preview experience. As part of new serverless function app creation select Linux as the hosting platform and also select the Consumption option. For the early preview timeframe you will not be able to edit functions in the Azure Portal. Develop locally and deploy to the cloud via Azure Core Tools or Visual Studio Code as described in the previous sections.