0
votes

I am having the azure storage account(classic) and I can't set it as current storage account in powershell as it shows Set-AzureRmCurrentStorageAccount : The Resource 'Microsoft.Storage/storageAccounts/devstorageaccount' under resource group 'DEVENV' was not found.

I used Add-AzureRMAccount. When I login using Add-AzureAccount it returns nothing except error as I'm just having owner role for the subscription. so how can I set the storage account as current storage account in powershell?

2

2 Answers

2
votes

how can I set the storage account as current storage account in powershell?

We can use set-azuresubcription to do that.

Set-AzureSubscription -SubscriptionName "xxx" -CurrentStorageAccountName "xxx"

Please have a try to use the following code:

Add-AzureAccount 

Set-AzureSubscription -SubscriptionName "subcription name" -CurrentStorageAccountName "storage name"

Get-AzureSubscription 

enter image description here

1
votes

Set-AzureRmCurrentStorageAccount expects the storage account to be a Resource Manager (ARM) Storage Account and you mentioned that your storage account is a Classic storage account.

Please try by using an ARM Storage Account.