I am working on an Azure Function (in-process model, V 4.1) with a ServiceBusTrigger for a queue. The function works fine and gets triggered. The function looks like this:
public async Task Run([ServiceBusTrigger("my-queue", Connection = "myConnectionString", AutoCompleteMessages = true)]
string myQueueItem, Int32 deliveryCount, DateTime enqueuedTimeUtc, string messageId)
I now want to be able to get the correlationId that I passed in the message and I want to be able to "Complete()" the message by myself.
I looked in the docs here (https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus-trigger?tabs=in-process%2Cextensionv5&pivots=programming-language-csharp) but did not find any way to bind other parameters like Message, MessageReceiver, etc. Whenever I try to use these, I get a binding exception when the function runs.
These are the relevant packages I am using
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.7.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Core" Version="1.4.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.3.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.0" />
I must be missing something...any hint is appreciated!
EDIT: After a cleanup, these are the relevant packages:
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="5.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.3" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.0" />