Skip to content

raffertyuy/github-copilot-extension-nodejs-azfunction-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-copilot-extension-nodejs-azfunction-starter

This is a simple GitHub Copilot Chat extension that simply echo's what you say. This sample is developed using Node.js and is to be deployed in Azure Functions. Also see:

Copilot Extension in VS Code Copilot Extension in GitHub.com

Tip

This extension is inspired by the basic tutorial video from @ambilykk. Do check it out!

Running and Debugging Locally

Pre-requisites:

  1. Azure Function Pre-requisites: check out the official documentation
  2. GitHub Debug CLI: see gh debug-cli

Run the app locally:

npm install
npm start #or `func start`

In a new terminal, use the gh debug-cli:

export URL="http://localhost:7071/api/ghcp-message" #if using Windows Command Prompt, use `set` instead of `export`

gh debug-cli

Deploying to Azure and Testing in GitHub.com

Deploy the Azure Function

  1. Open the project in VS Code
  2. Sign in to Azure: CTRL/Cmd + Shift + P > Azure: Sign In
  3. CTRL/Cmd + Shift + P > Azure Functions: Deploy to Function App

Add a new GitHub App

  1. Go to your GitHub Profile → Settings → Developer settings → New GitHub App
  2. Fill in the some initial values:
  • the GitHub App name is going to be the @agentname that you'll use in the GH Copilot Chat
  • for test purposes, you may disable/uncheck "Request user authorization (OAuth) during installation"
  1. Click Copilot from the navigation bar on the left
  • Change App Type to Agent
  • Change URL to the Function URL of your Azure Function
  • Change Inference description to the message you want your users to see on the chat box

New GitHub App New GitHub App - Copilot

Test the Agent Extension

  1. In GitHub.com, open the GitHub Copilot Chat window
  2. Type your @app-name Hi! and hit ENTER (Note: The agent won't show up until you do this for the first time)
  3. Start chatting!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published