Create an Azure Function .NET in the isolated worker model
    • Dark
      Light
    • PDF

    Create an Azure Function .NET in the isolated worker model

    • Dark
      Light
    • PDF

    Article Summary

    #ServerlessTips - Azure Functions
    Author: Dave Rendon Microsoft MVP

    This article will review how to create your first Azure Function .Net isolated.

    Introduction

    The .NET Worker provides .NET 5 support in Azure Functions, introducing an Isolated Model, running as an out-of-process language worker separate from the Azure Functions runtime. It gives you complete control over your application's dependencies and new features like a middleware pipeline.

    A .NET, Isolated function app works differently than a .NET Core 3.1 function app. For .NET Isolated, you build an executable that imports the .NET Isolated language worker as a NuGet package. Your app includes a Program.cs that starts the worker.

    Prerequisites:

    1. Create a .NET Isolated project

    In your local machine, create an empty directory. Then, open VS Code in your new directory and open a new terminal. Then, run the following command to create a new Function project and select dotnet (Isolated Process)

    func init
    

    Picture128

    Picture227

    2. Add a function

    Now, run the command func new and select the HttpTrigger example:
    Picture322

    Then, provide a name for the function as shown below:
    Picture419

    After your function is created, you should see the following folder structure in your working space:
    Picture510

    Let's run the function locally and use the command below in the sample app directory.

    func host start
    

    Once you run the function, you should see the build output, as shown below.
    Picture66

    3. Testing your Azure Function

    You can navigate to and review the output in your browser:
    Picture74

    You can find more information in the following URL:

    https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?%20%3FWT.mc_id=AZ-MVP-5000671

    Conclusion

    Along this article, we have reviewed how you can get started with Azure Functions Isolated Model, running as an out-of-process language worker separate from the Azure Functions runtime.

    MicrosoftTeams-image 491


    Was this article helpful?