In this article I’ll show you how to manage your Azure Storage account using PowerShell from a management workstation without using the portal.
Before you start you will need a management workstation running Windows 10, Windows Server 2012 R2, or Server 2016.
If you don’t have Azure PowerShell Storage Module Installed, see this article.
To check If the module Is Installed type:
Get-module -listavailable
Look for AzureRM.Storage
To view all the azure storage cmdlets type:
Get-help get-azurestorage*
Get-help set-azurestorage*
To start, Login to your Azure AD account using PowerShell.
Get your Access Keys from your storage account
Important: To use the Storage cmdlet you have to pass the Access Key details before any storage cmdlet like the cmdlet below:
new-AzureStorageContext -StorageAccountName 00dwv42ffacswarm1 -storageAccountKey {Access Key}
For example. To view all storage containers, I’ll run the cmdlet and pipe the Get-AzureStorageContainer cmdlet.
new-AzureStorageContext -StorageAccountName 00dwtbxv42niwacswarm1 -storageAccountKey storagekey | Get-AzureStorageContainer
You can also use variable to store the Access Key:
$X = new-AzureStorageContext -StorageAccountName 00dwtbxv42niwacswarm1 -storageAccountKey storagekey
And then just use it with a pipe to run any storage cmdlet:
$x | Get-AzureStorageContainer
For more Articles visit my Azure main page.