question

mariapraded-0469 avatar image
0 Votes"
mariapraded-0469 asked MayankBargali-MSFT answered

Missing a trigger argument in Azure Function

Hello!
I created a Azure Function Service Bus trigger, here are the run.csx:

 using Microsoft.Azure.WebJobs;
 using Microsoft.Extensions.Logging;
    
 public static class FunctionQwe
     {
          [FunctionName ("FunctionQwe")]
         public static void Run(string myQueueItem, ILogger log)
         {
             log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
         } 
     }

and function.json:

 {
   "direction": "in",
   "bindings": [
     {
       "type": "serviceBusTrigger",
       "connection": "ServiceBusConnectionString",
       "queueName": "DefaultQueue",
       "isSessionsEnabled": false,
       "name": "myQueueItem"
     }
   ]
 }

But a script cannot compile with this error: [Error] error AF003: Missing a trigger argument named 'myQueueItem'.

I have already made sure that service bus trigger name is the same in both files above.
Maybe I do not see something?

azure-functionsazure-service-bus
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@mariapraded-0469 The code and function.json looks fine and I couldn't observe the same behaviour with the function.json and code that you have shared. Can you please confirm if there are no special character added in function.json myQueueItem or your Run method arguemnt myQueueItem that could have caused this issue. You can remove the field and add it again without copy/pasting and see if it helps you.

0 Votes 0 ·

@MayankBargali-MSFT I just removed all code from run.csx and function.json and pasted code from this question, but, unfortunately, the error still appears. And I tried to create a new Service Bus queue trigger and paste there the code above, but still the same error

0 Votes 0 ·

@mariapraded-0469 Please refer to my private comment so I can connect offline to assist you further.

0 Votes 0 ·

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered

@mariapraded-0469 Thanks for the offline discussion.
We have created the new servicebus trigger and couldn't observe the same issue in the new function. If someone is facing the similar issue there there might be issue if there are any special character or the entry point is different for your function.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.