Passing HTTP Request to an Azure Function with ServiceBusTrigger

Vivek Shankar 95 Reputation points Microsoft Employee
2023-07-20T20:17:11.18+00:00

I have a durable function starter defined like the one below. How can I trigger it via postman for my API testing instead of triggering the test request via a ServiceBusTrigger? I followed the instructions listed here. This works when I pass the payload in "code and test" window of function app. But I see this error when I pass the payload for MyDto from postman -

 System.ArgumentNullException : Value cannot be null. (Parameter value)\n   at Microsoft.Azure.WebJobs.ServiceBus.ServiceBusTriggerBindingStrategy.GetBindingData(ServiceBusTriggerInput value)\

I have a durable function starter defined like the one below. How can I trigger it via postman for my API testing instead of triggering the test request via a ServiceBusTrigger? I followed the instructions listed here. But I see this error when I pass the payload for MyDto from postman - "type": "System.ArgumentNullException", "message": "Value cannot be null. (Parameter 'value')",

[Function(nameof(MyFunctionStarter))]
public async System.Threading.Tasks.Task RunAsync(
        [ServiceBusTrigger(StorageBusQueueName,
           Connection = StorageBusConnectionString)] MyDto incomingMessage,
        [DurableClient] DurableTaskClient durableTaskClient)
{   
c#.netazureazure-functions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
Developer technologies C#
{count} votes

Accepted answer
  1. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2023-08-03T15:50:51.37+00:00

    For the benefit of others coming across this post, the issue was the payload when running non-http functions via the Admin API as covered here should be as follows

    {
      "input": "<payload-normally-sent-to-the-function-as-a-string>",
    }
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.