Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In Azure Functions, support for a language stack is limited to specific versions. As new versions become available, you might want to update your function apps to take advantage of new features. Support in Functions also ends for older versions and typically aligns with community end-of-support timelines. For more information, see the language runtime support policy. For supported versions of various languages, see Languages by runtime version.
To help ensure your function apps continue to receive support, follow the instructions in this article to update them to the latest available versions. The way that you update your function app depends on several factors:
- The language you use to develop your function apps. Make sure to select your programming language at the top of this article.
- The operating system on which your function app runs in Azure: Windows or Linux.
- The hosting plan.
Note
This article shows you how to update the .NET version of a function app that uses the isolated worker model. If your function app runs on an older version of .NET and uses the in-process model, consider the following options:
Prepare your function app
Before you update the stack configuration for your function app in Azure, complete the tasks in the following sections.
Review dependencies
Before updating language versions, review these potential dependencies:
- Extension bundles: Verify that your
host.jsonfile references a compatible extension bundle version. Version 4.x bundles are recommended for most scenarios.
Binding extensions: Update any explicit binding extension references to versions compatible with your new language version.
Package dependencies: Review and update all package dependencies to versions that support your target language version.
Local tools: Ensure your local development tools, such as Azure Functions Core Tools, SDKs, and IDEs, support the new language version.
Verify your function app locally
Test and verify your function app code locally on the new target version.
Use these steps to update the project on your local computer:
Ensure that the target version of the .NET SDK is installed.
If you're targeting a preview version, see Functions guidance for preview .NET versions to ensure that the version is supported. Using .NET previews might require more steps.
Update your references to the latest versions of Microsoft.Azure.Functions.Worker and Microsoft.Azure.Functions.Worker.Sdk.
Update your project's target framework to the new version. For C# projects, you must update the
<TargetFramework>element in the .csproj file. For more information about your version, see Target frameworks.Changing your project's target framework might also require changes to parts of your toolchain, outside project code. For example, in Visual Studio Code, you might need to update the
azureFunctions.deploySubpathextension setting in your user settings or your project's .vscode/settings.json file. Check for any dependencies on the framework version that exist outside your project code, as part of build steps or a continuous integration and continuous delivery (CI/CD) pipeline.Make any updates to your project code that the new .NET version requires. Check the version's release notes for specific information. You can also use the .NET Upgrade Assistant to help update your code in response to changes across major versions.
After you make those changes, rebuild your project and test it to confirm your function app runs as expected.
Move to the latest Functions runtime
Make sure your function app runs on the latest version of the Functions runtime (version 4.x). You can determine the runtime version either in the Azure portal or by using the Azure CLI.
Use these steps to determine your Functions runtime version:
In the Azure portal, locate and select your function app. On the side menu, select Settings > Configuration.
Go to the Function runtime settings tab and check the Runtime version value. Your function app should run on version 4.x of the Functions runtime (
~4).
If you need to update your function app to version 4.x, see Migrate apps from Azure Functions version 1.x to version 4.x or Migrate apps from Azure Functions version 3.x to version 4.x. Follow the instructions in those articles rather than just changing the FUNCTIONS_EXTENSION_VERSION setting.
Publish function app updates
If you updated your function app to run correctly on the new version, publish the function app updates before you update the stack configuration for your function app.
Tip
To streamline the update process, minimize downtime for your function apps, and provide a potential version for rollback, publish your updated function app to a staging slot. For more information, see Azure Functions deployment slots.
When you publish your updated function app to a staging slot, make sure to follow the slot-specific update instructions in the rest of this article. You later swap the updated staging slot into production.
Consider using slots
Before updating your function app's language version, create a deployment slot to use for testing and deployment. This approach minimizes downtime and provides an easy rollback option if issues occur. The examples in this article use a staging slot named staging.
Flex Consumption plan: Slots aren't currently supported. You should first verify your updated code in a non-production function app. When deploying to a running app, you might be able to use the rolling update strategy. For more information, see Site update strategies in Flex Consumption.
Important
The rolling update strategy is currently in preview and isn't recommended for production apps. Review the current limitations and considerations before enabling this strategy in any production app.
Update the stack configuration
The way that you update the stack configuration depends on whether your function app runs on Windows or on Linux in Azure.
When you use a staging slot, make sure to target your updates to the correct slot.
Use the following steps to update the Java version:
In the Azure portal, locate and select your function app. On the side menu, select Settings > Configuration. If you have a staging slot, select the specific slot.
On the General settings tab, update Java Version to the desired version.
Select Save. When you're notified about a restart, select Continue.
Use the following steps to update the .NET version:
In the Azure portal, locate and select your function app. On the side menu, select Settings > Configuration. If you have a staging slot, select the specific slot.
On the General settings tab, update .NET Version to the desired version.
Select Save. When you're notified about a restart, select Continue.
Use the following steps to update the Node.js version:
In the Azure portal, locate and select your function app. On the side menu, select Settings > Configuration. If you have a staging slot, select the specific slot.
On the General settings tab, update Node.js Version to the desired version.
Select Save. When you're notified about a restart, select Continue. This change updates the
WEBSITE_NODE_DEFAULT_VERSIONapplication setting.
Use the following steps to update the PowerShell version:
In the Azure portal, locate and select your function app. On the side menu, select Settings > Configuration. If you have a staging slot, select the specific slot.
On the General settings tab, update PowerShell Core Version to the desired version.
Select Save. When you're notified about a restart, select Continue.
The portal doesn't support Python apps on Windows. Go to the Linux tab instead.
Your function app restarts after you update the version.
Note
During the restart, your function app is unavailable for a brief period, typically 30-60 seconds. If you update a production function app directly (without using a staging slot), plan for this downtime during a maintenance window. The restart terminates any in-flight requests, and new requests fail until the app restarts successfully.
Verify the update
After your function app restarts, verify that the language version update was successful.
In the Azure portal, locate and select your function app. On the side menu, select Settings > Configuration.
On the General settings tab, verify that the language version displays the new version you selected.
Select Overview on the side menu and confirm that the Status shows as Running.
After verifying the version, also verify that your functions work as expected.
Swap slots
If you use a staging slot to deploy your code project and update your settings, swap the staging slot into production. For more information, see Swap slots.
Troubleshooting
If you experience issues after updating the language version, use the following guidance to resolve common problems:
Function app doesn't start
Symptoms: The function app status shows as Stopped or continuously restarts.
Solutions:
Check the application logs in the Azure portal:
- Navigate to your function app and select Monitoring > Log stream.
- Look for error messages related to runtime or language version mismatches.
Verify that all dependencies are compatible with the new language version:
- For .NET, ensure NuGet packages support the target framework.
- For Python, check that package versions in
requirements.txtare compatible. - For Node.js, verify
package.jsondependencies support the new Node version.
Check the extension bundle version in your
host.jsonfile. Older bundles might not support newer language versions.
Functions fail with runtime errors
Symptoms: Individual functions fail when triggered, with errors in the logs.
Solutions:
Review breaking changes for your language version:
- See Breaking changes in .NET for your target version.
- Review Java release notes for migration guidance.
- Check Node.js release notes for breaking changes.
- See What's new in Python for version-specific changes.
- Review PowerShell release notes for changes.
Update binding extensions to versions compatible with your new language version.
Test functions locally with the new language version before redeploying.
Extension version conflicts
Symptoms: Errors that mention "extension" or "binding" version incompatibilities.
Solutions:
Update the extension bundle version in
host.jsonto version 4.x or later.{ "version": "2.0", "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", "version": "[4.*, 5.0.0)" } }For .NET projects that use explicit extension references, update all
Microsoft.Azure.WebJobs.Extensions.*packages to their latest versions.
Rolling back the update
If you need to revert to the previous language version:
If you used a staging slot:
- Swap the staging slot back to production.
- Update the staging slot back to the previous version for future attempts.
If you updated production directly:
- Follow the same update steps in this article but specify your previous language version.
- Redeploy your previous code version.
Monitor your function app to ensure it returns to normal operation.
Tip
To avoid issues, always test language version updates in a staging slot before applying them to production. Create a backup of your function app configuration before making changes.