I do not receive data when I attempt to fetch account records in a .NET 6 Console app connecting to Dataverse using Server-to-Server (S2S) authentication. If I put the Dataverse application-user (which is mapped to the AAD app registration) into the Basic User role, then no account records are returned, and no exception is thrown. However, if I put the Dataverse application-user into the System Administrator role, then the account records are returned. Presumably, a permission granted to the System Administrator role but absent from the Basic User role accounts for the discrepant behavior.
Since the Basic User role is granted user-level Create, Read, Write, etc. permissions on the Account entity, it is surprising (at least to this newbie) that no records are returned when the ServiceClient authenticated via S2S attempts to fetch them. Why are the records not returned? What other permissions are required beyond those granted in the Basic User role? I also encounter this same behavior if I create a dedicated security role for the application-user and grant it read permission on the account entity. Therefore, I conclude that some other permission is necessary to make this work. But which permission?