title: CloudQueueMessage QueueTrigger in Azure vs Local Instance
body: <p>I need to be able to get to the queue item itself (not the string), so that I can manipulate it from my function.</p>
  
  <p>In run.csx code blelow runs and i get access to <code>CloudQueueMessage</code></p>
  
  <pre><code>#r "Microsoft.WindowsAzure.Storage"
  
  using Microsoft.WindowsAzure.Storage.Queue;
  using System;
  
  public static void Run(CloudQueueMessage myQueueItem, ILogger log)
  {
              log.LogInformation($"Queue ID: {myQueueItem.Id}");
              log.LogInformation($"Queue Insertion Time: {myQueueItem.InsertionTime}");
              log.LogInformation($"Queue Expiration Time: {myQueueItem.ExpirationTime}");
              log.LogInformation($"Queue Payload: {myQueueItem.AsString}");
  }
  </code></pre>
  
  <p>In my local development this code throws an <strong>error</strong>. 
  I use all latest Nuget's.</p>
  
  <p>VS2017 15.8.8</p>
  
  <p>Azure Function and Web Job Tools: 15.10.2046.0</p>
  
  <pre><code>    using Microsoft.Azure.WebJobs;
      using Microsoft.Extensions.Logging;
      using Microsoft.WindowsAzure.Storage.Queue;
  
      namespace AzurePumps.MyForce
      {
          public static class PersonQueueProcessor
          {
              [FunctionName("PersonQueueProcessor")]
              public static void Run([QueueTrigger("sfcontact-update-error", Connection = "storage-queue-connection")]CloudQueueMessage myQueueItem, ILogger log)
              {
                  log.LogInformation($"Queue ID: {myQueueItem.Id}");
                  log.LogInformation($"Queue Insertion Time: {myQueueItem.InsertionTime}");
                  log.LogInformation($"Queue Expiration Time: {myQueueItem.ExpirationTime}");
                  log.LogInformation($"Queue Payload: {myQueueItem.AsString}");
              }
          }
        }
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>Azure Functions Core Tools (2.1.748 Commit hash: 5db20665cf0c11bedaffc96d81c9baef7456acb3)
  Function Runtime Version: 2.0.12134.0
  Skipping 'SF_SecurityToken' from local settings as it's already defined in current environment variables.
  [10/26/2018 8:07:51 PM] Building host: startup suppressed:False, configuration suppressed: False
  [10/26/2018 8:07:52 PM] Reading host configuration file 'D:\Projects\Force\bin\Debug\netstandard2.0\host.json'
  [10/26/2018 8:07:52 PM] Host configuration file read:
  [10/26/2018 8:07:52 PM] {
  [10/26/2018 8:07:52 PM]   "version": "2.0"
  [10/26/2018 8:07:52 PM] }
  [10/26/2018 8:07:53 PM] Initializing Host.
  [10/26/2018 8:07:53 PM] Host initialization: ConsecutiveErrors=0, StartupCount=1
  [10/26/2018 8:07:53 PM] Starting JobHost
  [10/26/2018 8:07:53 PM] Starting Host (HostId=vddk35x1fmsnlt-1608145051, InstanceId=e9842cc2-f4a1-46c2-80d0-3e0aad9ae83b, Version=2.0.12134.0, ProcessId=16720, AppDomainId=1, Debug=False, FunctionsExtensionVersion=)
  [10/26/2018 8:07:53 PM] Loading functions metadata
  [10/26/2018 8:07:53 PM] 2 functions loaded
  [10/26/2018 8:07:54 PM] Generating 2 job function(s)
  [10/26/2018 8:07:55 PM] Found the following functions:
  [10/26/2018 8:07:55 PM] AzurePumps.MyForce.PersonProcessor.Run
  [10/26/2018 8:07:55 PM] AzurePumps.MyForce.PersonQueueProcessor.Run
  [10/26/2018 8:07:55 PM]
  [10/26/2018 8:07:55 PM] Host initialized (1859ms)
  [10/26/2018 8:08:00 PM] Host started (6876ms)
  [10/26/2018 8:08:00 PM] Job host started
  Hosting environment: Production
  Content root path: D:\Projects\Force\bin\Debug\netstandard2.0
  Now listening on: http://0.0.0.0:7071
  Application started. Press Ctrl+C to shut down.
  Listening on http://0.0.0.0:7071/
  Hit CTRL-C to exit...
  [10/26/2018 8:08:06 PM] Host lock lease acquired by instance ID '0000000000000000000000006DB263D8'.
  [10/26/2018 8:08:22 PM] Executing 'PersonQueueProcessor' (Reason='New queue message detected on 'sfcontact-update-error'.', Id=1e37d3a4-a992-41c8-b6ca-595787e5224e)
  [10/26/2018 8:08:23 PM] Executed 'PersonQueueProcessor' (Failed, Id=1e37d3a4-a992-41c8-b6ca-595787e5224e)
  **[10/26/2018 8:08:23 PM] System.Private.CoreLib: Exception while executing function: PersonQueueProcessor. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'myQueueItem'. Microsoft.Azure.WebJobs.Extensions.Storage: Binding parameters to complex objects (such as 'CloudQueueMessage') uses Json.NET serialization.
  1. Bind the parameter type as 'string' instead of 'CloudQueueMessage' to get the raw values and avoid JSON deserialization, or
  2. Change the queue payload to be valid json. The JSON parser failed: Unexpected character encountered while parsing value: i. Path '', line 0, position 0.**
  </code></pre>