Azure / Azure/azure-powershell
Get-AzApiManagementUser doesn't provide result if $filter parameter contains +
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
When the email prefix contains a '+', no result will return for the following command:
$apimUser = Get-AzApiManagementUser -Context $apimContext -Email $emailAddress
However, https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/user/list-by-service works fine and found that it is related to encoding URL. Manually, encoding the parameter value such as $encodedEmail=[System.Web.HttpUtility]::UrlEncode("abc+@contoso.com") before passing works good.
Is this expected? If so, we may need to add this to docs.
Expected behavior:
Provide results for the user with that specific email address.
Example:
Body:
{
"value": [
{
"id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.ApiManagement/service/xxx/users/abc-contoso-com",
"type": "Microsoft.ApiManagement/service/users",
"name": "abc-contoso-com",
"properties": {
"firstName": "ABC",
"lastName": "XYZ",
"email": "abc+@contoso.com",
"state": "active",
"registrationDate": "2023-06-12T16:37:32.647Z",
"note": null,
"identities": [
{
"provider": "Basic",
"id": "abc+@contoso.com"
}
]
}
}
],
"count": 1
}
### Script or Debug output
```PowerShell
Actual output:
Body:
{
"value": [],
"count": 0
}
```
### Environment data
_No response_
### Module versions
_No response_
### Error output
_No response_
Contributor guide
Research direction
Start at the Get-AzApiManagementUser cmdlet and reproduce the email filter behavior with an address containing '+'. Compare the request with the User - List By Service REST endpoint, then verify that the cmdlet returns the matching user without requiring callers to pre-encode the email.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, powershell
- Domain
- api, backend-api-design, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100