AZ-400: Designing and Implementing Microsoft DevOps Solutions

Work with Azure Repos and GitHub

Innovating with GitHub Codespaces

Discover how GitHub Codespaces provides a cloud-based, flexible, and secure IDE that adapts to any workflow. Whether you’re collaborating on open source or scaling enterprise projects, Codespaces streamlines setup and accelerates development.

What Is GitHub Codespaces?

GitHub Codespaces is a fully managed, cloud-hosted development environment that brings Visual Studio Code to your browser or local VS Code client. It eliminates local machine setup and offers:

  • Preconfigured containers defined by a devcontainer.json
  • Instant, on-demand workspaces that spin up in seconds
  • Native GitHub integration for branch management, pull requests, and issue tracking

Getting Started with Codespaces

  1. Install the GitHub CLI:
    brew install gh       # macOS
    sudo apt install gh   # Debian/Ubuntu
    
  2. Authenticate:
    gh auth login
    
  3. Create a new Codespace:
    gh codespace create --repo your-org/your-repo --branch main
    
  4. Open in VS Code (locally or browser):
    gh codespace code
    

Note

You can customize your environment by adding a .devcontainer/devcontainer.json file in your repo. See Developing inside a Container for examples.

Key Advantages of Using Codespaces

FeatureBenefitExample CLI Command
Eliminate Legacy LimitationsBypass outdated hardware or OS constraintsgh codespace list
Enhanced FlexibilityCode from any device with a browser-based editorAccess via https://github.com/codespaces
Robust Security ControlsSecure workspaces with built-in GitHub authenticationIntegrated secrets and permission scopes
Familiar IDE ExperienceSame look-and-feel as VS CodeUse extensions and settings sync
Device-Agnostic AccessNo local setup; works on Windows, macOS, Linux, iPadSupports SSH and VS Code Remote
Local VS Code IntegrationSeamlessly connect local VS Code to remote CodespaceRemote-SSH: Connect to Host… in Command Palette (Ctrl+Shift+P)

Warning

Running Codespaces incurs cloud compute costs. Be sure to review your billing settings and stop idle codespaces to avoid unexpected charges.

How It Works

  1. Container Configuration
    Codespaces uses Docker containers defined by a devcontainer.json. This specification ensures consistent tooling and dependencies across your team.

  2. Instant Provisioning
    When you open a codespace, GitHub automatically builds your container image, checks out your code, and applies pre-defined tasks.

  3. Integrated Tooling
    Enjoy built-in support for terminals, debugging, extensions, and Git operations—just like in your local VS Code.

Watch Video

Watch video content

Previous
Transitioning from TFVC to Git