Debugging your Cloud Run application
To debug your application, follow these steps:
- Use the Cloud Code status bar and select Debug on Cloud Run Emulator to run your application and attach a debugger session to it.
- This launches the Run/Debug on Cloud Run Emulator dialog where you can set the specifications for your configuration.
- Optionally, you can further customize how your application is run by specifying your environment variables and directly defining fields in your launch.json.
- Click 'Debug' to begin debugging your application.
For each debuggable container in your application, you'll be prompted to confirm or enter the directory in the remote container where the program you'd like to debug is found.
Alternatively, you can press ESC to skip debugging the container.
Cloud Code will attach a debug session for each debuggable container in the application.
Click in the editor margin of the file you are debugging to add a breakpoint.
Red filled circles denote active breakpoints, while gray hollow circles signify disabled breakpoints. For finer breakpoint control, you can use the Breakpoints section in VS Code's Debug view.
When you send a new request to your application, it will pause at that desired line.