Building Compiled Isolated Process Azure Functions
Explore how to build compiled isolated process Azure Functions in .NET. Understand configuring function triggers, using dependency injection, setting up startup logic, and running HTTP-triggered functions. Gain hands-on knowledge of managing independent Azure Functions with modular dependencies.
An isolated process function app represents a fully independent application. Even though it is still triggered by an Azure Functions host, it acts as an independent application. This is why it contains components associated with a typical stand-alone .NET application, such as the Program.cs file that acts as an entry point, constructor-based dependency injections, and other features unavailable with other function types.
The below project contains an example of an in-process function app. This project represents a simple function with the HTTP trigger and basic chatbot functionality. We can trigger it by sending either a GET or POST HTTP request to it. If we don’t send any data in the request, it returns a response asking for our name. If we send the name either in the name query string parameter or the name field of the request body, the function returns the response that greets us by the name.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.12" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0-preview2" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
</ItemGroup>
</Project>Setting up an isolated process function
An isolated process function is based on the Microsoft.Azure.Functions.Worker NuGet ...