none
Azure Powershell get-azurermstoragegroup

    Question

  • I have multiple subscriptions in azure. My understanding of the get-azurermstoragegroup cmdlet is that it will return storage groups from the CURRENT subscription. For some reason when I run it is returning groups from another subscription. Not the one I have set as current and default in PowerShell.

    Any ideas ?

    Friday, December 4, 2015 8:12 PM

Answers

  • Hi,

    We suggest you to remove the current version of powershell from the control panel, programs and features. Then install the Azure RM Powershell 

    Then add your subscription to Azure RM powershell to start working on the cmdlets.

    Step 1: Add-azureaccount

    Step 2: Select-azuresubscription -subscriptionID/subscriptionname "Id/Name"

    Step 3: Get-azurermstorageaccount

    You get all the storage accounts which are created in Resource manager.

    Girish Prajwal

    • Marked as answer by BradHudon Wednesday, December 9, 2015 10:43 PM
    Wednesday, December 9, 2015 11:06 AM
    Moderator

All replies

  • Hello Brad,

    Thank you for contacting us. Can you try running the command again and confirm?

    PS C:\> Get-AzureSubscription

    and confirm if you have the below parameters set as true for the subscription that you are trying?

    IsDefault
    IsCurrent

    Could you share the o/p of "get-azurermstoragegroup" for the subscription that you get the results?

    Regards,

    Dipin Mathew.

    Saturday, December 5, 2015 4:52 PM
  • Hi Brad,

    Thanks for posting here.

    I don't see any documents related to get-azurermstoragegroup cmdlet for Azure Resource manager. Also, I oonly see 4 commands related to Azure storage for get-azurermstorage.

    get-azurermstorageaccount

    get-azurermstorageaccountkey

    get-azurermstoragenameavailability

    get-azurermstorageavailability

    Please check the cmdlets which you are using for now. Maybe this cmdlet could have removed.

    Girish Prajwal

    Saturday, December 5, 2015 4:56 PM
    Moderator
  • Sorry type. should have been "get-azurestorageaccount" . I am new to Azure powershell and I think I am not supposed to have both the Azure and AzureRM modules loaded in the same session but I believe it do. If u see below "get-azure..." returns the storage accounts however "get-azurerm..." returns nothing.

    I am also not sure if I have a "clean install" as I installed the Azure modules (windows 10) with the install-module cmdlet and I had errors. Ideally I would also like to "unstall" and "reinstall" them to ensure the install is not the problem but I don't know how to do this. 

    ### Enter Get-AzureStorageAccount
    PS C:\Users\Brad> Get-AzureStorageAccount

    Context                   : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
    StorageAccountDescription : bradtst
    AffinityGroup             :
    Location                  : East US
    GeoReplicationEnabled     :
    GeoPrimaryLocation        : East US
    GeoSecondaryLocation      : West US
    Label                     : bradtst
    StorageAccountStatus      : Created
    StatusOfPrimary           : Available
    StatusOfSecondary         : Available
    Endpoints                 : {https://bradtst.blob.core.windows.net/, https://bradtst.queue.core.windows.net/,
                                https://bradtst.table.core.windows.net/, https://bradtst.file.core.windows.net/}
    AccountType               : Standard_RAGRS
    StorageAccountName        : bradtst
    OperationDescription      : Get-AzureStorageAccount
    OperationId               : 7489876c-dfc8-3d68-ab2b-3694d52908ab
    OperationStatus           : Succeeded
    Context                   : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
    StorageAccountDescription :
    AffinityGroup             : Flex
    Location                  :
    GeoReplicationEnabled     :
    GeoPrimaryLocation        : West US
    GeoSecondaryLocation      :
    Label                     : nantero
    StorageAccountStatus      : Created
    StatusOfPrimary           : Available
    StatusOfSecondary         :
    Endpoints                 : {https://nantero.blob.core.windows.net/, https://nantero.queue.core.windows.net/,
                                https://nantero.table.core.windows.net/, https://nantero.file.core.windows.net/}
    AccountType               : Standard_LRS
    StorageAccountName        : nantero
    OperationDescription      : Get-AzureStorageAccount
    OperationId               : 7489876c-dfc8-3d68-ab2b-3694d52908ab
    OperationStatus           : Succeeded
    WARNING: GeoReplicationEnabled property will be deprecated in a future release of Azure PowerShell. The value will be
    merged into the AccountType property.

    ### Enter Get-AzureRmStorageAccount
    PS C:\Users\Brad> Get-AzureRmStorageAccount
    PS C:\Users\Brad>

    Saturday, December 5, 2015 7:13 PM
  • Hello Brad,

    This looks like you have not created a storage account using Azure Resource Manager(ARM) and is why if you switch to RM it didn't display any storage details for the command "Get-AzureRmStorageAccount"

    When you run the command "Get-AzureStorageAccount" it gave the Storage account details since it was created using Classic and the command returns the details correctly. This seems to be an expected behavior.

    I would recommend to create a new storage account using ARM and see if the command works for you.

    Regards,

    Dipin Mathew.

    Tuesday, December 8, 2015 7:06 PM
  • Hi,

    We suggest you to remove the current version of powershell from the control panel, programs and features. Then install the Azure RM Powershell 

    Then add your subscription to Azure RM powershell to start working on the cmdlets.

    Step 1: Add-azureaccount

    Step 2: Select-azuresubscription -subscriptionID/subscriptionname "Id/Name"

    Step 3: Get-azurermstorageaccount

    You get all the storage accounts which are created in Resource manager.

    Girish Prajwal

    • Marked as answer by BradHudon Wednesday, December 9, 2015 10:43 PM
    Wednesday, December 9, 2015 11:06 AM
    Moderator