Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 4.3 KB

how-vs-code-works-with-dev-spaces.md

File metadata and controls

56 lines (39 loc) · 4.3 KB
title services ms.date ms.topic description keywords
How Visual Studio Code works with Azure Dev Spaces
azure-dev-spaces
07/08/2019
conceptual
Learn how Visual Studio Code and Azure Dev Spaces help you debug and rapidly iterate your Kubernetes applications
Azure Dev Spaces, Dev Spaces, Docker, Kubernetes, Azure, AKS, Azure Kubernetes Service, containers

How Visual Studio Code works with Azure Dev Spaces

You can use Visual Studio Code and the Azure Dev Spaces extension to prepare, run, and debug your services with Azure Dev Spaces. With Visual Studio Code and the Azure Dev Spaces extension, you can:

  • Generate assets for running and debugging services in AKS
  • Run your Java, Node.js, and .NET Core services in a dev space
  • Directly debug your Java, Node.js, and .NET Core services running in a dev space

Generate assets

Visual Studio Code and the Azure Dev Spaces extension generate the following assets for your project:

  • Dockerfiles for Java applications using Maven, Node.js applications, and .NET Core applications
  • Helm charts for almost any language with a Dockerfile
  • An azds.yaml file, which is the Azure Dev Spaces configuration file for your project
  • A .vscode folder with the Visual Studio Code launch configuration of your project for Java applications using Maven, Node.js applications, and .NET Core applications

The Dockerfile, Helm chart, and azds.yaml files are the same assets generated when running azds prep. Those files can also be used outside of Visual Studio code to run your project in AKS, such as running azds up. The .vscode folder is only used by Visual Studio code to run your project in AKS from Visual Studio Code.

Run your service in AKS

After you generate the assets for your project, you can run your Java, Node.js, and .NET Core services in an existing dev space from Visual Studio Code. In the Debug page of Visual Studio Code, you can invoke the launch configuration from the .vscode directory to run your project.

You must create your AKS cluster and enable Azure Dev Spaces in your cluster outside of Visual Studio Code. You can reuse existing Dockerfiles, Helm charts, and azds.yaml files created outside of Visual Studio Code, such as the assets generated by running azds prep. If you do reuse assets generated outside of Visual Studio Code, you still need to have a .vscode directory. This .vscode directory can be regenerated by Visual Studio code and the Azure Dev Spaces extension and will not overwrite your existing assets.

For .NET Core projects, you must have the C# extension installed to run your .NET service from Visual Studio Code. Also for Java projects using Maven, you must have the Java Debugger for Azure Dev Spaces extension installed as well as Maven installed and configured to run your Java service from Visual Studio Code.

Debug your service in AKS

After you launch your project, you can debug your Java, Node.js, and .NET Core services running in a dev space directly from Visual Studio Code. The launch configuration in the .vscode directory provides the additional debugging information for running a service with debugging enabled in a dev space. Visual Studio Code also attaches to the debug process in the running container in your dev spaces, allowing you to set break points, inspect variables, and perform other debugging operations.

Use Visual Studio Code with Azure Dev Spaces

You can see Visual Studio Code and the Azure Dev Spaces extension working with Azure Dev Spaces in the following quickstarts: