b75238c3f6
Update readme.md
Valet labs for Azure DevOps
This lab bootstraps a Valet environment using GitHub Codespaces and enables you to create an Azure DevOps project against which to run the Valet CI/CD migration tool.
- Use this Repo as a template
- Prerequisites
- Codespace secrets
- Action secrets
- Azure DevOps project creation
- Use Valet with a codespace
- Labs for Azure DevOps
Repo template
- Verify you are in your own Repository created from the landing page Valet Labs.
Prerequisites
- Azure DevOps organization. Please identify or create an Azure DevOps organization to use: Click to create an Azure DevOps Org
- Note and store the Azure DevOp sorganization name for later.
- Note and store the user name you use for your Azure DevOps Organization. It will be an email address.
- Azure DevOps Project. The default project name for this lab is
ValetBootstrapThere is an Action workflow that will create and populate the Azure DevOps project. No need to create it yourself. Note: The project has to be unique in the Azure DevOps organization. If you already have a project nameValetBootstrapplease pick a different unique project name.- Note and store the Azure DevOps project name for later.
- Create an Azure DevOps personal access token with the following scopes:
- To do so, navigate to Sign in to your organization
https://dev.azure.com/{yourorganization}. - Click your
Account managementicon - Click
user settings - Click
Personal access tokens. - Select
+ New Token - Name your token, select the organization where you want to use the token, and then set your token to automatically expire after a set number of days.
- Select the following scopes (Click
Show more scopesif you don't see all of the below):- Agents Pool:
Read - Build:
Read & Execute - Code:
Read & Write - Project and Team:
Read, Write, & Manage - Release:
Read - Service Connections:
Read - Task Groups:
Read - Variable Groups:
Read
- Agents Pool:
- Click
Create - Copy the PAT somewhere safe and temporary.
- To do so, navigate to Sign in to your organization
- Create a GitHub personal access token.
- To do so, navigate to your GitHub
Settings- click your profile photo and then clickSettings. - Go to
Developer Settings - Go to
Personal Access Tokens->Legacy tokens (if present) - Click
Generate new token->Legacy tokens (if present). If required, provide your password. - Select at least these scopes:
read packagesandworkflow. Optionally, provide a text in the Note field and change the expiration. - Click
Generate token - Copy the PAT somewhere safe and temporary.
- To do so, navigate to your GitHub
Codespace secrets
Please add the following Codespace secrets.
VALET_GHCR_PASSWORD: AddVALET_GHCR_PASSWORDas theNameand the GitHub personal access token created above as the value.AZURE_DEVOPS_ACCESS_TOKEN: AddAZURE_DEVOPS_ACCESS_TOKENas theNameand the Azure DevOps personal access token created above as the value.AZURE_DEVOPS_ORGANIZATION: AddAZURE_DEVOPS_ORGANIZATIONas theNameand the Azure DevOps organization noted above as the value.AZURE_DEVOPS_PROJECT: AddAZURE_DEVOPS_PROJECTas theNameand the Azure DevOps project noted above as the value.
Steps to create the Codespace secrets. Complete for secret noted above:
- Navigate to the
Settingstab in this repo - Find
Secretsand click the down arrow - Click
Codespaces - Click
New Repository Secretto create a new secret - Name the secret as noted above
- Paste in the value noted above
- Click
Add Secret
Action secrets
Please add the following Action secrets.
AZURE_DEVOPS_ACCESS_TOKEN: AddAZURE_DEVOPS_ACCESS_TOKENas theNameand the Azure DevOps personal access token created above as the value.
Steps to create the Actions secret. Complete for secret noted above:
- Navigate to the
Settingstab in this repo - Find
Secretsand click the down arrow - Click
Actions - Click
New Repository Secretto create a new secret - Name the secret as noted above
- Paste in the value noted above
- Click
Add Secret
Azure DevOps project creation
Run the Actions workflow:
- CLick the
Actionstab - Select the
Valet Bootstrap for Azure DevOpsaction - Click
Run Workflow - Input the Azure DevOps Organization name identified above
- Input the Azure DevOps user name of the user that created the Azure DevOps PAT above. This will be an email address
- Accept the default Azure DevOps project name or change it to one of your preference
- NOTE: The default project name is
ValetBootstrap. This must be unique in your Azure DevOps Organization. If not, please choose a unique name.
- NOTE: The default project name is
- Click
Run Workflow - Verify the workflow completed successfully. If the workflow did not run successfully you will see a detailed error message.
Example
Use Valet with a codespace
- Start the codespace
- Click the
Codewith button down arrow above repository on the repository's landing page. - Click the
Codespacestab - Click
Create codespaces on mainto create the codespace. If you are in another branch then themainbranch, the codespace will button will have the current branch specified. - Wait a couple minutes, then verify that the codespace starts up. Once it is fully booted up, the termininal should be present.
- Click the
- Verify Valet CLI is installed and working. More information on the GitHub Valet CLI extension
- Verify Valet CLI is installed and working
- Run
gh valet versionin the Visual Studio Code terminal and verify the output looks like the below image. Note the valet version will be different than below as the latest version gets pulled down.- If
gh valet versiondid not produce a similar image with a version please follow these instructions Troubleshoot GH Valet extension
- If
- Start using Valet by following along with the Labs for Azure DevOps
Example
Labs for Azure DevOps
Perform the following labs to test-drive Valet
- Audit Azure DevOps pipelines using the Valet audit command
- Dry run the migration of an Azure DevOps pipeline to GitHub Actions
- Migrate an Azure DevOps pipeline to GitHub Actions
- Migrate an Azure DevOps pipeline to GitHub Actions with a custom transformer
- Forecast: Valet forecast lab
Troubleshoot GH Valet extension
Manually Install the GitHub CLI Valet extension. More information on the GitHub Valet CLI extension
- Verify you are in the Visual Studio Code terminal
- Run this command to install the GitHub Valet extension
gh extension install github/gh-valet- Verify the result of the install is:
✓ Installed extension github/gh-valet - If you get a similiar error to the following, click the link to authorize the token
- Restart Codespace after clicking the link
- Verify Valet CLI is installed and working

