Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 16, 2025

Overview

This PR adds comprehensive GitHub Codespaces support to the .NET AI Workshop, enabling users to run the entire lab in their browser without any local installation requirements. This addresses scenarios where users can't install Docker locally or encounter setup issues.

What's New

🚀 One-Click Launch

Users can now click a badge to launch a fully configured development environment:

Open in GitHub Codespaces

The Codespace automatically includes:

  • .NET 9.0 SDK with all required workloads
  • Docker-in-Docker for running Qdrant vector database
  • Azure CLI, Azure Developer CLI, and GitHub CLI
  • Microsoft.Extensions.AI.Templates pre-installed
  • VS Code extensions (GitHub Copilot, C# Dev Kit)
  • Part 2 starting solution pre-restored and ready to use

📁 Devcontainer Configuration

Added root-level .devcontainer/ folder with:

  • devcontainer.json: Configures the Codespace environment following .NET Aspire devcontainer best practices
  • post-create.sh: Automated setup script that runs after Codespace creation
  • README.md: Comprehensive documentation for Codespace users including secret management and troubleshooting

Port forwarding is pre-configured for the Aspire dashboard (port 18888 and range 15000-15004).

📖 Enhanced Documentation

Updated documentation throughout the workshop to guide Codespace users:

  • Main README: Added quick start section highlighting Codespaces as the fastest way to begin
  • Part 1 - Setup: Promoted Codespaces as the recommended option with clear benefits
  • Part 2 - Project Creation: Added CLI instructions for Codespace users alongside Visual Studio instructions

Key additions include:

  • How to set user secrets using dotnet user-secrets CLI
  • How to run the application from the terminal
  • How to manage GitHub tokens and Azure credentials in Codespaces
  • Troubleshooting guidance for Codespace-specific scenarios

Key Benefits

Zero local setup required - Start coding immediately in the browser
Solves Docker installation issues - Perfect for users who can't install Docker locally
Consistent environment - Everyone gets identical pre-configured setup
Ideal for workshops - Participants can be productive in minutes
Maintains flexibility - Existing local development workflows unchanged

Backward Compatibility

This PR maintains full backward compatibility:

  • Original devcontainer configurations preserved in .github/.devcontainer/
  • All existing local development workflows continue to work exactly as before
  • No changes to any project code or build configurations

Testing

  • ✅ All solutions build successfully (Part 2, Part 6, Part 7, Part 8)
  • ✅ Markdown linting passes for all documentation
  • ✅ Devcontainer JSON structure validated
  • ✅ Follows .NET Aspire devcontainer best practices

Closes #[issue-number]

Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for running the lab in GitHub Codespace</issue_title>
<issue_description>The lab should be able to run in GitHub Codespace. Use the documentation in https://learn.microsoft.com/en-us/dotnet/aspire/get-started/dev-containers. I believe we should have a starting solution folder that runs in Codespace and the users will be able to follow the steps in the lab for cases where they can't install Docker or have other setup issues.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #209


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 4 commits October 16, 2025 11:47
- Add root .devcontainer folder with devcontainer.json for Codespace support
- Create post-create.sh script to setup environment automatically
- Add comprehensive README for devcontainer configuration
- Update main README.md with Codespaces quick start section
- Update Part 1 Setup documentation to highlight Codespaces option
- Configure VS Code settings to default to Part 2 starting solution
- Setup port forwarding for Aspire dashboard (18888 and range 15000-15004)

Co-authored-by: jongalloway <[email protected]>
- Add CLI instructions for setting user secrets in Codespaces
- Document how to run the application from terminal in Codespaces
- Add section for managing secrets in Codespaces with environment variables
- Update Part 2 documentation to guide Codespace users through workflow
- Add troubleshooting notes specific to Codespaces environment

Co-authored-by: jongalloway <[email protected]>
- Add blank lines around lists and code blocks
- Use angle brackets for bare URLs
- Ensure proper spacing for markdown elements

Co-authored-by: jongalloway <[email protected]>
- Use markdown link format for better readability per code review feedback

Co-authored-by: jongalloway <[email protected]>
@Copilot Copilot AI changed the title [WIP] Add support for running the lab in GitHub Codespace Add support for running the lab in GitHub Codespaces Oct 16, 2025
@Copilot Copilot AI requested a review from jongalloway October 16, 2025 11:56
Copilot finished work on behalf of jongalloway October 16, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for running the lab in GitHub Codespace

2 participants