Solution for Find out if Azure AD user has role assignment for a specific Azure Storage Account ADLS Gen2 container?
is Given Below:
Have Azure Storage account with ADLS Gen2 containers. The permissions for users get added by code but what it does is go to the storage container > Access Control (IAM) > Roles > Storage Blob Data Contributor > Then adds a user, group, or service principle.
Is there an easy way via python to be able to check if a user or service principle is in a specific role (such as Storage Blob Data Contributor) for a specific container?
I’ve attached a screenshot of the screen in azure that I’m wanting to replicate the functionality it does in python.
I’ve tried Role Assignments – List For Scope with a filter but it does not seem to return the same.
One of the options you could try is using the Rest API Get Container ACLs. This will provide you a list of the the entities who have access to the container. You can run a quick search in this list to verify the access.
I couldn’t find anything similar in the Python SDK.