title: Creating and uploading to specific folders in Azure Blob storage
body: <p>I am trying to upload files to Azure blob storage via C# code, however, I need a specific directory tree. My code so far:</p>
  <pre><code>BlobServiceClient bSC = new BlobServiceClient(MY_CONN_STRING);
  
  string filename = $&quot;test/files/file.json&quot;;
  string localFilePath = Path.Combine(filename);
  var containerClient = bSC.GetBlobContainerClient(&quot;mycontainer&quot;);
  BlobClient blobClient = containerClient.GetBlobClient(filename);
  
  using FileStream uploadFileStream = File.OpenRead(localFilePath);
  await blobClient.UploadAsync(uploadFileStream, true);
  uploadFileStream.Close();
  </code></pre>
  <p>I have other piece of code that generates a file in <code>test/files/file.json</code>. In Azure blob storage, however, I want it to be uploaded to the directory tree of my choosing. Example: <code>/mycontainer/Events/production/file.json</code>, whever <code>Events</code> needs to be created as well.
  Right now it is recreating the tree structure within my project of <code>test/files/file.json</code>.</p>