Skip to content

Get-AzureRmResourceGroup and Remove-AzureRmResourceGroup throws ArgumentException if resource does not exisit #1778

@hovsepm

Description

@hovsepm

Repro:

Get-AzureRmResourceGroup –Name 'CdvKeyVaultResourceGroup' –Location 'West US'
Get-AzureRmResourceGroup : Provided resource group does not exist.
At line:1 char:1
+ get-AzureRmResourceGroup –Name 'CdvKeyVaultResourceGroup' –Location ' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureRmResourceGroup], ArgumentException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.GetAzureResourceGroupCommand

Expected: Get[/Remove]-AzureRmResourceGroup should return an empty result if resource group does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMService AttentionThis issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions