Exercise - Set up GitHub Copilot to work with Visual Studio Code

Completed

In this exercise, we create a new repository using the GitHub template for a web API that uses the Python programming language.

Environment setup

First you need to launch the Codespaces environment, which comes preconfigured with the GitHub Copilot extension.

  1. Open the Codespace with the preconfigured environment in your browser.
  2. On the Create codespace page, review the Codespace configuration settings, and then select Create new codespace.
  3. Wait for the Codespace to start. This startup process can take a few minutes.
  4. The remaining exercises in this project take place in the context of this development container.

Important

All GitHub accounts can use Codespaces for up to 60 hours free each month with 2 core instances. For more information, see GitHub Codespaces monthly included storage and core hours.

Python Web API

When complete, Codespaces loads with a terminal section at the bottom. Codespaces installs all the required extensions in your container. Once the package installs are completed, Codespaces will execute the uvicorn command to start your web application running within your Codespace.

When the web application has successfully started, a message in the terminal Ports tab shows that the server is running on port 8000 within your Codespace.

Sign up for GitHub Copilot

If you haven't already, you need to register by setting up a free trial or subscription for your account.

Note

Educators, Students and select open-source maintainers can sign up for Copilot for free, learn how at Setting up GitHub Student and GitHub Copilot as an Authenticated Student Developer.