Database-level role-based access control (RBAC) is indeed a feature that is intended to be supported in Azure DocumentDB, particularly when using Microsoft Entra ID for authentication. However, based on the error messages you are encountering, it appears that there may be some limitations or bugs in the current preview version of Azure DocumentDB regarding this functionality.
- Role Assignment Issues: The error message you received when trying to assign the
readWriterole to thecustomersdatabase indicates that the provided database for role assignment is not valid. This could suggest that thecustomersdatabase is not recognized in the context of your role assignment, or that there are restrictions in the preview version that are not well documented. - Role Creation Issues: The error from
mongoshregarding thereadWriterole being invalid also points to potential limitations in the role definitions available in the Azure DocumentDB environment compared to a standard MongoDB instance.
Given these issues, it is possible that database-level RBAC is not fully functional in the current preview of Azure DocumentDB, or that there are specific configurations or prerequisites that need to be met to enable this feature successfully.
To clarify your situation:
- Ensure that the
customersdatabase is created and accessible before attempting to assign roles to it. - Check if there are any specific requirements or limitations mentioned in the Azure documentation regarding role assignments in the preview version.
- It may also be beneficial to reach out to Azure support or forums for insights on whether this is a known limitation or bug in the preview.
In summary, while database-level RBAC is intended to be supported, your experience suggests that there may be issues in the current preview version that could be affecting its functionality.