title: Avro Serialise to Azure EventHub
body: <p>I can't find much doco on this topic, but i'm serialising an object to Avro and then sending to Azure EventHub.. I <em>think</em> the Avro needs to contain schema too.. because without, how will a consumer (I.e. Azure Stream Analytics for example) know how to deserialise?</p>
  
  <p>The only example i can locate online uses <code>Microsoft.Hadoop.Avro.Container</code> namespace.. this seems to work fine, i can read via Stream Analytics.. but does this code 'automagically' include the schema in the payload? I sure as can't see any reference to it here:</p>
  
  <pre><code>        using (var memoryStream = new MemoryStream())
          using (var writer = AvroContainer.CreateWriter&lt;T&gt;(memoryStream, Codec.Null))
          using (var seqWriter = new SequentialWriter&lt;T&gt;(writer, items.Count()))
          {
              foreach (var e in items)
              {
                  seqWriter.Write(e);
              }
  
              return memoryStream.ToArray();
          }
  </code></pre>
  
  <p>The landscape of Avro in .Net seems a bit confused, why is there a Microsoft specific NuGet pkg? It seems quite old, has it now been superseded by something? Is there any documentation on how to leverage the standard <code>Apache.Avro</code> NuGet pkg to build a payload that contains the schema?</p>
  
  <p>Azure Event Hub documentation fleetingly mentioned Avro, but any google search only really turns out Event Hub Capture..</p>
  
  <p>Anyway in short.. is there a better way? I don't think i can send the schemas separately for this..</p>