Get-AzureRmResource : Parameter set cannot be resolved using the specified named parameters.
AzureRM version 1.5.1 Get resources by resource group does not work
PS C:\Users\user> Get-AzureRmResourceGroup ResourceGroupName : FTASRVaultRG Location : eastus ProvisioningState : Succeeded Tags : ResourceId : /subscriptions/6b6a59a6-e367-4913-bea7-34b6862095bf/resourceGroups/FTASRVaultRG
ResourceGroupName : mygroup2 Location : centralus ProvisioningState : Succeeded Tags : ResourceId : /subscriptions/6b6a59a6-e367-4913-bea7-34b6862095bf/resourceGroups/mygroup2
PS C:\Users\user> Get-AzureRmResource -ResourceGroupName mygroup2 Get-AzureRmResource : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1
- Get-AzureRmResource -ResourceGroupName mygroup2
-
- CategoryInfo : InvalidArgument: (:) [Get-AzureRmResource], ParameterBindingException - FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet
@vivsriaus can you take a look?
@abhishekanand this is not an issue with the cmdlet, this is by design. That said, we're currently evaluating options to list resources under a resource group, and to add support for this in one of our ARM cmdlets.
In the meantime, please use Find-AzureRmResource -ResourceGroupNameContains "myGroup" as a workaround. Cc/ @ravbhatnagar
#2307 , #2093
ResourceGroupName is a named parameter of Get-AzureRmResource and yet even when a Resource Group Name is explicitly given, it still results in:
` Get-AzureRmResource : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1
- Get-AzureRmResource -ResourceGroupName 'RESOURCE_GROUP_NAME'
-
- CategoryInfo : InvalidArgument: (:) [Get-AzureRmResource], ParameterBindingException - FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation. GetAzureResourceCmdlet `
Also, using the suggested technique of 'Find-AzureResource -ResourceNameContains' is not adequate. I don't want the resource group that CONTAINS that name, I want THAT, specific, resource group...
What is the ETA to resolve this bug?
This will be fixed in December release of PS. Exact name matches will be supported in Find cmdlet.
Exact name matches are now supported in the Find-AzureRmResource cmdlet through ResourceGroupNameEquals and ResourceNameEquals.
This is still an issue, the cmdlet still throws this error. I don't believe this is by design, more it may be by design because of a bug. The documentation in example # 2 clearly shows that this should be a viable use. Get-AzureRmResource documentation
Agree, I cannot get any of the examples in the Get-AzureRmResource documentation to do anything but throw error. For example:
Get-AzureRmResource -ResourceType Microsoft.Compute/virtualMachines | ft
Get-AzureRmResource : Parameter set cannot be resolved using the specified named parameters.
I have entered example #6 from the documentation exactly. None of the other examples work, either. If this is by design, please fix the documentation and show us how we are supposed to query resources. Note, the base command without parameters works, and lists all resources.
FWIW: the cmdlet window shows that "ByResourceNameAndType" has no required params, and indeed if you supply just name and type, it will fail for not knowing the group. If you use "ByNameGroupAndType" and supply all 3 values, the command works.
I will second that one from johnwc
Agree. Re-open.
@vivsriaus seems people are still having issues. Can you reopen and take a look?
+1 for re-opening
reopening, will investigate and get back. @Tiano2017 FYI.
I have same issue, got around it by using oDataQuery parameter.
Get-AzureRmResource -oDataQuery "`$filter=resourcegroup eq 'myrg'"
@COMikaze appreciate the workaround, but this issue is about getting it fixed and not finding a work around.
Yup, having the same problem when I use Get-AzureRmResource -ResourceType Microsoft.Web/sites
Please fix.
same.. but with $keyVault = Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupName $KeyVaultResourceGroupName -Location $region
Get-AzureRmKeyVault : Parameter set cannot be resolved using the specified named parameters. At line:1 char:13
- $keyVault = Get-AzureRmKeyVault -VaultName $VaultName -ResourceGroupN ...
Shouldn't this be a bigger issue since Find-AzureRmResource is removed now? I am not sure how this thread isn't blown up. Getting resources in a resource group seems like a basic.
Receiving this same error when attempting to find all SQL Azure Databases.
Get-AzureRmResource -ResourceType 'Microsoft.Sql/servers/databases'
Running version 6.11.0 of the Azure PowerShell module.
Facing this error while executing in runbook. Please help
Get-AzureRmKeyVault : Parameter set cannot be resolved using the specified named parameters. At line:13 char:10
- $value = Get-AzureRmKeyVault `
-
~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidArgument: (:) [Get-AzureRmKeyVault], ParameterBindingException
- FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.KeyVault.GetAzureKeyVault