0
votes

This issue only occurs when I use the Azure Portal Editor. If I upload from Visual Studio, this issue does not occur, but I cannot upload from Visual Studio due this unrelated bug: Azure Functions - only use connection string in Application Settings in cloud for queue trigger.

When using the Azure Portal Editor, if I throw an exception from C# or use context.done(error) from JavaScript, Application Insights shows an error occurred, but the message is simply consumed. The message is not retried, and it does not go to a poison queue.

The same code for C# correctly retries when uploaded from Visual Studio, so I believe this is a configuration issue. I have tried modifying the host.json file for the Azure Portal Editor version to:

{
  "queues": {
        "visibilityTimeout": "00:00:15",
        "maxDequeueCount": 5
    }
}

but the message was still getting consumed instead of retried. How do I fix this so that I can get messages to retry when coding with the Azure Portal Editor?

Notes:

In JavaScript, context.bindingData.dequeueCount returns 0.

Azure Function runtime version: 1.0.11913.0 (~1).

I'm using a Consumption App Plan.

2
Interesting. I'd like to look at this from our side; would you mind sharing the following information? 1) The name of your Function app (here's how to share privately), 2) The name of your function, and 3) The timeframe within which you observed this. - Katy Shimizu
Function started (Id=f6ca5d6b-3b63-4696-9be5-0d9d33785dc4) at 2018-07-18T17:01:01.460. Function completed (Failure, Id=f6ca5d6b-3b63-4696-9be5-0d9d33785dc4, Duration=2892ms) at 2018-07-18T17:01:04.350. - Anonymous1
Our logs indicate the function invocation whose information you gave me was manually triggered (probably from the portal), so I have no information about queue behavior. Can you give me the live component's information? - Katy Shimizu
That is correct. Let me manually add a message to the queue, which sounds like it will have the effect you're looking for. - Anonymous1
Well, that worked. I must have just misunderstood the behavior of the manual trigger. Thank you! - Anonymous1

2 Answers

0
votes

I was using the manual trigger from the Azure Portal Editor, which has different behavior from creating a message in the queue. When I put a message in the queue, the Azure Function worked as expected.

0
votes

For local development, if your function is async use Task for the return type.

public async Task Run

instead of void:

public async void Run