Azure / Azure/azure-functions-dotnet-worker

Invoke queue-triggered function bound to QueueMessage from admin endpoint

Open
#3,041 0 comments 0 reactions 0 assignees View on GitHub
Needs: Triage (Functions)
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

I am asking my question from #3011 again because the answer did not address my question before it was closed.

I specifically asked about functions that bind to `QueueMessage`. The answer @RohitRanjanMS gave was for binding to `string[]`.

If it **is not possible** to invoke a function that binds to `QueueMessage`, the documentation should say so. If it **is possible**, then the documentation should show what syntax should be used, because I don't think it's obvious.

---

What syntax do we use to invoke a queue-triggered function bound to QueueMessage using the local tools using the admin endpoint?

The [documentation](https://learn.microsoft.com/en-us/azure/azure-functions/functions-manually-run-non-http?tabs=azure-portal) says we should be able to use this syntax:

```
{ "input": "" }
```

But it's not clear what to put there. No matter what string I try to put there, I end up throwing JsonException from QueueMessageJsonConverter with the message "JSON payload must contain a MessageId".

I can see that the `input` I send seems to be received as the `MessageText` property in the JSON that QueueMessageJsonConverter is reading, but the `MessageId` property is always null in the JSON. I tried sending an object like this and none of the `MessageId` properties end up in QueueMessageJsonConverter:

```
new {
messageid = Guid.NewGuid().ToString(),
input = JsonSerializer.Serialize(new {
MessageId = Guid.NewGuid().ToString(),
MessageText = JsonSerializer.Serialize(new {
MessageId = Guid.NewGuid().ToString(),
this_is = "supposed to be the body of the QueueMessage",
})
}),
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked manual-run documentation and the QueueMessageJsonConverter behavior described in the issue. Reproduce the request through the local tools admin endpoint using a QueueMessage-bound function, then document the supported payload syntax or clearly state that the binding cannot be invoked this way.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.