The error you're facing when testing the Azure OpenAI Studio deployment with a Teams app is often due to insufficient access control or misconfigured API credentials.
Since you've already assigned the "Cognitive Services OpenAI User" role, it's essential to ensure that the role is assigned at the correct scope, ideally at the resource level, and to verify that the principal (app or user identity) has the necessary permissions.
You may need to confirm that the API key in your config.json
file is from the Azure OpenAI service, not the Azure Search service, as they require different keys and roles.
If you're using VNET integration or private endpoints, ensure that your Teams app can access the OpenAI service through the correct network configurations, and there are no firewall or network restrictions.
You might also try assigning additional roles, like "Cognitive Services Contributor," to see if broader permissions resolve the issue.
Make sure that your API endpoint is correct and matches the OpenAI deployment region, and review detailed logs to get more insights into the cause of the error.
With these steps, you should be able to resolve the permission problem or uncover more details to troubleshoot further.