title: What is the reason for host lock lease acquired by instance id in Azure function?
body: <p>I'm running a project which has Azure function, but it's not running my azure function. I have put the breakpoint, its also not hitting the breakpoint. Also, the output is not clear so that I can debug my code. Is there any way to debug the code to find the root cause of the issue?</p>
  
  <p><strong>Output:</strong></p>
  
  <blockquote>
    <p>[3/20/2018 9:39:31 AM] Reading host configuration file
    'C:\Users\myname\Source\MyProject\aspnet-core\src\Nec.MyProject.Processors\bin\Debug\netstandard2.0\host.json' [3/20/2018 9:39:31 AM] Host configuration file read: [3/20/2018
    9:39:31 AM] { [3/20/2018 9:39:31 AM]   "queues": { [3/20/2018 9:39:31
    AM]     "maxPollingInterval": 1000, [3/20/2018 9:39:31 AM]<br>
    "visibilityTimeout": "00:00:00", [3/20/2018 9:39:31 AM]<br>
    "batchSize": 1, [3/20/2018 9:39:31 AM]     "maxDequeueCount": 5
    [3/20/2018 9:39:31 AM]   } [3/20/2018 9:39:31 AM] } [3/20/2018 9:39:48
    AM] Generating 15 job function(s) [3/20/2018 9:39:48 AM] Starting Host
    (HostId=windowsmyname-655615619, Version=2.0.11415.0, ProcessId=6320,
    Debug=False, ConsecutiveErrors=0, StartupCount=1,
    FunctionsExtensionVersion=) [3/20/2018 9:39:49 AM] Found the following
    functions: [3/20/2018 9:39:49 AM]
    MyCompany.MyProject.Processors.BackOfficeFilesGeneratorJobs.RunTestGeneratorAsync
    [3/20/2018 9:39:49 AM] [3/20/2018 9:39:49 AM] Job host started
    Listening on <a href="http://localhost:7071/" rel="nofollow noreferrer">http://localhost:7071/</a> Hit CTRL-C to exit... [3/20/2018
    9:39:50 AM] Host lock lease acquired by instance ID
    '000000000000000000000000C78D3496'.</p>
  </blockquote>
  
  <p><strong>Azure Function:</strong></p>
  
  <pre><code>[FunctionName("GenerateTestOfficeMasterDataFiles")]
  public static async Task RunTestGeneratorAsync(
      [QueueTrigger("%MasterDataFiles:Supplier:QueueName%", Connection = "ConnectionStrings:BlobStorageAccount")] BackOfficeFileGeneratorMessage&lt;string&gt; message,
      ExecutionContext context,
      TraceWriter log)
  </code></pre>
  
  <p><strong>Note:</strong> It was working fine when it was <code>BackOfficeFileGeneratorMessage</code> instead of <code>BackOfficeFileGeneratorMessage&lt;string&gt;</code>.</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>public class BackOfficeFileGeneratorMessage&lt;TEntityKey&gt;
  {
      public BackOfficeFileGeneratorMessage()
      {
          Items = new MasterDataFileOperationItem &lt;TEntityKey&gt;[0];
      }
      public bool UseStaging { get; set; }
      public string StoreNo { get; set; }
      public bool RefreshAll { get; set; }
      public IEnumerable&lt;MasterDataFileOperationItem &lt;TEntityKey&gt;&gt; Items { get; set; }
  }
  </code></pre>