Using Azure Storage with Powershell – Getting started


  • After installation, type in Azure in the search field, click the search icon, then click Install to see installed modules on top:


  • Close the Microsoft Web Platform Installer. To get back to it to add/remove modules you can use the icon:


  • Notice the new Azure set of icons added:


  • I’ve pinned the Azure Powershell icon to the task bar. Open it by right clicking on it, then right click on Windows Azure Powershell and click Run as administrator


  •  To connect to your Azure account, type in Add-AzureAccount


  • Azure Powershell displays a message similar to:


  • Check your subscription(s) using the command: Get-AzureSubscription


  • If you have more than one subscription under your Azure account, you may want to switch to a specific subscription. Use this command to switch a given subscription and make it the default subscription: Select-AzureSubscription -SubscriptionName “Visual Studio Premium with MSDN” -Default
    Substitute “Visual Studio Premium with MSDN” with SubscriptionName as shown from the Get-AzureSubscription command


If you don’t have a storage account setup under your Azure subscription, you can create one from your Azure portal. Click Storage on the left, then click New at the bottom:


Type in a name for the new account you wish to create – must be lower case letter only. Pick an Azure data center – typically one that’s physically close to your location to get better latency. Pick a subscription. Pick a replication setting. Locally-redundant give you 3 copies of your data in the data center you selected. Geo-redundant gives you 3 additional copies in another Azure data center. Geo-redundant is typically twice the cost of locally-redundant storage account, and is the default option.


In a minute or 2 Azure will finish creating the storage account. click on the account name:


Next click Dashboard, and click Manage Access Keys at the bottom:


Copy the account name and the primary access key. You will need them to use your storage account via Powershell later.


Secure this information because it provides access to your Azure data. Data can be accessed by using either the primary or secondary keys. Each key is 88 characters long and is made up of alphanumeric upper and lower case letters and special characters. The availability of 2 keys allows us to change keys without losing access by applications or machines that use the account. For example in case of key compromise, and you’re using the primary key in an application or machine, you can:

  1. Regenerate the secondary key
  2. Replace the key in the script/application/machine using the storage account (no access interruption)
  3. Regenerate the primary key

Now you have changed your account keys without any service interruption


4 responses

  1. Pingback: Using Azure Storage with Powershell – Initial computer setup | Sam's Corner

  2. Pingback: Resuming timed out uploads/downloads to/from Azure blob storage with azCopy | Sam's Corner

  3. Pingback: Benchmarking Azure VM storage | Sam's Corner

  4. Pingback: Connecting to StorSimple 8k using Powershell | Sam's Corner

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.