Based on the provided context, the error message "Principal does not have access to API/Operation" occurs when the principal (user or service principal) does not have the necessary permissions to access the API or operation. Since you are using a private VNet, it is possible that the necessary permissions are not set up correctly. You can try the following steps to resolve the issue:
- Ensure that your private VNet is correctly configured to allow traffic to and from the Azure OpenAI resource.
- Ensure that the principal (user or service principal) has the necessary permissions to access the API or operation. You can check the permissions by going to the Azure portal and navigating to the Azure OpenAI resource, then selecting "Access control (IAM)" and checking the role assignments for the principal.
- If the necessary permissions are not set up correctly, you can add the necessary role assignments to the principal to allow access to the API or operation.
References: