azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmStorageAccount:: Name parameter is ignored if ResourceGroup not supplied

Open wibblemonkey opened this issue 10 years ago • 3 comments

The Get-AzureRmStorageAccount cmdlet seems to ignore the -Name parameter if the ResourceGroup is not supplied.

I have three storage accounts X, Y and Z in two resource groups, A (X & Y) and B (Z):

# Returns X, Y and Z
Get-AzureRmStorageAccount

# Returns X & Y
Get-AzureRmStorageAccount -ResourceGroup A

# Returns Z
Get-AzureRmStorageAccount -ResourceGroup B

# Returns X
Get-AzureRmStorageAccount -ResourceGroup A -Name X

# Returns X, Y & Z
Get-AzureRmStorageAccount -Name X

wibblemonkey avatar Jan 20 '16 16:01 wibblemonkey

@bd4hjimp Thanks for the report - seems like it should either throw in this instance for insufficient parameters or filter by name. Will assign to the appropriate folks to take a look.

markcowl avatar Jan 20 '16 22:01 markcowl

Thanks @bd4hjimp for bringing this to us. It needs both resource group name and account name to fetch a particular account in ARM, only specifying -Name in Get-AzureRmStorageAccount should not be an available operation. We'll get the fix into the next release.

EmmaZhu avatar Mar 24 '16 02:03 EmmaZhu

You may want to try the newly released version and let us know if you have further questions.

vinjiang avatar May 06 '16 07:05 vinjiang