title: Azure blob download is incredibly slow using PowerShell (via Get-AzureStorageBlobContent), but fast via Azure Explorer, etc?
body: <p>With very basic code that simply loops through my storage account and mirrors all containers and blobs to my local disk, I'm finding the <strong>Get-AsureStorageBlobContent</strong> cmdlet to be incredibly slow?  It seems to take a real time second or two per blob regardless of the blob size...which adds considerable overhead when we've got thousands of tiny files.</p>
  
  <p>In contrast, on the same machine and network connection (even running simultaneously), Azure Explorer does the same bulk copy 10x to 20x faster, and AzCopy does it literally 100x faster (async), so clearly it's not a network issue. </p>
  
  <p>Is there a more efficient way to use the Azure storage cmdlets, or are they just dog slow by nature?  The help for <strong>Get-AzureStorageContainer</strong> mentions a <strong>-ConcurrentTaskCount</strong> option which implies some ability to be async, but there's no documentation on how to achieve async and given that it only operates on a single item I'm not sure how it could?</p>
  
  <p>This is the code I'm running:</p>
  
  <pre><code>$localContent       = "C:\local_copy"
  $storageAccountName = "myblobaccount"
  $storageAccountKey  = "mykey"
  
  Import-Module Azure    
  
  $blob_account = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -Protocol https
  
  Get-AzureStorageContainer -Context $blob_account | ForEach-Object {
      $container = $_.Name
  
      Get-AzureStorageBlob -Container $container -Context $blob_account | ForEach-Object {
          $local_path = "$localContent\{0}\{1}" -f$container,$_.Name
  
          $local_dir = Split-Path $local_path
          if (!(Test-Path $local_dir)) {
              New-Item -Path $local_dir -ItemType directory -Force
          }
          Get-AzureStorageBlobContent -Context $blob_account -Container $container -Blob $_.Name -Destination $local_path -Force | Out-Null
      }
  }
  </code></pre>