.NET 5 support on Azure Functions

Published 12-10-2020 11:33 AM 31.6K Views
Microsoft

Update March 10, 2021

Azure Functions now supports .NET 5 in production. See the .NET Roadmap for Azure Functions for more details.

 

 

Since the first release of Azure Functions, .NET support has been tightly coupled to the Azure Functions runtime. While this tight integration enables features unique to .NET functions—such as rich binding types—it also means new releases of .NET can only be supported by updating the .NET version of the host.

 

.NET has adopted a support lifecycle policy that involves a yearly upgrade cycle, with even numbered versions designated as Long Term Support (LTS) releases. .NET 5 is the first Current (non-LTS) release under the new policy. The Azure Functions runtime is a critical component that powers on all of our customers’ production apps and our local development tooling. Because we’re sometimes required to support specific releases of the runtime for extended periods, we cannot upgrade it to a non-LTS version of .NET due to its short support timeline.

 

To enable .NET 5 in Azure Functions, we are moving to an out-of-process model that runs a .NET 5 worker process alongside the runtime. This is the same out-of-process model that all non-.NET Azure Functions languages have used successfully since Azure Functions V2.

 

The .NET 5 worker provides a similar Azure Functions programming model that you’re used to. At the same time, because it runs in a separate process, it allows you full control of your app’s dependencies without worrying about conflicts with the dependencies used by the runtime. The .NET 5 worker also introduces new features, such as a customizable middleware pipeline.

 

Starting today, you can access an early preview of the Azure Functions .NET 5 worker at this GitHub repository. You can run and debug .NET 5 function apps locally and deploy them to Azure using the Azure Functions Core Tools CLI. More tooling support, including Visual Studio and Visual Studio Code, will arrive in the coming weeks.

 

The .NET 5 worker will be generally available in early 2021.

 

We realize that customers who are early adopters of .NET 5 have been disappointed by the delay of .NET 5 in Azure Functions. Building a new language worker from scratch has taken some time. We understand your frustration and appreciate your patience. The investment to separate the .NET worker from the runtime will allow us to quickly support future .NET versions. We expect to support .NET 6 LTS as soon as it is released.

 

 

 

dotnet5 early preview cover 2.png

20 Comments
Occasional Visitor

Thank you @Anthony Chu - .NET 5 + middleware support will be a fantastic enhancement for functions.

Occasional Visitor

From the GitHub repository:

"One important difference with .NET 5 functions is that "rich bindings", such as Durable Functions or binding to SDK types like Cosmos DB client, are not supported."

 

Does this mean they'll never be supported or that they will be supported in a different way?

 

A lot of us have invested time and money in Durable Functions. Is this now dead ended???

@ericblI have the same thoughts.

Senior Member

@ericbl  I think the "rich-binding" limitation is only because of the "out-of-process" hosting model. So, the current set of features should be supported fine when Azure adds .NET 6 support with current in-process hosting model. Although, I'm not aware of any plans for that support in out-of-process model, at least not in .NET 5.

 
 
 
 

I understand there is a lot going on under the hood to make the pipeline scale and so on (Features of the Windows Process Activation Service (WAS) | Microsoft Docs)

 

Does the architecture ultimately create a new app domain? or am I being way to simplistic about how I'm thinking of "out of process"?

 

Tx.

Microsoft

@Scotty_Tarvan The functions host spins up a separate process for the worker that's running on .NET 5. The two communicate over a gRPC channel. This is how Azure Functions works for non-.NET languages today.

Occasional Visitor

If we write functions with .NET 5 and this worker, what's the migration process to refactor it to .NET 6 when it's available in Azure? Based on past migrations, I'm guessing it'll be worth waiting for .NET, though maybe it won't be such a pain as it was migrating from .NET Core 1.5 upwards?

Microsoft

@LloydGM As the worker is a NuGet package, you'll be able to update the .NET version when .NET 6 comes out, and stay on the out-of-process worker model.

 

For .NET 6, you'll have a choice between using the new out-of-process model and the current in-process model.

Occasional Visitor

@Anthony Chu do you have a date to make this generally available? Thanks!

Occasional Visitor

@Anthony Chu What will be the migration path be? If it's going to be a PITA like it was repeatedly upgrading through the various iterations of .NET Core, it's not worth it, and we're better off using something else until Azure catches up. (Seriously, my team alone wasted over 200 hours refactoring our dozen apps through the major Core iterations, and we will never go down that path again.)

Microsoft

@MauricioArroyo Should be any day now. Keep an eye on this blog, the worker repo, or Azure Updates for announcements.

 

@LloydGM If you're using .NET Core 3.1 on Functions, you do not have to migrate to the out-of-process worker right now. We'll be shipping in-process support for .NET 6 and the migration should be quite smooth.

 

If you choose to migrate to out-of-process, it does require some refactoring and there may be some functionality that you're using now that is not available yet. However, once you're migrated, the out-of-process worker is just a NuGet package. You're in control of when you upgrade to new versions of .NET or new versions of the worker package.

Occasional Visitor

@Anthony ChuHappy to hear that it should appear any day now. Keeping my fingers corssed. We are waiting for it as well quite heavily.

Occasional Visitor

Hi,
any news about the release date?

Thanks for help!

Microsoft

@ivan-pesenti Yes. Please take a look at this announcement for more information: https://techcommunity.microsoft.com/t5/apps-on-azure/net-on-azure-functions-roadmap/ba-p/2197916

 

I've also updated this post with a link to that. Thanks!

Frequent Visitor

Thanks for sharing ~

This is still not an option for visual studio users:
- manual upgrade of all startup DI and http/timer functions 

-no debug support in visual studio

-no deployment via azure pipelines

 

Tried to upgrade, read the articles, gave up after half a day and we only have about 200 functions. Large solutions may have thousands of functions. 

 

 

 

 

Occasional Visitor

@Scotty_Tarvan that's incorrect. There's debugging and there's azure deployments through the azure cli.

Occasional Visitor

The Isolated Az Function is like webjobs because it's a console app and it's hosted like an application (IMO, it's not serverless anymore). So what's the advantage of az function over webjob here?

Microsoft

@jamestran Event driven scaling and consumption pricing. The fact that the build output is an exe is an implementation detail. Your app scales the same way as .NET in process and other languages. There are also no changes in billing, you are still only billed when functions are executing.

Occasional Visitor

@Anthony Chu Is there a plan with .NET 5 functions to support Durable Functions? If so, when should this be available?

%3CLINGO-SUB%20id%3D%22lingo-sub-1973055%22%20slang%3D%22en-US%22%3E.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1973055%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3ESince%20the%20first%20version%20of%20Azure%20Functions%2C%20.NET%20support%20has%20been%20tightly%20coupled%20to%20the%20Azure%20Functions%20runtime.%20While%20this%20tight%20integration%20enables%20features%20unique%20to%20.NET%20functions%E2%80%94such%20as%20rich%20binding%20types%E2%80%94it%20also%20means%20new%20releases%20of%20.NET%20can%20only%20be%20supported%20by%20updating%20the%20.NET%20version%20of%20the%20host.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E.NET%20has%20adopted%20a%20%3CA%20href%3D%22https%3A%2F%2Fdotnet.microsoft.com%2Fplatform%2Fsupport%2Fpolicy%2Fdotnet-core%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esupport%20lifecycle%20policy%3C%2FA%3E%20that%20involves%20a%20yearly%20upgrade%20cycle%2C%20with%20even%20numbered%20versions%20designated%20as%20Long%20Term%20Support%20(LTS)%20releases.%20.NET%205%20is%20the%20first%20Current%20(non-LTS)%20release%20under%20the%20new%20policy.%20The%20Azure%20Functions%20runtime%20is%20a%20critical%20component%20that%20powers%20on%20all%20of%20our%20customers%E2%80%99%20production%20apps%20and%20our%20local%20development%20tooling.%20Because%20we%E2%80%99re%20sometimes%20required%20to%20support%20specific%20releases%20of%20the%20runtime%20for%20extended%20periods%2C%20we%20cannot%20upgrade%20it%20to%20a%20non-LTS%20version%20of%20.NET%20due%20to%20its%20short%20support%20timeline.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20enable%20.NET%205%20in%20Azure%20Functions%2C%20we%20are%20moving%20to%20an%20out-of-process%20model%20that%20runs%20a%20.NET%205%20worker%20process%20alongside%20the%20runtime.%20This%20is%20the%20same%20out-of-process%20model%20that%20all%20non-.NET%20Azure%20Functions%20languages%20have%20used%20successfully%20since%20Azure%20Functions%20V2.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20.NET%205%20worker%20provides%20a%20similar%20Azure%20Functions%20programming%20model%20that%20you%E2%80%99re%20used%20to.%20At%20the%20same%20time%2C%20because%20it%20runs%20in%20a%20separate%20process%2C%20it%20allows%20you%20full%20control%20of%20your%20app%E2%80%99s%20dependencies%20without%20worrying%20about%20conflicts%20with%20the%20host%20process.%20The%20.NET%205%20worker%20also%20introduces%20new%20features%2C%20such%20as%20a%20customizable%20middleware%20pipeline.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EStarting%20today%2C%20you%20can%20access%20an%20early%20preview%20of%20the%20Azure%20Functions%20.NET%205%20worker%20at%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-functions-dotnet-worker-preview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20GitHub%20repository%3C%2FA%3E.%20You%20can%20run%20and%20debug%20.NET%205%20function%20apps%20locally%20and%20deploy%20them%20to%20Azure%20using%20the%20Azure%20Functions%20Core%20Tools%20CLI.%20More%20tooling%20support%2C%20including%20Visual%20Studio%20and%20Visual%20Studio%20Code%2C%20will%20arrive%20in%20the%20coming%20weeks.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20.NET%205%20worker%20will%20be%20generally%20available%20in%20early%202021.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWe%20realize%20that%20customers%20who%20are%20early%20adopters%20of%20.NET%205%20have%20been%20disappointed%20by%20the%20delay%20of%20.NET%205%20in%20Azure%20Functions.%20Building%20a%20new%20language%20worker%20from%20scratch%20has%20taken%20some%20time.%20We%20understand%20your%20frustration%20and%20appreciate%20your%20patience.%20The%20investment%20to%20separate%20the%20.NET%20worker%20from%20the%20runtime%20will%20allow%20us%20to%20quickly%20support%20future%20.NET%20versions.%20We%20expect%20to%20support%20.NET%206%20LTS%20as%20soon%20as%20it%20is%20released.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1973055%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dotnet%205%20early%20preview%20cover.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F239186i55971B756C7D8249%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22dotnet%205%20early%20preview%20cover.png%22%20alt%3D%22dotnet%205%20early%20preview%20cover.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1973055%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.NET%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1978861%22%20slang%3D%22en-US%22%3ERe%3A%20.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1978861%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185703%22%20target%3D%22_blank%22%3E%40Anthony%20Chu%3C%2FA%3E%20-%20.NET%205%20%2B%20middleware%20support%20will%20be%20a%20fantastic%20enhancement%20for%20functions.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2046948%22%20slang%3D%22en-US%22%3ERe%3A%20.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2046948%22%20slang%3D%22en-US%22%3E%3CP%3EFrom%20the%20GitHub%20repository%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%22%3CSPAN%3EOne%20important%20difference%20with%20.NET%205%20functions%20is%20that%20%22rich%20bindings%22%2C%20such%20as%20Durable%20Functions%20or%20binding%20to%20SDK%20types%20like%20Cosmos%20DB%20client%2C%20are%20not%20supported.%3C%2FSPAN%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20this%20mean%20they'll%20never%20be%20supported%20or%20that%20they%20will%20be%20supported%20in%20a%20different%20way%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20lot%20of%20us%20have%20invested%20time%20and%20money%20in%20Durable%20Functions.%20Is%20this%20now%20dead%20ended%3F%3F%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2109938%22%20slang%3D%22en-US%22%3ERe%3A%20.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2109938%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F923944%22%20target%3D%22_blank%22%3E%40ericbl%3C%2FA%3E%26nbsp%3B%26nbsp%3BI%20think%20the%20%22rich-binding%22%20limitation%20is%20only%20because%20of%20the%20%22out-of-process%22%20hosting%20model.%20So%2C%20the%20current%20set%20of%20features%20should%20be%20supported%20fine%20when%20Azure%20adds%20.NET%206%20support%20with%20current%20in-process%20hosting%20model.%20Although%2C%20I'm%20not%20aware%20of%20any%20plans%20for%20that%20support%20in%20out-of-process%20model%2C%20at%20least%20not%20in%20.NET%205.%3C%2FP%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22ms-editor-squiggler%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2118414%22%20slang%3D%22en-US%22%3ERe%3A%20.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2118414%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F638237%22%20target%3D%22_blank%22%3E%40Scotty_Tarvan%3C%2FA%3E%26nbsp%3BThe%20functions%20host%20spins%20up%20a%20separate%20process%20for%20the%20worker%20that's%20running%20on%20.NET%205.%20The%20two%20communicate%20over%20a%20gRPC%20channel.%20This%20is%20how%20Azure%20Functions%20works%20for%20non-.NET%20languages%20today.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2160375%22%20slang%3D%22en-US%22%3ERe%3A%20.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2160375%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F976523%22%20target%3D%22_blank%22%3E%40LloydGM%3C%2FA%3E%26nbsp%3BAs%20the%20worker%20is%20a%20NuGet%20package%2C%20you'll%20be%20able%20to%20update%20the%20.NET%20version%20when%20.NET%206%20comes%20out%2C%20and%20stay%20on%20the%20out-of-process%20worker%20model.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20.NET%206%2C%20you'll%20have%20a%20choice%20between%20using%20the%20new%20out-of-process%20model%20and%20the%20current%20in-process%20model.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191696%22%20slang%3D%22en-US%22%3ERe%3A%20.NET%205%20support%20on%20Azure%20Functions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191696%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185703%22%20target%3D%22_blank%22%3E%40Anthony%20Chu%3C%2FA%3E%26nbsp%3BWhat%20will%20be%20the%20migration%20path%20be%3F%20If%20it's%20going%20to%20be%20a%20PITA%20like%20it%20was%20repeatedly%20upgrading%20through%20the%20various%20iterations%20of%20.NET%20Core%2C%20it's%20not%20worth%20it%2C%20and%20we're%20better%20off%20using%20something%20else%20until%20Azure%20catches%20up.%20(Seriously%2C%20my%20team%20alone%20wasted%20over%20200%20hours%20refactoring%20our%20dozen%20apps%20through%20the%20major%20Core%20iterations%2C%20and%20we%20will%20never%20go%20down%20that%20path%20again.)%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Mar 23 2021 10:02 AM
Updated by: