Azure Storage Queue Client does not put message in poison queue

this is a newbie question.

I have a timer trigger which uses the storage queue (Client.Azure.Storage.Queues)

Does the client automatically send not processed messages to the poison queue? This code simulates an error. If everything is fine then the message is deleted.

        public async Task Run([TimerTrigger("%TimerExpression%")]TimerInfo myTimer, ILogger log)
        {
            log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");

            QueueMessage[] messages = await _queueClient.ReceiveMessagesAsync(maxMessages: 10, null );

            try
            {
                foreach (QueueMessage message in messages)
                {
                    Console.WriteLine(message.DequeueCount + "-------------------");
                    Console.WriteLine (message.Body)=
                    _queueClient.(message);
                    throw new ApplicationException("HELP");

                       _queueClient.DeleteMessage(message.MessageId, message.PopReceipt);

                }
            }
            catch(Exception e)
            {
                Console.WriteLine(e.Message);
            }

        }

I would expect that the message is not returned to the queue after 2 retries:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensions": {
    "queues": {
      "retry": {
        "strategy": "fixedDelay",
        "maxRetryCount": 2,
        "delayInterval": "00:00:03"
      }
    }
  }
}

Or am I missing something? Or must I add the message to a poison queue manually?

regards Stefan


Does the client automatically send not processed messages to the poison queue?

No, it does not.

However, the Azure Functions queue trigger will. If you trigger your function off the queue instead of a timer, then you'll end up with poison queue messages.

If you're using the storage client directly and not triggering off of the queue, then you'll need to do your own poison queue handling.