Skip to main content

GitHub Connector

Connect your GitHub repositories so the agent can read source code, search for errors, create issues, trigger workflows, and correlate deployments with incidents.

TL;DR
  • Two auth options: OAuth sign-in (recommended) or Personal Access Token (PAT)
  • Agent gets read access to your repositories - code search, file contents, and commit history
  • Can create GitHub Issues, comment on PRs, and trigger GitHub Actions workflows
  • One OAuth connector per agent - covers all repos you have access to

Auth types

MethodHow it worksBest for
OAuthSign in with your GitHub account in a browser popup. The agent accesses repos through your permissions. Tokens refresh automatically — no re-authentication needed.Interactive setup — recommended for most users
PATProvide a Personal Access Token with repo scope. Used when OAuth isn't available or for service account scenarios.CI/CD pipelines, headless environments
OAuth tokens refresh automatically

GitHub OAuth tokens expire after ~8 hours, but the agent refreshes them automatically before expiration using a 20-minute buffer. Each refresh generates a new refresh token, creating a self-sustaining renewal chain that lasts ~6 months. Your connector stays connected through long investigations and overnight scheduled tasks - no manual sign-in required.

When you'll need to re-authenticate: if the refresh token expires (~6 months), if you revoke the GitHub App authorization, or if your connector was set up before version 26.2.247.0 (one re-auth stores the refresh token and enables auto-refresh going forward).


What the agent can do with GitHub

Source code analysis

  • Search code across all connected repositories
  • Read file contents by path and branch
  • Correlate errors with source code - map Azure resource errors to specific files and line numbers
  • Semantic code search - find code related to an incident using natural language queries
  • Identify IaC files - detect Bicep, Terraform, and ARM templates in your repos

Issue and PR management

  • Create issues with title, body, labels, and assignees
  • Comment on issues and PRs - including auto-close keywords
  • Update issues - change title, body, labels, or state
  • Fetch Dependabot alerts - review security vulnerabilities

Workflow automation

  • Trigger GitHub Actions workflows - dispatch canary or production deployments
  • Track workflow runs - monitor status of dispatched workflows
  • Check PR merge status - verify if a pull request has been merged

Create pull requests (preview)

Your agent can create pull requests in your GitHub repos directly from chat. During an investigation, the agent identifies a fix and opens a PR — no tab switching required.

  • Auto-detects GitHub from the repository URL
  • Uses your existing OAuth or PAT credentials — no re-authentication
  • Returns a clickable link to the created PR in the chat
  • Requires Review or Autonomous run mode — blocked in ReadOnly mode

Example prompt: "Create a PR in https://github.com/contoso/webapp from fix/timeout to main titled 'Fix connection timeout'"

The agent extracts the repository URL, branch names, and title from your request. If any details are missing, it asks follow-up questions.


Manage authentication (preview)

View, edit, or disconnect your GitHub credentials without removing repositories. Navigate to Builder → Knowledge Sources → Repository Auth.

ActionWhat happens
View statusSee whether GitHub is connected, the auth method in use, and when the token expires
EditSwitch between OAuth and PAT, or paste a new PAT — existing repositories stay connected
DisconnectRemove credentials without deleting repositories — reconnect later to restore access

This means you can rotate an expiring PAT in 30 seconds instead of deleting and re-adding all your repositories.


Get started

ResourceWhat you'll learn
Connect Source CodeStep-by-step guide for connecting GitHub repositories with OAuth, PAT, or MCP

CapabilityWhat it adds
Root Cause AnalysisHow source code context improves investigation accuracy
Workspace ToolsFile operations and code execution in the agent's workspace
MCP ConnectorsConnect the GitHub MCP server for additional tool capabilities
Was this page helpful?