title: Azure Functions - Python (Blob Trigger and Binding)
body: <p>I have reviewed the documentation provided by Microsoft on Triggers. [https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-trigger?tabs=python][1]</p>
  <p>Indeed, using the <code>func.InputStream</code> parameter in the Azure Function allows us to retrieve the blob and some properties (<code>name, uri, length</code>) we can also read the bytes using the <code>read()</code> function, but how do we transform the bytes into an object we can manipulate such as a Pandas dataframe (or any other types of object for other types of files i.e. jpg)?</p>
  <p>My host.json file can be found below:</p>
  <pre><code>{
    &quot;scriptFile&quot;: &quot;__init__.py&quot;,
    &quot;bindings&quot;: [
      {
        &quot;name&quot;: &quot;myblob&quot;,
        &quot;type&quot;: &quot;blobTrigger&quot;,
        &quot;direction&quot;: &quot;in&quot;,
        &quot;path&quot;: &quot;statscan/raw/ncdb/{name}&quot;,
        &quot;connection&quot;: &quot;&quot;
      },
      {
        &quot;type&quot;: &quot;blob&quot;,
        &quot;direction&quot;: &quot;out&quot;,
        &quot;name&quot;: &quot;outputBlob&quot;,
        &quot;path&quot;: &quot;statscan/enriched/func/{name}.csv&quot;,
        &quot;connection&quot;: &quot;&quot;
      }
    ]
  }
  </code></pre>
  <p>The Blob Trigger function can be found here below:</p>
  <pre><code>import pandas as pd
  import logging
  import azure.functions as func
  
  def main(myblob: func.InputStream, outputBlob: func.Out[str]):
  
      logging.info(f&quot;Blob trigger executed!&quot;)
      logging.info(f&quot;Blob Name: {myblob.name} ({myblob.length}) bytes&quot;)
      logging.info(f&quot;Full Blob URI: {myblob.uri}&quot;)
  
      ### Manipulate with Pandas ###
  
      ### Output ###
      output = ''
      outputBlob.set(output)
  </code></pre>