How to target Azure Functions runtime versions
A function app runs on a specific version of the Azure Functions runtime. There are two major versions: 1.x and 2.x. This article explains how to choose which major version to use and how to configure a function app in Azure to run on the version you choose. For information about how to configure a local development environment for a specific version, see Code and test Azure Functions locally.
Differences between runtime 1.x and 2.x
Runtime 1.x is the only version approved for production use.
|1.x||Generally Available (GA)|
The following sections explain differences in languages, bindings, and cross-platform development support.
The following table indicates which programming languages are supported in each runtime version.
|Batch (.cmd, .bat)||Experimental|
For information about planned changes to language support, see Azure roadmap.
For more information, see Supported languages.
The experimental bindings that runtime 1.x supports are not available in 2.x. For information about bindings support and other functional gaps in 2.x, see Runtime 2.0 known issues.
Runtime 1.x supports function development only in the portal or on Windows; with 2.x you can develop and run Azure Functions on Linux or macOS.
Automatic and manual version updates
Functions lets you target a specific version of the runtime by using the
FUNCTIONS_EXTENSION_VERSION application setting in a function app. The function app is kept on the specified major version until you explicitly choose to move to a new version.
If you specify only the major version ("~1" for 1.x or "beta" for 2.x), the function app is automatically updated to new minor versions of the runtime when they become available. New minor versions do not introduce breaking changes. If you specify a minor version (for example, "1.0.11360"), the function app is kept on that version until you explicitly change it.
When a new version is publicly available, a prompt in the portal gives you the chance to move up to that version. After moving to a new version, you can always use the
FUNCTIONS_EXTENSION_VERSION application setting to move back to a previous version.
A change to the runtime version causes a function app to restart.
The values you can set in the
FUNCTIONS_EXTENSION_VERSION app setting to enable automatic updates are currently "~1" for the 1.x runtime and "beta" for 2.x.
View the current runtime version
Use the following procedure to view the runtime version currently used by a function app.
In the Azure portal, navigate to the function app, and under Configured Features, choose Function app settings.
In the Function app settings tab, locate the Runtime version. Note the specific runtime version and the requested major version. In the example below, the FUNCTIONS_EXTENSION_VERSION app setting is set to
Target the version 2.0 runtime
Azure Functions runtime 2.0 is in preview and currently not all features of Azure Functions are supported. For more information, see Differences between runtime 1.x and 2.x earlier in this article.
You can move a function app to the runtime version 2.0 preview in the Azure portal. In the Function app settings tab, choose beta under Runtime version.
This setting is equivalent to setting the
FUNCTIONS_EXTENSION_VERSION application setting to
beta. Choose the ~1 button to move back to the current publicly supported major version. You can also use the Azure CLI to update this application setting.
Target a version using the portal
When you need to target a version other than the current major version or version 2.0, you must set the
FUNCTIONS_EXTENSION_VERSION application setting.
In the Azure portal, navigate to your function app, and under Configured Features, choose Application settings.
In the Application settings tab, find the
FUNCTIONS_EXTENSION_VERSIONsetting and change the value to a valid version of the 1.x runtime or
betafor version 2.0.
Click Save to save the application setting update.
Target a version using Azure CLI
You can also set the
FUNCTIONS_EXTENSION_VERSION from the Azure CLI. Using the Azure CLI, update the application setting in the function app with the az functionapp config appsettings set command.
az functionapp config appsettings set --name <function_app> \ --resource-group <my_resource_group> \ --settings FUNCTIONS_EXTENSION_VERSION=<version>
In this code, replace
<function_app> with the name of your function app. Also replace
<my_resource_group> with the name of the resource group for your function app. Replace
<version> with a valid version of the 1.x runtime or
beta for version 2.0.
You can run this command from the Azure Cloud Shell by choosing Try it in the preceding code sample. You can also use the Azure CLI locally to execute this command after executing az login to sign in.