Issue with setting up StorageAccountname while starting Azure machine through Powershell


  • I am trying to install and configure Azure Powershell and surprisingly I am facing issue with setting up of StorageAccountName parameter.

    I have my vm setup on my enterprise account with resource group name as "RG-1" and storage account names as rg13675 and rg16461. I found these storage account names after drilling down to my resource group.

    On running command,

    Set-AzureRmCurrentStorageAccount –ResourceGroupName “RG-1” –StorageAccountName “rg16461"

    My powershell throws up error:

    Set-AzureRmCurrentStorageAccount : The Resource 'Microsoft.Storage/storageAccounts/rg16461' under resource group 'RG-1' was not found.
    At line:1 char:1
    + Set-AzureRmCurrentStorageAccount ResourceGroupName RG-1 StorageAc ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Set-AzureRmCurrentStorageAccount], CloudException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.SetAzureRmCurrentStorageAccount
    Monday, September 5, 2016 8:01 AM


  • he reason you're getting this error is because your storage account is a classic storage account (from the screenshot you shared) while the cmdlet expects a resource manager (ARM) storage account.

    Please create a new storage account using Resource Manager deployment option and try to use that account's name in your cmdlet. That should fix the error.

    • Proposed as answer by Alee.Geek Monday, September 5, 2016 8:03 AM
    • Marked as answer by Durr e Sameen Monday, September 5, 2016 8:10 AM
    Monday, September 5, 2016 8:03 AM