Azure / azure-functions-servicebus-extension

Service Bus extension for Azure Functions
MIT License
65 stars 35 forks source link

Microsoft.Azure.Functions.Worker.Extensions.ServiceBus past version 5.13 (5.14, 5.14.1 and 5.15) causes host failure on Linux #230

Open codeputer opened 6 months ago

codeputer commented 6 months ago

I created sample Azure Function .Net8, direct from the template using Visual Studio 2022 V17.8.3

Added my bindings to a function..

using System;

using Azure.Messaging.ServiceBus;

using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Logging;

namespace xxxHandleInBoundMessages.Functions;

public class xxxParseInboundMessagesFunc
{
  private readonly ILogger<xxxParseInboundMessagesFunc> _logger;

  public xxxParseInboundMessagesFunc(ILogger<xxxParseInboundMessagesFunc> logger)
  {
    _logger = logger;
  }

  [Function(nameof(xxxInboundMessagesFunc))]
  public async Task RunAsync(
    [ServiceBusTrigger("%xxxDispersedEvent:Topic%", "%xxxDispersedEvent:SubscriptionName%", Connection = "xxxDispersedEvent:SBConnectionString")]
  ServiceBusReceivedMessage message)
  {
    _logger.LogInformation("Message ID: {id}", message.MessageId);
    _logger.LogInformation("Message Body: {body}", message.Body);
    _logger.LogInformation("Message Content-Type: {contentType}", message.ContentType);
    System.Diagnostics.Debugger.Break();
    await Task.Yield();
    throw new Exception("Return message to Deadletter @ v5.13.0 SB");
  }
}

Ran locally, and then deployed it to Azure on the App Service Plan xxxConnectAppServicePlan (P1v3: 1), Operating System: Linux

Running using

the application runs fine

Only changes this Nuget package to or higher causes the following failure

image

Also documented on SO at: https://stackoverflow.com/q/77730033/176338

codeputer commented 6 months ago

Deployed the exact same code base to a App Service Plan for Windows, and the functions are working as expected.