none
setting currentstorageaccount - storage account was not found

    Question

  • I do this:

    Get-AzureRmStorageAccount

    ResourceGroupName   : logisoft_dms

    StorageAccountName  : logistorageblob

    Id                  : /subscriptions/745623be-60c3-411a-a80f-37256b5c1c5b/resourceGroups/logisoft_dms/providers/Microso

                          ft.Storage/storageAccounts/logistorageblob

    Location            : centralus

    AccountType         : StandardLRS

    CreationTime        : 1/25/2016 7:08:09 PM

    CustomDomain        :

    LastGeoFailoverTime :

    PrimaryEndpoints    : Microsoft.Azure.Management.Storage.Models.Endpoints

    PrimaryLocation     : centralus

    ProvisioningState   : Succeeded

    SecondaryEndpoints  :

    SecondaryLocation   :

    StatusOfPrimary     : Available

    StatusOfSecondary   :

    Tags                : {}

    Context             : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext

    I do this:

    PS C:\Temp> Get-AzureSubscription

    SubscriptionId            : 745623be-60c3-411a-a80f-37256b5c1c5b

    SubscriptionName          : Free Trial

    Environment               : AzureCloud

    DefaultAccount            : 2EF8D7C9D9B0A551C3827B8867D6BF3C50FD89B6

    IsDefault                 : True

    IsCurrent                 : True

    TenantId                  :

    CurrentStorageAccountName :

    I try to set the current storage account for the subscription and I get this:

    PS C:\Temp> Set-AzureSubscription -SubscriptionName 'free trial' -CurrentStorageAccountName 'logistorageblob'

    Set-AzureSubscription : ResourceNotFound: The storage account 'logistorageblob' was not found.

    Tuesday, January 26, 2016 10:23 PM

Answers

  • The answer to my issue was that when I created my storage account, I used the string "blob" in the naming of the account.

    When I created a storage account without this string, everything works as expected.

    • Marked as answer by chireader Friday, January 29, 2016 6:44 PM
    Friday, January 29, 2016 6:43 PM

All replies

  • @chireader,

    Please complete the following command:

    Get-AzureStorageAccount | ft StorageAccountName

    Does logistorageblob show up in the output?

    -Theo

    Wednesday, January 27, 2016 1:23 AM
  • What is the difference between Get-AzureRmStorageaccount vs. Get-AzureStorageAccount?

    Above Get-AzureRmStorageAccount returns logistorageblob.

    Get-AzureStorageAccount returns nothing.

    Wednesday, January 27, 2016 3:19 PM
  • Get-AzureStorageAcount gets the base storage accounts in your subscription.

    Where as Get-AzureRmStorageAccount only gets the storage account in your Resource Manager.

    The command: Set-AzureSubscription -SubscriptionName 'free trial' -CurrentStorageAccountName 'logistorageblob' that you are trying to use will only set the AzureStorageAccount, it is not aware of the  AzureRmStorageAccount.

    The fact that the logistorageblob account does not exist in your AzureStorageAccount is why it is returning the error ResourceNotFound.

    You need to use the commands available in the Resource Manager Modules, the following command will list all available commndlets:

    Get-Command -Module AzureRM.Resources | Get-Help | Format-Table Name, Synopsis

    The following links provide resources to assist with Resource Manager:

    Azure Resource Manager overview

    https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/

    Using Azure PowerShell with Azure Resource Manager

    https://azure.microsoft.com/en-us/documentation/articles/powershell-azure-resource-manager/

    Hope that helps,

    Theo

    Thursday, January 28, 2016 3:44 AM
  • The answer to my issue was that when I created my storage account, I used the string "blob" in the naming of the account.

    When I created a storage account without this string, everything works as expected.

    • Marked as answer by chireader Friday, January 29, 2016 6:44 PM
    Friday, January 29, 2016 6:43 PM