title: Azure service bus - lock duration and duplication, how are they related?
body: <p>I have an azure function monitoring an Azure service bus queue with default lock duration of 30 seconds. This azure function sends out email notifications based on the user information in the message coming from the queue.</p>
  
  <p>I noticed duplicate emails going out and thus checked the trace logs to find out that azure function has been invoked twice for the same user. Log entries are as follows: </p>
  
  <p><em>2018-08-09T<strong>14:38:05</strong>.1249371Z - Executing 'AzureFunction' (Reason='New ServiceBus message detected on 'servicebusqueue'.', Id=4657012a-94ac-4b22-a628-2e94285aeeb7)</em></p>
  
  <p><em>2018-08-09<strong>T14:38:33</strong>.3335833Z - Executing 'AzureFunction' (Reason='New ServiceBus message detected on 'servicebusqueue'.', Id=3ff8eea3-9b9b-43ae-a797-5acf01c2ae6c)</em></p>
  
  <p>The message was added only once to the queue and I am trying to understand what could generate the other one. Can it be because of the lock duration?</p>