Skip to content

Using LinuxFxVersion for Linux Function Apps

Varad Meru edited this page Aug 23, 2022 · 7 revisions

Linux function apps use the 'LinuxFxVersion' config field to specify the host or the language version property for the app.

Configuring Language Version

Linux function apps for all skus use the language and the language version specified in the 'LinuxFxVersion' config. The general format is "language|language version". For example: a node 12 linux function app will have it's linuxfxversion field set to "node|12". The language specified in the linuxfxversion must also match the worker runtime specified in the 'FUNCTIONS_WORKER_RUNTIME' app setting.

Upgrading the language version of an existing function app can be done by updating the linuxfxversion. For example: A python 3.7 function app with linuxfxversion 'python|3.7' can move to python 3.8 by updating their linuxfxversion to 'python|3.8'.

Configuring Host Version

When an app has LinuxFxVersion set in the 'language|language version' format specified above, it means that the app is set to the latest functions host version. If for any reason, a function app does not want to use the latest functions host version, then the app can be pinned to a particular host version. This is done by directly specifying the image URL in LinuxFxVersion field. For example: if we want to pin a node 10 function app to say host version 3.0.13142 -

For Linux app service/elastic premium apps -

Set LinuxFxVersion to 'DOCKER|mcr.microsoft.com/azure-functions/node:3.0.13142-node10-appservice' using Az CLI-

az functionapp config set \
 -g <resource_group> \
 -n <function_app_name> \
 --subscription <subscription_id> \
 --linux-fx-version "DOCKER|mcr.microsoft.com/azure-functions/node:4.8.0-python3.9-appservice"

For Linux consumption apps -

Set LinuxFxVersion to 'DOCKER|mcr.microsoft.com/azure-functions/mesh:3.0.13142-node10' using Az CLI-

az functionapp config set \
 -g <resource_group> \
 -n <function_app_name> \
 --subscription <subscription_id> \
 --linux-fx-version "DOCKER|mcr.microsoft.com/azure-functions/mesh:4.8.0-python3.9"

Note that setting linuxfxversion to image URL directly for consumption apps will opt them out of placeholders and other cold start optimizations. So apps should only be pinned to an older host version in case of a regression in the latest functions host version.

Learn

Azure Functions Basics

Advanced Concepts

Dotnet Functions

Java Functions

Node.js Functions

Python Functions

Host API's

Bindings

V2 Runtime

Contribute

Functions host

Language workers

Get Help

Other

Clone this wiki locally