title: How to list Azure Storage Containers and Blobs
body: <p>I'm new to Azure Storage and I think I may be misunderstanding a few of the concepts.</p>
  
  <p>I'd like to list all my Storage Containers and Blobs using PowerShell.</p>
  
  <p>I can list all my Storage Accounts using the following code:</p>
  
  <pre><code>Get-AzureStorageAccount | Select StorageAccountName, GeoPrimaryLocation
  </code></pre>
  
  <p>Each of the Storage Accounts has a Container. How do I get it? I don't see a command that lists Containers.
  There is a Get-AzureStorageContainer command, but it doesn't take a Storage Account as input.</p>
  
  <p>What am I missing?</p>
  
  <p>-- Edit --</p>
  
  <p>I see that I can do the following:</p>
  
  <pre><code>$context = New-AzureStorageContext -StorageAccountName myStorageAccount -StorageAccountKey xxx
  Get-AzureStorageContainer -Context $context
  Get-AzureStorageBlob -Context $context -Container myContainer
  </code></pre>
  
  <p>Why is the context required? </p>