Skip to content

Microsoft.Azure.Functions.Worker.Sdk crashes azure function with http trigger #4468

@wondertalik

Description

@wondertalik

Package

Sentry.Azure.Functions.Worker

.NET Flavor

.NET Core

.NET Version

8.0.413

OS

macOS

OS Version

No response

Development Environment

Rider 2024 (MacOS)

SDK Version

5.14.1

Self-Hosted Sentry Version

No response

Workload Versions

dotnet workload list

Installed Workload Id Manifest Version Installation Source

Use dotnet workload search to find additional workloads to install.

UseSentry or SentrySdk.Init call

FunctionsApplicationBuilder builder = FunctionsApplication.CreateBuilder(args);
builder.UseSentry(options =>
{
    options.UseOpenTelemetry();
    options.DisableSentryHttpMessageHandler = true;
});
builder.ConfigureFunctionsWebApplication();

Steps to Reproduce

Azure function with http trigger crashes when use Microsoft.Azure.Functions.Worker.Sdk and Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore

In program.cs just comment builder.UseSentry and HttpTest function back to work.

Expected Result

Working function without exception

Actual Result

[2025-08-25T07:53:00.919Z] Function 'test-http', Invocation id '1c40128b-464a-462f-a2f8-c4a7c0d9715e': An exception was thrown by the invocation.
[2025-08-25T07:53:00.919Z] Result: Function 'test-http', Invocation id '1c40128b-464a-462f-a2f8-c4a7c0d9715e': An exception was thrown by the invocation.
[2025-08-25T07:53:00.919Z] Exception: System.UriFormatException: Invalid URI: The URI is empty.
[2025-08-25T07:53:00.919Z]    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
[2025-08-25T07:53:00.919Z]    at System.Uri..ctor(String uriString)
[2025-08-25T07:53:00.919Z]    at Microsoft.Azure.Functions.Worker.GrpcHttpRequestData.get_Url() in D:\a\_work\1\s\src\DotNetWorker.Grpc\Http\GrpcHttpRequestData.cs:line 101
[2025-08-25T07:53:00.919Z]    at Sentry.Azure.Functions.Worker.SentryFunctionsWorkerMiddleware.StartOrContinueTraceAsync(FunctionContext context)
[2025-08-25T07:53:00.919Z]    at Sentry.Azure.Functions.Worker.SentryFunctionsWorkerMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next)
[2025-08-25T07:53:00.919Z]    at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 96
[2025-08-25T07:53:00.920Z] Stack:    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
[2025-08-25T07:53:00.920Z]    at System.Uri..ctor(String uriString)
[2025-08-25T07:53:00.920Z]    at Microsoft.Azure.Functions.Worker.GrpcHttpRequestData.get_Url() in D:\a\_work\1\s\src\DotNetWorker.Grpc\Http\GrpcHttpRequestData.cs:line 101
[2025-08-25T07:53:00.920Z]    at Sentry.Azure.Functions.Worker.SentryFunctionsWorkerMiddleware.StartOrContinueTraceAsync(FunctionContext context)
[2025-08-25T07:53:00.920Z]    at Sentry.Azure.Functions.Worker.SentryFunctionsWorkerMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next)
[2025-08-25T07:53:00.920Z]    at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 96.

        <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.23.0" /> 
        <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.0.0" /> 
        <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.2" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.OpenTelemetry" Version="1.1.0-preview6" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.5" />
        <PackageReference Include="Sentry.Azure.Functions.Worker" Version="5.14.1" />
        <PackageReference Include="Sentry.OpenTelemetry" Version="5.14.1" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeQuestionFurther information is requested

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions