.NET Runtime¶
This reference covers runtime versions, worker configuration, target framework choices, and package dependencies for Azure Functions .NET apps.
Main Content¶
Supported runtimes and models¶
| Model | Supported .NET versions | Recommended for new apps |
|---|---|---|
| Isolated worker | .NET 10, .NET 9, .NET 8, .NET Framework 4.8.1 | Yes |
| In-process | .NET 8 only | No |
flowchart LR
A[.NET 8 LTS] --> B[Isolated worker]
C[.NET 9 STS] --> B
D[In-process] --> E[.NET 8 only] Required app settings¶
| Setting | Value | Purpose |
|---|---|---|
FUNCTIONS_WORKER_RUNTIME | dotnet-isolated | Selects isolated worker runtime |
FUNCTIONS_EXTENSION_VERSION | ~4 | Pins Functions runtime major version |
AzureWebJobsStorage | connection string or identity-based settings | Required host storage |
az functionapp config appsettings set --name "$APP_NAME" --resource-group "$RG" --settings "FUNCTIONS_WORKER_RUNTIME=dotnet-isolated" "FUNCTIONS_EXTENSION_VERSION=~4"
csproj baseline¶
Use net8.0 as the default target framework for production workloads:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.*" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.*" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.*" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.*" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.*" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.*" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.*" />
</ItemGroup>
</Project>
Build and publish commands¶
dotnet build
dotnet publish --configuration Release --output ./publish
func azure functionapp publish "$APP_NAME"
Use runtime-safe creation flags when provisioning:
az functionapp create --name "$APP_NAME" --resource-group "$RG" --storage-account "$STORAGE_NAME" --runtime dotnet-isolated --runtime-version 8 --functions-version 4 --os-type Linux
Upgrade guidance¶
- Move startup logic into
Program.cswithHostBuilder. - Replace in-process HTTP abstractions with
HttpRequestDataandHttpResponseData. - Replace
context.GetLogger()with constructor-injectedILogger<T>. - Update trigger attributes and extension packages to isolated-worker equivalents.