question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY]how to get role assignment with scope "/"

See original GitHub issue

Query/Question A clear and concise ask/query. Query/Question How can we help? how to get role assignment with scope “/”. It seems .RoleAssignments.ListByScopeAsyncor other method are not support scope “/”.

var tokenCredentials = new TokenCredentials(armToken);
                var authenticated = Azure
                    .Configure()
                    .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
                    .Authenticate(new AzureCredentials(
                        tokenCredentials,
                        tokenCredentials,
                        organizationId,
                        AzureEnvironment.AzureGlobalCloud));

                var roledefinition = await authenticated.RoleDefinitions.GetByScopeAndRoleNameAsync("/", BuiltInRole.UserAccessAdministrator.ToString());
                var roleAssignments = await authenticated.RoleAssignments.ListByScopeAsync("/");

now I can only get that from api: https://management.azure.com/providers/Microsoft.Authorization/roleAssignments?api-version=2015-07-01&$filter=principalId eq ‘***’ Why is this not a Bug or a feature Request? A clear explanation of why is this not a bug or a feature request?

Setup (please complete the following information if applicable):

  • OS: [e.g. iOS]
  • IDE : [e.g. IntelliJ]
  • Version of the Library used

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xseeseeseecommented, Aug 28, 2020
1reaction
xseeseeseecommented, Aug 14, 2020

@Emma0727 Thanks for sharing. You may try authenticated.RoleAssignments.Inner.ListByScopeAsync instead of authenticated.RoleAssignments.ListByScopeAsync. It would allow you to send with filters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

List Azure role assignments using the Azure portal
List role assignments at a scope · In the Azure portal, click All services and then select the scope. · Click the specific...
Read more >
Get-AzRoleAssignment (Az.Resources)
Use the Get-AzRoleAssignment command to list all role assignments that are effective on a scope. Without any parameters, this command returns all the...
Read more >
[QUERY]how to get role assignment with scope "/" #14127
I try to use another method to get role assginment: var roleAssignments = await authenticated.RoleAssignments.GetByIdAsync(roledefinition.Id);
Read more >
How to get the role assignments of a resource through ...
I want to use the Azure Resource Graph API to get the role assignments of a resource (who are owners, contributors, etc.). That...
Read more >
Get all role assignments of an Azure AD Principal
Apart from iterating through 50 subscriptions, fetching role assignments per scope and then comparing object id, is there any better way?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found