In this post we are going to talk about how we can automate role assignment in CDS. While role assignment is rather seamless when sharing a Canvas App that uses CDS roles, it can become challenging in other scenarios like provisioning access for Dynamics 365 CE, Model Driven Apps and when you have Power Automate makers who need access to specific CDS entities.
Our solution utilizes the Common Data Service connector to retrieve metadata about our users and our security role(s). We then can use the Relate records action to link the security role to the user.
Shout out to James Oleinik and members of the Microsoft Power CAT team for their guidance on how to put this solution together.