Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Hello @Nishtha Kukreti,
When you notice a difference between how Copilot Studio works in the test environment and in Teams—especially when using SharePoint as a knowledge source—it’s usually due to differences in authentication, permissions, or configuration. Here’s an overview of the main reasons and solutions:
Possible causes:
- Authentication:
- During testing, your personal credentials are used to access SharePoint.
- In Teams, if authentication is set to "No authentication," the agent can't retrieve SharePoint content.
- Users in Teams must have the right authentication to access SharePoint data.
- In Teams, if authentication is set to "No authentication," the agent can't retrieve SharePoint content.
- During testing, your personal credentials are used to access SharePoint.
- SharePoint permissions:
- Teams users might not have the necessary read permissions on the SharePoint site.
- The agent’s service account or app registration might lack required access.
- Configuration differences:
- The SharePoint connection could be set up differently for Teams versus the test environment.
- Knowledge source settings might not match between test and production.
How to resolve:
- Enable Microsoft authentication for the agent:
- Go to Copilot Studio > Settings > Security > Authentication and select "Authenticate with Microsoft."
- This allows the agent to use the user's credentials in Teams to access SharePoint.
- Go to Copilot Studio > Settings > Security > Authentication and select "Authenticate with Microsoft."
- Check SharePoint permissions:
- Make sure all Teams users have read access to the SharePoint site.
- Confirm the site isn’t restricted to only certain users.
- Grant admin consent if required:
- Provide admin consent in Azure AD for the necessary permissions, such as Sites.Read.All, if you’re using Microsoft authentication.
- Republish the agent to Teams:
- After updating authentication, republish so the new settings take effect.
- Test with a user who has SharePoint access:
- Ensure users with the correct permissions receive the expected responses in Teams.
References: