简体   繁体   中英

set azure storage account as current storage account powershell

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?

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 

在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM