Himan
Himan

Reputation: 89

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

enter image description here

Upvotes: 0

Views: 75

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136196

The 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.

Upvotes: 1

Related Questions