title: I have a long running process which I call in my Service Bus Queue. I want it to continue beyond 5 minutes
body: <p>I have a long running process which performs matches between millions of records I call this code using a Service Bus, However when my process passes the 5 minute limit Azure starts processing the already processed records from the start again.</p>
  
  <p>How can I avoid this </p>
  
  <p>Here is my code:</p>
  
  <pre><code>private static async Task ProcessMessagesAsync(Message message, CancellationToken token)
   {
     long receivedMessageTrasactionId = 0;
     try
     {
       IQueueClient queueClient = new QueueClient(serviceBusConnectionString, serviceBusQueueName, ReceiveMode.PeekLock);
  
       // Process the message
       receivedMessageTrasactionId = Convert.ToInt64(Encoding.UTF8.GetString(message.Body));
  
       // My Very Long Running Method
       await DataCleanse.PerformDataCleanse(receivedMessageTrasactionId);
              //Get Transaction and Metric details
  
       await queueClient.CompleteAsync(message.SystemProperties.LockToken);
     }
     catch (Exception ex)
     {
       Log4NetErrorLogger(ex);
       throw ex;
     }
  }
  </code></pre>