An Azure service that provides an integrated environment for bot development.
The error indicates that the Azure AI project’s managed identity does not have sufficient permissions on the Azure AI resource itself. Specifically, the identity is missing the Microsoft.CognitiveServices/accounts/AIServices/agents/write data action, which is normally granted via the Azure AI User built‑in role.
To resolve this, assign the Azure AI User role to the project’s managed identity on the Azure AI resource:
- Identify the project managed identity
- In Azure portal, open the Azure AI project/resource referenced in the error.
- Under Identity, confirm the System-assigned or User-assigned managed identity that the project uses.
- Open Access control (IAM) for the Azure AI resource
- On the same Azure AI resource, go to Access control (IAM).
- Select Add → Add role assignment.
- Assign the Azure AI User role
- Role: choose Azure AI User.
- Assign access to: Managed identity.
- Select the project’s managed identity identified in step 1.
- Save the role assignment.
- Retry the bot in Teams
- After role assignment propagates (may take a few minutes), invoke the bot again in Teams.
- The authorization error should no longer occur if the correct identity and scope were used.
If the bot still fails, verify:
- The bot code is using that same managed identity to call the Azure AI project.
- There are no conflicting identities (for example, a different user-assigned identity on the App Service or Function hosting the bot).
References: