azure-functions-host
azure-functions-host copied to clipboard
Getting Microsoft.Azure.WebJobs.Extensions.Storage: Unable to convert trigger to IStorageQueueMessage.
Is your question related to a specific version? If so, please specify:
Using Azure Functions Core Tools - 4.0.3971.
What language does your question apply to? (e.g. C#, JavaScript, Java, All)
Java
Question
I'm trying to use @QueueTrigger for testing my Azure Function locally, but while triggering it from
http://localhost:8080/admin/functions/my-queue-trigger
I'm getting this error:
[2022-07-31T15:39:45.203Z] System.Private.CoreLib: Exception while executing function: Functions.my-queue-trigger. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'request'. Microsoft.Azure.WebJobs.Extensions.Storage: Unable to convert trigger to IStorageQueueMessage.
Code:
@FunctionName("my-queue-trigger")
public void run(
@QueueTrigger(
name = "request",
queueName = "my-queue",
connection = "storage-conn-string"
) String request,
final ExecutionContext context) {
// logic
}
I'm setting storage-conn-string in local.settings.json file as well. Could you please help where I'm going wrong?
I was facing a similar issue, for me I used some JSON in my POST other than
{
"input": <your data here>
}
I was using this
{
"test": "test"
}
which raised the error. Maybe this is of any help to you.
@jo2 I used request json as
{}
This worked for timer-trigger but not for queue trigger.
That might be the problem. queue trigger expects input
as the message received. It may be anything but the value has to be present in JSON.
Hi @rshubham Thanks for the feedback, we will investigate this further and let you know about the findings soon
Hi @rshubham Please try using following JSON.
{
"name" : "request",
"queueName" : "my-queue",
"connection" : "storage-conn-string"
}
Please let us know if it helps. Thanks.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.