Azure function cannot start when I have a auto forward queue:
Function XXX Error: The listener for function 'FunctionXXX' was unable to start. Microsoft.ServiceBus: Cannot create a message receiver on an entity with auto-forwarding enabled.
// Code to create the queue:
var manager = NamespaceManager.CreateFromConnectionString("ConnectionString");
manager.CreateQueue(new QueueDescription("myqueue_done")
{
RequiresSession = false
});
manager.CreateQueue(new QueueDescription("myqueue")
{
ForwardTo = "myqueue_done",
RequiresSession = false
});
And here is my azure function:
[FunctionName("FunctionXXX")]
public static void Run([ServiceBusTrigger("myqueue", Connection = "AzureSbConnectionString")]string myQueueItem, string messageId, string CorrelationId, TraceWriter log)
{
log.Info($"Message id={messageId}, CorrelationId={CorrelationId}, was processed: {myQueueItem}");
}
Is it really a limitation? Is there a better way to move processed messages inside this azure function sandbox method?
Tks!