Forum Discussion
Graph Client Application[xx].PatchAsync not working as expected
I am experiencing a problem with the Graph API client Microsoft.Graph (5.104.0) not updating the IdentifierUrls when we call client.Application[xx]PatchAsync(applicationObject)
This code in our system has not changed but around 10 days ago started failing.
We use the graph API to have our system create app registrations for our customers apps, we do this
var app = await Client.Applications.PostAsync(new Microsoft.Graph.Models.Application
{
DisplayName = "SOME APP NAME"
});
We then need to set the identifier URL, which we do like this
var application = new Microsoft.Graph.Models.Application
{
IdentifierUris = new List<string> { $"https://{_graphApiOptions.TenantName}/{app.AppId}" },
Api = new ApiApplication { RequestedAccessTokenVersion = 2 }
};
await Client.Applications[app.Id].PatchAsync(application);
We are seeing app registrations being created but the Identifier URL is not set, no exceptions, nothing to indicate failure, its just not setting it.
The above code is simplified, we have a retry process where we will do a get and check the registration and then try the patch again if its not worked (with a delay between these operations.
As I said, our app has not changed (Other than updating to a newer version of the client as we were a bit behind).
I know we *could* set the identifier URL in the initial post however that would cause problems with consistency as we have thousands of customers with their apps client ID in the Identifier URL, its in all of our onboarding emails and is referenced in our docs - if we change the format now its going to be a massive issue as we will need to update all of our support docs and processes for the new format so we want to avoid this where possible.