This guide walks you through authenticating GitHub Copilot in Visual Studio Code to use it with your dimpoc project.
Before you begin, ensure you have:
- GitHub Account with an active Copilot subscription
- Individual Copilot subscription, OR
- Access through your organization/enterprise (GitHub Copilot Business/Enterprise)
- Visual Studio Code installed (latest version recommended)
- GitHub Copilot Extension installed in VS Code
If you haven't already installed the GitHub Copilot extension:
- Open Visual Studio Code
- Click on the Extensions icon in the left sidebar (or press
Ctrl+Shift+X/Cmd+Shift+X) - Search for "GitHub Copilot"
- Click Install on the "GitHub Copilot" extension by GitHub
- Optionally, also install "GitHub Copilot Chat" for chat-based assistance
-
Trigger Authentication Prompt
- After installing the extension, VS Code will automatically prompt you to sign in
- Alternatively, click the account icon in the bottom-left corner of VS Code
- Select "Sign in to use GitHub Copilot"
-
Authorize in Browser
- VS Code will open your default web browser
- You'll be directed to GitHub's authorization page
- Click Authorize Visual Studio Code to grant permission
-
Enter Device Code (if prompted)
- Sometimes GitHub will show you a device/user code
- Copy the code shown in VS Code
- Paste it in the browser window when prompted
- Click Continue and then Authorize
-
Return to VS Code
- Once authorized, the browser will show a success message
- Return to VS Code
- You should see a confirmation that GitHub Copilot is now active
- Open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type and select:
GitHub Copilot: Sign In - Follow the browser-based authentication steps above
- Click the Accounts icon (person icon) in the Activity Bar (bottom-left corner)
- Click Sign in with GitHub to use GitHub Copilot
- Follow the browser-based authentication steps above
To confirm GitHub Copilot is working:
-
Check Status Bar
- Look at the bottom-right corner of VS Code
- You should see the GitHub Copilot icon (looks like a Copilot logo)
- Click it to see status and settings
-
Test Code Completion
- Open any code file in your project (e.g.,
Program.cs) - Start typing a comment like
// Function to calculate - GitHub Copilot should suggest completions in gray text
- Press
Tabto accept a suggestion
- Open any code file in your project (e.g.,
-
Check Copilot Status
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type:
GitHub Copilot: Check Status - It should show "GitHub Copilot is ready"
- Open Command Palette (
- Check your subscription: Go to https://github.com/settings/copilot to verify your Copilot subscription is active
- Network issues: Ensure your firewall/proxy isn't blocking GitHub connections
- Sign out and sign back in:
- Command Palette →
GitHub Copilot: Sign Out - Command Palette →
GitHub Copilot: Sign In
- Command Palette →
- Manually open the URL:
- VS Code will show a notification with a device code
- Click the notification or copy the URL
- Open https://github.com/login/device in your browser manually
- Enter the device code shown in VS Code
- You need an active Copilot subscription:
- Individual: Sign up at https://github.com/github-copilot/signup
- Organization: Ask your GitHub organization admin to add you to the Copilot license
-
Check if Copilot is enabled:
- Click the Copilot icon in the status bar
- Ensure it's not disabled for the current file type or workspace
-
Check global settings:
- Open Command Palette →
Preferences: Open Settings (UI) - Search for "Copilot"
- Ensure
github.copilot.enableis checked for relevant languages
- Open Command Palette →
-
Reload VS Code:
- Command Palette →
Developer: Reload Window
- Command Palette →
Now that you're authenticated, you can use GitHub Copilot to help with the dimpoc project:
- Code Completion: Start typing and Copilot will suggest completions
- Comment-Driven Development: Write a comment describing what you want, and Copilot will suggest code
- Copilot Chat: Use the chat panel to ask questions about your code
- Inline Chat: Press
Ctrl+I/Cmd+Ito open inline chat for quick questions
- Open
Sanitizer.csorProgram.cs - Add a comment:
// Add a new sanitizer for email addresses - Press Enter and watch Copilot suggest implementation code
- Press
Tabto accept, or keep typing to see alternative suggestions
If you continue to experience issues:
- Check GitHub's status page: https://www.githubstatus.com/
- Review VS Code's Output panel (View → Output → select "GitHub Copilot")
- File an issue on the GitHub Copilot Discussion Board