title: Getting error in Azure Stream Analytics with DocumentDB as sink
body: <p>I'm using Azure Stream Analytics to stream events from Event Hubs to DocumentDB.
  I have configured the <em>input</em>, <em>query</em> and <em>output</em> as documented, tested it with sample data and it managed to return results as expected.</p>
  
  <p>But when I start the streaming job and send the same payload as the sample data earlier, I got this error message:</p>
  
  <blockquote>
    <p>There was a problem formatting the document [id] column as per DocumentDB constraints for DocumentDB db:[my-database-name], and collection:[my-collection-name].</p>
  </blockquote>
  
  <p>My sample data is an array of JSON:</p>
  
  <pre><code>[
   { "Sequence": 1, "Tenant": "T1", "Status": "Started" },
   { "Sequence": 2, "Tenant": "T1", "Status": "Ended" }
  ]
  </code></pre>
  
  <p>I've configured the input as follows:</p>
  
  <blockquote>
    <ul>
    <li>Input alias: eventhubs-events</li>
    <li>Source Type: Data stream</li>
    <li>Source: Event Hub</li>
    <li>Subscription: <em>same subscription as where I create the Analytics job</em></li>
    <li>Service bus namespace: <em>an existing Event Hub namespace</em></li>
    <li>Event hub name: events <em>(existing event hub in the namespace)</em></li>
    <li>Event hub policy name: <em>a policy with read access</em></li>
    <li>Event hub consumer group: <em>blank</em></li>
    <li>Event serialization format: JSON</li>
    <li>Encoding: UTF-8</li>
    </ul>
  </blockquote>
  
  <p>And the output as follows:</p>
  
  <blockquote>
    <ul>
    <li>Output alias: documentdb-events</li>
    <li>Sink: DocumentDB</li>
    <li>Subscription: <em>same subscription as where I create the Analytics job</em></li>
    <li>Account id: <em>an existing DocumentDB account</em></li>
    <li>Database: records <em>(an existing database in the account)</em></li>
    <li>Collection name pattern: collection <em>(an existing collection in the database)</em></li>
    <li>Document id: id</li>
    </ul>
  </blockquote>
  
  <p>My query is as simple as:</p>
  
  <pre><code>SELECT
      event.Sequence AS id,
      event.Tenant,
      event.Status
  INTO [documentdb-events]
  FROM [eventhubs-events] AS event
  </code></pre>