I have an Azure App Registration that has been working ok for a few weeks. A Blazor Server App, queries the roles of the user with the following code:
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
foreach (var claim in user.Claims.Where(x => x.Type == "roles"))
Previously, the AAD App Registration had 3 roles defined, but I've now added a new "App.Admin" role:
If I browse the "Enterprise Application" for the app registration, then I can see that my user is currently assigned the old roles:
My problem is, I'm unable to assign the new role within 30 minutes of creating it.
So, I spent the first 40 minutes wondering if I was doing something wrong. Then I started putting this SO post together and noticed that the role assignment was now available.
I decided to publish this post in the hope that it help others that run into the same problem.
Is this a problem Microsoft are aware of? Maybe a warning message should be added to the App Registrations\App Roles blade?