Hello Syed !
Thank you for posting on Microsoft Learn.
Have you verified if the principal has the necessary permissions assigned ?
From the error message, the permission required is Microsoft.CognitiveServices/accounts/OpenAI/deployments/embeddings/action
which should be granted either through a role assigned to the service principal or through custom RBAC.
The principal must have the appropriate Azure role for accessing OpenAI resources :
- Cognitive Services OpenAI User
- Cognitive Services Contributor
- Or a custom role that grants permission for OpenAI-related actions
Also, the service principal has access to the specific OpenAI deployment. If the principal does not have access to the deployment, the action will be blocked.