是否缺少Azure RBAC与Power外壳之间的任何权限?
原学程将引见能否缺乏Azure RBAC与Power外壳之间的所有权力?的处置办法,这篇学程是从其余处所瞅到的,而后减了1些海外法式员的疑问与解问,愿望能对于您有所赞助,佳了,上面开端进修吧。
成绩描写
PowerShell敕令‘az Role Assignment List--assignee User@Company.com--all’在PowerShell中供给成果,但是对于以下代码片断出有成果。
TokenCredential azureCliCredential = new AzureCliCredentialBuilder().build();
GraphServiceClient<Request> graphClient = GraphServiceClient.builder().authenticationProvider(new TokenCredentialAuthProvider(azureCliCredential)).buildClient();
AppRoleAssignmentCollectionPage appRoleAssignments = graphClient.users("objectid of user@company.com").appRoleAssignments().buildRequest().get();
System.out.println(appRoleAssignments);
推举谜底
它没有起感化的缘由是您正在测验考试的二件工作在一路是为了分歧的工作。
'az role assignment list --assignee user@company.com --all'
将夺取Azure RBAC脚色分派,即分派给用户用于治理Azure定阅的脚色。
然则,AppRoleAssignmentCollectionPage appRoleAssignments = graphClient.users("objectid of user@company.com").appRoleAssignments().buildRequest().get();
夺取为Azure AD中的运用法式分派给用户的脚色。
若要应用代码夺取Azure RBAC脚色分派,您须要应用Azure SDK for Java
佳了闭因而可缺乏Azure RBAC与Power外壳之间的所有权力?的学程便到这里便停止了,愿望趣模板源码网找到的这篇技巧文章能赞助到年夜野,更多技巧学程不妨在站内搜刮。