Skip to content

GitHub Copilot for Microsoft Teams fails with authorization error in meeting chats if repository is in another organizzation #4339

Description

@DevOpsStyle

Short summary

GitHub Copilot for Microsoft Teams fails with authorization error in meeting chats if repository is in another organizzation

Affected version or release

v1.1.0

Installation context

Microosft Teams

What happened?

Description

I am testing the GitHub Copilot integration with Microsoft Teams.

The issue appears to be specifically related to repositories owned by a GitHub organization.

If I use a repository owned by my personal GitHub account, GitHub Copilot works correctly from Microsoft Teams.

However, if I use a repository owned by a GitHub organization where I am a member — and in this case even an Owner — the Copilot session fails with an authorization error.

The repository can still be discovered and selected correctly from Teams, so repository discovery works. The failure happens only after the Copilot session is created and tries to access/use the organization-owned repository.

For example:

  • Personal repository under DevOpsStyle/... → works
  • Organization repository under DemosSE/GHCopilotDemo → fails

This happens even though:

  • I am an Owner of the DemosSE organization
  • I have full access to DemosSE/GHCopilotDemo
  • the repository can be selected successfully from Teams
  • the GitHub App is installed and authorized
  • Copilot Cloud Agent is enabled for the repository

When the failing session is opened on GitHub, the session is created successfully and shows:

This session is steered from Microsoft Teams

but then fails with:

Authorization error. Your credentials may be expired or invalid.

This strongly suggests that the issue may be related to the authorization flow used for organization-owned repositories, rather than to the user's personal GitHub credentials or repository access in general.

Steps to reproduce

Steps to reproduce

  1. Install and configure the GitHub Copilot integration for Microsoft Teams.

  2. Sign in to Teams with a GitHub account that:

    • owns at least one personal repository;
    • is also a member/owner of a GitHub organization.
  3. In Microsoft Teams, start a new meeting or open a shared/group conversation.

  4. Invoke @GitHub.

  5. Select a repository owned by the personal GitHub account, for example:

    DevOpsStyle/<personal-repository>

  6. Ask Copilot to analyze the repository, for example:

    Analyze this repository and explain what the application does.

  7. Confirm that the request completes successfully.

  8. In the same Teams context, run @GitHub again and select an organization-owned repository, for example:

    DemosSE/GHCopilotDemo

  9. Confirm that:

    • the DemosSE organization is visible in the repository picker;
    • GHCopilotDemo is visible and selectable;
    • Teams confirms that the repository is being used for the conversation.
  10. Ask the same type of question, for example:

    Analyze this repository and explain what the application does.

  11. Observe that the request fails with:

    You don't have access to that resource, or Copilot isn't authorized to use it.

  12. Open the failed Copilot session on GitHub using the link provided by Teams.

  13. Observe that:

    • the Copilot session has been created successfully;

    • the correct organization repository is associated with the session;

    • the page shows:

      This session is steered from Microsoft Teams

    • but the session fails with:

      Authorization error. Your credentials may be expired or invalid.

  14. Verify that the GitHub user used for the test is an Owner of the organization and has full access to the repository.

Repro result

Repository ownership Result
Personal account repository Works
Organization-owned repository Fails with authorization error

The issue is reproducible even when the same GitHub account has full access to both repositories.

Expected behavior

same output for both repository

Additional context

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions