In a previous post, I had identified the steps to upgrade storage accounts. Upgrading to General Purpose v2 storage accounts should be simple and easy, and it generally is. What I’m finding however is that with many storage accounts, managing these upgrades becomes a challenge. Specifically, I keep finding new storage accounts to upgrade. Time to introduce some PowerShell. Here is the storage account that started me on this path today:

We fixed this once in the configuration screen on another storage account. Time to bust out the PowerShell.

While this is the first one I’m going to upgrade (and the one in the previous post is already upgraded), let’s run a PowerShell script to see what storage accounts are on what versions. We will do this with the Get-AzStorageAccount command:

If you have 3,049 storage accounts – you will want to use PowerShell.

In this result, the Kind column tells me that this storage account is indeed not on v2. Let’s also fix this through PowerShell. While I only have one to fix here, if you have multiple, you can clearly see the efficiency. We will do the upgrade with upgrade commands as options in Set-AzStorageAccount cmdlet. For this single upgrade, I simply ran the PowerShell Script inserting both the resource group name and storage account name and set the implemented the -UpgradeToStorageV2 option, and it was complete instantly. The script is shown below, both as I ran it and as the Cmdlet is defined for you to introduce your options for upgrades:

My example:

Set-AzStorageAccount -ResourceGroupName veeamv10 -AccountName veeamv10 -UpgradeToStorageV2

Default:

Set-AzStorageAccount -ResourceGroupName <resource-group> -AccountName <storage-account> -UpgradeToStorageV2

This is shown below, with instant effect in the PowerShell Console:

Now all of my Storage Accounts are at V2.

Once I closed PowerShell and returned to the storage account, the warning that was provided to upgrade to v2 was dismissed. I should re-iterate also my previous advice of testing the upgrade on one account first to make sure your applications still interact correctly; which I did in the previous post in the configuration panel – making a scripted upgrade more sensible now.

As always, after any change in the Azure Portal, I will finish my administrative visit in the Azure Advisor. This will ensure that none of the changes I have made will have introduced a security or availability recommendation. While the storage account upgrade is a completely low-risk change, any time I am in the Azure Portal, I may have made some other change or a script not do what was expected. Always a good idea to end your journey in Advisor.

Do you have any storage accounts that are still v1? Upgrading is straightforward, would you rather do it through PowerShell or configuration of the storage account? Share your comments below.