I am facing issues when I include a service bus trigger in my Azure function using Docker. For background I have an Azure function .NET 6 V4 running dotnet-isolated version that I have packaged up with Docker. My http endpoint is working as expected however, when I include my service bus trigger the startup fails when running inside docker. This results in the HTTP endpoint no longer working also. When running locally without docker I have no issues with triggering the HTTP endpoint or service bus trigger.
System.TypeLoadException: Could not load type 'Microsoft.Azure.WebJobs.ParameterBindingData' from assembly 'Microsoft.Azure.WebJobs'
Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:6.0
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4.0-dotnet-isolated6.0
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="5.14.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.15.1" />
</ItemGroup>
Service bus trigger
[Function(nameof(ServiceBusReceivedMessageFunction))]
public string ServiceBusReceivedMessageFunction(
[ServiceBusTrigger("queue-name", Connection = "ServiceBusConnection")] ServiceBusReceivedMessage message)
{
_logger.LogInformation("Message ID: {id}", message.MessageId);
_logger.LogInformation("Message Body: {body}", message.Body);
_logger.LogInformation("Message Content-Type: {contentType}", message.ContentType);
var outputMessage = $"Output message created at {DateTime.Now}";
return outputMessage;
}