Enable Azure Dev Spaces on an AKS cluster and install the client-side tools
Azure Dev Spaces is being retired and will stop working on October 31, 2023. Consider migrating to Bridge to Kubernetes.
This article shows you several ways to enable Azure Dev Spaces on an AKS cluster as well as install the client-side tools.
Enable Azure Dev Spaces using the CLI
Before you can enable Dev Spaces using the CLI, you need:
- An Azure subscription. If you don't have an Azure subscription, you can create a free account.
- The Azure CLI installed.
- An AKS cluster in a supported region.
use-dev-spaces command to enable Dev Spaces on your AKS cluster and follow the prompts.
az aks use-dev-spaces -g myResourceGroup -n myAKSCluster
The above command enables Dev Spaces on the myAKSCluster cluster in the myResourceGroup group and creates a default dev space.
'An Azure Dev Spaces Controller' will be created that targets resource 'myAKSCluster' in resource group 'myResourceGroup'. Continue? (y/N): y Creating and selecting Azure Dev Spaces Controller 'myAKSCluster' in resource group 'myResourceGroup' that targets resource 'myAKSCluster' in resource group 'myResourceGroup'...2m 24s Select a dev space or Kubernetes namespace to use as a dev space.  default Type a number or a new name: 1 Kubernetes namespace 'default' will be configured as a dev space. This will enable Azure Dev Spaces instrumentation for new workloads in the namespace. Continue? (Y/n): Y Configuring and selecting dev space 'default'...3s Managed Kubernetes cluster 'myAKSCluster' in resource group 'myResourceGroup' is ready for development in dev space 'default'. Type `azds prep` to prepare a source directory for use with Azure Dev Spaces and `azds up` to run.
use-dev-spaces command also installs the Azure Dev Spaces CLI.
Install the client-side tools
You can use the Azure Dev Spaces client-side tools to interact with dev spaces on an AKS cluster from your local machine. There are several ways to install the client-side tools:
- In Visual Studio Code, install the Azure Dev Spaces extension.
- In Visual Studio 2019, install the Azure Development workload.
- Download and install the Windows, Mac, or Linux CLI.
Remove Azure Dev Spaces using the CLI
To remove Azure Dev Spaces from your AKS cluster, use the
azds remove command.
azds remove -g MyResourceGroup -n MyAKS
The below example output shows removing Azure Dev Spaces from the MyAKS cluster.
$ azds remove -g MyResourceGroup -n MyAKS Azure Dev Spaces Controller 'MyAKS' in resource group 'MyResourceGroup' that targets resource 'MyAKS' in resource group 'MyResourceGroup' will be deleted. This will remove Azure Dev Spaces instrumentation from the target resource for new workloads. Continue? (y/N): y Deleting Azure Dev Spaces Controller 'MyAKS' in resource group 'MyResourceGroup' that targets resource 'MyAks' in resource group 'MyResourceGroup' (takes a few minutes)...
Any namespaces you created with Azure Dev Spaces will remain along with their workloads, but new workloads in those namespaces will not be instrumented with Azure Dev Spaces. In addition, if you restart any existing pods instrumented with Azure Dev Spaces, you may see errors. Those pods must be redeployed without Azure Dev Spaces tooling. To fully remove Azure Dev Spaces from your cluster, delete all pods in all namespaces where Azure Dev Spaces was enabled.
Learn more about how Azure Dev Spaces works.