Azure / Azure/Azure-Functions

After migration to .NET 8(Isolated) from .NET 6(In-Proc), Azure Isolated function (queue triggered) throwing timeout issue.

Open
#2,510 18 comments 0 reactions 1 assignee Claimed by @bhagyshricompany View on GitHub
Needs: Author feedback
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

The Azure function (queue triggered) is hosted in AKS cluster (Linux Debian). We are migrating from .NET 6 to .NET 8, in this process we migrated this in-proc azure function to isolated function. After migration we started receiving timeout exception whenever we submit 20+ messages to the queue quickly. In .NET 6 (In-Proc), we never faced this issue. This queue triggered isolated function makes some http calls, DB calls, does some processing and generates pdf.
These are the settings and packages in .csproj file:
PropertyGroup
TargetFramework net8.0
AzureFunctionsVersion v4
LangVersion 12.0
OutputType Exe
PropertyGroup
ItemGroup
PackageReference Include="Azure.Identity" Version="1.11.2"
PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0"
PackageReference Include="Microsoft.Azure.Core.NewtonsoftJson" Version="2.0.0"
PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.22.0"
PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.3-preview1"
PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0"
PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.4.0"
PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0"
PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.1"
PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues" Version="5.4.0"
PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.4"
PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0"
PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0"
PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.9.2"
PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2"
PackageReference Include="NuGet.Packaging" Version="6.9.1"
PackageReference Include="RazorEngineCore" Version="2024.4.1"
PackageReference Include="System.Security.Cryptography.Xml" Version="8.0.0"
PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4"
PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4"
ItemGroup

Program.cs
public class Program
{
public IConfiguration Configuration { get; private set; }
static async Task Main(string[] args)
{
await CreateHostBuilder(args).Build().RunAsync();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureFunctionsWorkerDefaults(builder =>
{
WorkerConfigurationExtensions.UseNewtonsoftJson(builder);
}, options =>
{
options.EnableUserCodeException = true;
})
.ConfigureAppConfiguration((hostingContext, config) =>
{
var envName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production";
var basePath = Directory.GetCurrentDirectory();
config.SetBasePath(basePath);
config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{envName}.json", true, true)
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("AxcessEnv")}.json", true, true)
.AddEnvironmentVariables()
.TryAddAzureKeyVault();

config.Build();
})
.ConfigureServices((hostContext, services) =>
{
services.Configure(opt =>
{
opt.EnableUserCodeException = true;
});
services.AddHttpClient();
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
IConfiguration configuration = hostContext.Configuration;
services.AddSingleton(configuration);
var startup = new Startup(configuration);
startup.ConfigureServices(services);
services.AddLogging();
});
}

[Function("Test")]
public async Task Test([QueueTrigger("test", Connection = "TestConnectionString")] Custom custom)
{
try
{
await CreatePdf(custom);
}
catch (Exception ex)
{
await OnFailure(custom, ex);
}
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.