Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-AzureRmApiManagementUser - Parameter set name 'Find users' is not supported #4510

Closed
sdwheeler opened this issue Aug 27, 2017 · 6 comments
Assignees
Labels
API Management Service Attention This issue is responsible by Azure service team.

Comments

@sdwheeler
Copy link
Member

sdwheeler commented Aug 27, 2017

Cmdlet(s)

Get-AzureRmApiManagementUser

Description

Reported by a user via LiveFyre:

When I use this command with just the context and email address, I get an error saying "Get AzureRmApiManagementUser : Parameter set name 'Find users' is not supported." Any idea why?

Reviewing the source code it looks like this is by design but the docs indicate this should work. We need to fix the code or change the documentation.

    public class GetAzureApiManagementUser : AzureApiManagementCmdletBase
    {
        private const string GetAll = "Get all users";
        private const string GetById = "Get user by ID";
        private const string FindBy = "Find users";

... 
// skipped lines

...

        public override void ExecuteApiManagementCmdlet()
        {
            if (ParameterSetName.Equals(GetAll))
            {
                var users = Client.UsersList(Context, null, null, null, null, null);
                WriteObject(users, true);
            }
            else if (ParameterSetName.Equals(GetById))
            {
                var user = Client.UserById(Context, UserId);
                WriteObject(user);
            }
            else
            {
                throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName));
            }
        }
...
@cormacpayne
Copy link
Member

@solankisamir Hey Samir, would you mind taking a look at this issue?

@durai89
Copy link

durai89 commented Oct 9, 2017

Do we have any fix for this issue? I am facing the same, unable to fetch user details by email address. - Thanks.

@cormacpayne
Copy link
Member

@solankisamir ping

@solankisamir
Copy link
Member

@cormacpayne yes I am aware of the issue.

@CodeStoneK
Copy link

I am trying this command to get users in a group and see the same error. Any ETA on the fix?

$members = Get-AzureRmApiManagementUser -Context $ApimContext -GroupId $groupId

solankisamir added a commit to solankisamir/azure-powershell that referenced this issue Oct 23, 2017
* Updated Cmdlet Get-AzureRmApiManagementUser to fix issue
Azure#4510
@solankisamir
Copy link
Member

Fix for the issue should be available with https://github.com/Azure/azure-powershell/milestone/31

@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Management Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants