0

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:

enter image description here

If I browse the "Enterprise Application" for the app registration, then I can see that my user is currently assigned the old roles:

enter image description here

My problem is, I'm unable to assign the new role within 30 minutes of creating it.

enter image description here

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?

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
  • Is this not the thing with the async in Azure AD? It's there, but not yet propagated everywhere and thus not visible in certain places. – Marco Dec 09 '21 at 10:51
  • Could be, but if it's a problem they know about then I think a warning message would be helpful – Rob Bowman Dec 09 '21 at 10:52
  • It's not a problem if it is by design. :) For me, most roles are assigned very fast. But in some cases, well, you need to build in a piece of backoff code which checks if it's there or not. The backoff code is realy the only way i got my python code to work for things like role assignments and such. – Marco Dec 09 '21 at 10:54

1 Answers1

1

I tested in multiple tenants in my test environments, and it is working fine for me. AFAIK it is not issue from Microsoft end as Azure AD does sync with simultaneous output of successful operation.

enter image description here enter image description here enter image description here

Note : Sometimes browser cache may be the reason of this kind of issue. Would suggest you clear the Browers cache and do logout and login again in a portal or try in incognito mode and see it is working or not. If it is still the same issue please reach out to support they can better help here.

RahulKumarShaw
  • 4,192
  • 2
  • 5
  • 11