It sounds like you may need to check the permissions assigned to your Microsoft Entra application. Ensure that the application has been assigned the appropriate role to access the Azure Communication Service resource. You can assign either a built-in role, such as the Communication and Email Service Owner role, or create a custom role with the necessary permissions, including Microsoft.Communication/CommunicationServices/Read, Microsoft.Communication/CommunicationServices/Write, and Microsoft.Communication/EmailServices/write.
Here are the steps to assign a built-in role:
- Navigate to the Azure Communication Service Resource in the Azure portal.
- Open Access control (IAM).
- Click +Add and then select Add role assignment.
- Choose the Communication and Email Service Owner role and select your Microsoft Entra application as a member.
- Confirm the assignment.
Make sure that the application has the necessary API permissions as well, specifically for sending emails, which includes permissions like Mail.Send.
If you have already set these up and are still facing issues, double-check the permissions and roles assigned to ensure everything is configured correctly.