[Client bug]: Error updating app registration with GB18030 character
Describe the bug Creating an app registration and publishing to Azure, the URL of the published site contains a GB18030 character https://xn--msi20230725123842-o72vta.azurewebsites.net
Using the GraphServiceClient SDK to update an app registration with the following redirect URI: I am attempting to run PatchAsync() to update a Microsoft.Graph.Models.Application object. The code looks like this:
var updatedApp = await graphServiceClient.Applications[remoteApp.Id].
PatchAsync(appUpdates)
where appUpdates is a Microsoft.Graph.Models.Application object, the field causing the error is this string:
"https://xn--msi20230725123842-o72vta.azurewebsites.net/signin-oidc"
which we want to add to the Application.Web.RedirectUris list
This call ends up throwing a Microsoft.Graph.Models.ODataErrors.ODataError exception, "One or more properties contains invalid values"
Related bug in Azure DevOps: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1860249/
Screenshots
Client version Microsoft.Graph 5.25.0
Thanks for raising this @zahalzel
Any chance you are able to share the other properties from the ServiceException i.e the request-id code and message to help understand the issue better?
@andrueastman Here are some more details from the exception: Microsoft.Graph.ServiceException Code: Request_BadRequest Message: One or more properties contains invalid values. date: 2023-07-28T19:15:08 request-id: afa39607-09c8-496c-b006-a0173f7fbc89
@andrueastman any updates on this one?
@andrueastman this is currently a compliance issue for VS, do you have an update?
@andrueastman Some more context on this, we are now using Microsoft.Graph version 5.25.0, so some of the code and the exception type has changed, but the issue is still unresolved.
I am attempting to run PatchAsync() to update a Microsoft.Graph.Models.Application object. The code looks like this:
var updatedApp = await graphServiceClient.Applications[remoteApp.Id].
PatchAsync(appUpdates)
where appUpdates is a Microsoft.Graph.Models.Application object.
The specific field that is causing an issue is the RedirectUris list, found in the Microsoft.Graph.Models.WebApplication here: https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/4c556b91c40bd1ff87500ce2916ade3ef11a79ed/src/Microsoft.Graph/Generated/Models/WebApplication.cs#L76
The element included in the list of RedirectUris is this: "https://xn--msi20230928124403-o72vta.azurewebsites.net/signin-oidc"
And the resulting exception is a Microsoft.Graph.Models.ODataErrors.ODataError, the Error message is as follows: "One or more properties contains invalid values."
Following up via https://portal.microsofticm.com/imp/v3/incidents/details/428378536/home
Closing this for now as the feedback is that the error is by design from the API side.