azure-cli/doc/debug/debug_in_vs_code.md

1.3 KiB

Debug in Visual Studio Code

Prerequisite

  • Visual Studio Code Link
  • Visual Studio Code Python Extension Link
  • Python 3.6+
  • Set up development environment Link

Quick start

  1. Start VS Code at the root of the azure-cli source code folder.
  2. Switch to debug panel. (CMD + Shift + D)
  3. Select one of the debug configuration in the dropdown on top of the debug panel.
  4. Start debugging (Press F5 or click the play button)

Configuration

The launch.json under .vscode folder has already been pre-configured to enable execute az --help and break in to debug immediately. You can update it to execute the scenario you need.

  1. Set false to stopOnEntry property to break at the first break point you specified.
  2. Update the args array to run specified command. You need to make sure the arguments are split by space.
  3. Choose between external terminal and integrated terminal. The latter can be toggle by Ctrl + `

Reference