无法将用户分配给 Azure 应用注册中的新角色

Not able to assign user to new role in Azure App Registration

我有一个 Azure 应用程序注册,几周来一直运行良好。 Blazor Server App,查询用户角色,代码如下:

var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
        var user = authState.User;
        foreach (var claim in user.Claims.Where(x => x.Type == "roles"))

以前,AAD 应用程序注册定义了 3 个角色,但我现在添加了一个新的“App.Admin”角色:

如果我浏览应用程序注册的“企业应用程序”,那么我可以看到我的用户当前分配了旧角色:

我的问题是,我无法在创建新角色后的 30 分钟内分配它。

所以,我花了前 40 分钟想知道我是否做错了什么。然后我开始将这个 SO post 放在一起并注意到角色分配现在可用。

我决定发布此 post,希望它能帮助其他 运行 遇到同样问题的人。

微软知道这个问题吗?也许应该向 App Registrations\App 角色边栏添加一条警告消息?

我在我的测试环境中对多个租户进行了测试,它对我来说工作正常。据我所知,这不是 Microsoft 端的问题,因为 Azure AD 确实与成功操作的同步输出同步。

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.