title: Downloading Azure Blobs using vb.net
body: <p>Quick question about downloading Blobs from azure storage.  I'm a little lost on how this works exactly, here's my code:</p>
  
  <pre><code> Try
          Dim accountname As String = "macroqc"
          Dim accountkey As String = My.Settings.Storagekey1
  
          Dim creds As StorageCredentials = New StorageCredentials(accountname, accountkey)
          Dim account As CloudStorageAccount = New CloudStorageAccount(creds, useHttps:=True)
  
          Dim client = account.CreateCloudBlobClient()
  
          Dim container As CloudBlobContainer = client.GetContainerReference("smallequipment1certifications")
  
          Dim blob As CloudBlockBlob = container.GetBlockBlobReference(filenamelbl.Text)
          Using MemoryStream = New MemoryStream()
              blob.DownloadToStream(MemoryStream)
              My.Settings.downloadsource = System.Text.Encoding.UTF8.GetString(MemoryStream.ToArray())
              equipmentpdf.src = filenamelbl.Text
          End Using
  
      Catch ex As Exception
          MessageBox.Show("Sorry an error has occured while opening your file: " &amp; Environment.NewLine &amp; ex.ToString, "Download Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
      End Try
  </code></pre>
  
  <p>So I am getting an error when I run this which looks like: 
  <img src="https://i.stack.imgur.com/FXLot.png" alt="enter image description here"></p>
  
  <p>So when it uploads the file to Azure storage it saves blob.Uri.AbsoluteUri &amp; blob.Uri.AbsolutePath to the database.  Am I going down the right path using this method to download the file? The Blobs are private do I need an SAS to download?  I am confused and am having a really hard time finding useful documenation on this!  Can someone help point me in the right direction please!!</p>
  
  <p>Thanks everyone!</p>