az codespace

Manage Visual Studio Codespaces.

Commands

az codespace create

Create a Codespace.

az codespace delete

Delete a Codespace.

az codespace list

List Codespaces.

az codespace location

Information on available regions.

az codespace location list

List available regions.

az codespace location show

Show details of a region.

az codespace open

Open a Codespace in the web browser.

az codespace plan

Manage Codespace plans.

az codespace plan create

Create a Codespace plan.

az codespace plan delete

Delete a Codespace plan.

az codespace plan list

List Codespace plans.

az codespace plan show

Show details of a Codespace plan.

az codespace resume

Resume a Codespace.

az codespace secret

Manage plan secrets.

az codespace secret create

Create a plan secret.

az codespace secret delete

Delete a plan secret.

az codespace secret list

List plan secrets.

az codespace secret update

Update a plan secret.

az codespace set-config

Set configuration for codespace commands.

az codespace show

Show details of a Codespace.

az codespace show-config

Show current configuration for codespace commands.

az codespace suspend

Suspend a Codespace.

az codespace update

Update a Codespace.

az codespace create

Create a Codespace.

az codespace create --name
                    --plan
                    [--dotfiles-command]
                    [--dotfiles-path]
                    [--dotfiles-repo]
                    [--git-repo]
                    [--git-user-email]
                    [--git-user-name]
                    [--instance-type]
                    [--resource-group]
                    [--suspend-after {120, 30, 5, 60}]

Examples

Create a Codespace with default plan settings

az codespace create -g my-rg --plan my-plan --name my-codespace

Create a Codespace with a different instance type with custom suspend time

az codespace create -g my-rg --plan my-plan --name my-codespace --instance-type premiumLinux --suspend-after 5

Create a Codespace with a git repo

az codespace create -g my-rg --plan my-plan --name my-codespace --git-repo https://github.com/github/repo --git-user-name "User Name" --git-user-email user@example.com

Create a Codespace with a dotfiles repo

az codespace create -g my-rg --plan my-plan --name my-codespace --dotfiles-repo https://github.com/github/dotfiles --dotfiles-path ~/dotfiles --dotfiles-command bootstrap.sh

Required Parameters

--name -n

Name of the Codespace.

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--dotfiles-command

The command we'll run after cloning your dotfiles repository.

--dotfiles-path

Path where you expect your dotfiles repository to be cloned into the Codespace.

--dotfiles-repo

Url of dotfiles git repository. More info: https://aka.ms/vso-docs/reference/personalizing.

--git-repo

Url of the git repository we'll clone into the Codespace.

--git-user-email

Git user email. For example, the output of git config user.email.

--git-user-name

Git username. For example, the output of git config user.name.

--instance-type

Instance Type.

value from: az codespace location show
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--suspend-after

Automatically suspend the inactive Codespace after this many minutes.

accepted values: 120, 30, 5, 60

az codespace delete

Delete a Codespace.

az codespace delete --plan
                    [--id]
                    [--name]
                    [--resource-group]
                    [--yes]

Examples

Delete a Codespace given name

az codespace delete -g my-rg --plan my-plan --name my-codespace

Delete a Codespace given id

az codespace delete -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000

Delete a Codespace given plan id and Codespace name

az codespace delete --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--id

Id of the Codespace.

--name -n

Name of the Codespace.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--yes -y

Do not prompt for confirmation.

az codespace list

List Codespaces.

az codespace list --plan
                  [--all]
                  [--resource-group]

Examples

List Codespaces

az codespace list -g my-rg --plan my-plan

List Codespaces given plan id

az codespace list --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--all

Include the Codespaces of other users. You may not have access to connect or modify these other Codespaces.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az codespace open

Open a Codespace in the web browser.

Confirmation is required if the Codespace is not in the 'Available' state as opening a Codespace will automatically resume it.

az codespace open --plan
                  [--id]
                  [--name]
                  [--resource-group]
                  [--yes]

Examples

Open a Codespace given name

az codespace open -g my-rg --plan my-plan --name my-codespace

Open a Codespace given id

az codespace open -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000

Open a Codespace given plan id and Codespace name

az codespace open --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--id

Id of the Codespace.

--name -n

Name of the Codespace.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--yes -y

Do not prompt for confirmation.

az codespace resume

Resume a Codespace.

az codespace resume --plan
                    [--id]
                    [--name]
                    [--resource-group]

Examples

Resume a Codespace given name

az codespace resume -g my-rg --plan my-plan --name my-codespace

Resume a Codespace given id

az codespace resume -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000

Resume a Codespace given plan id and Codespace name

az codespace resume --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--id

Id of the Codespace.

--name -n

Name of the Codespace.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az codespace set-config

Set configuration for codespace commands.

az codespace set-config [--clear]
                        [--domain]
                        [--rp]

Optional Parameters

--clear

Clear current configuration to return to defaults.

--domain

Service domain to use.

--rp

Resource Provider API version to use.

az codespace show

Show details of a Codespace.

az codespace show --plan
                  [--id]
                  [--name]
                  [--resource-group]

Examples

Show details of a Codespace given name

az codespace show -g my-rg --plan my-plan --name my-codespace

Show details of a Codespace given id

az codespace show -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000

Show details of a Codespace given plan id and Codespace name

az codespace show --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--id

Id of the Codespace.

--name -n

Name of the Codespace.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az codespace show-config

Show current configuration for codespace commands.

az codespace show-config

az codespace suspend

Suspend a Codespace.

az codespace suspend --plan
                     [--id]
                     [--name]
                     [--resource-group]

Examples

Suspend a Codespace given name

az codespace suspend -g my-rg --plan my-plan --name my-codespace

Suspend a Codespace given id

az codespace suspend -g my-rg --plan my-plan --id 00000000-0000-0000-0000-000000000000

Suspend a Codespace given plan id and Codespace name

az codespace suspend --plan /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Codespaces/plans/my-plan --name my-codespace

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--id

Id of the Codespace.

--name -n

Name of the Codespace.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az codespace update

Update a Codespace.

az codespace update --plan
                    [--id]
                    [--instance-type]
                    [--name]
                    [--resource-group]
                    [--suspend-after {120, 30, 5, 60}]

Examples

Update a Codespace with a different instance type

az codespace update -g my-rg --plan my-plan --name my-codespace --instance-type premiumLinux

Update a Codespace with a different suspend after

az codespace update -g my-rg --plan my-plan --name my-codespace --suspend-after 30

Required Parameters

--plan -p

Name or ID of the Codespace plan.

Optional Parameters

--id

Id of the Codespace.

--instance-type

Instance Type.

--name -n

Name of the Codespace.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--suspend-after

Automatically suspend the inactive Codespace after this many minutes.

accepted values: 120, 30, 5, 60