-
Notifications
You must be signed in to change notification settings - Fork 344
chore: add VS Code Azure Functions debug setup for gofuncapp #9315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
10a15d4
86c0274
a1bc3ea
9034ecd
2082dc8
d00ac9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ | |
| // for the documentation about the extensions.json format | ||
| "recommendations": [ | ||
| "streetsidesoftware.code-spell-checker", | ||
| "redhat.vscode-yaml" | ||
| "redhat.vscode-yaml", | ||
| "ms-azuretools.vscode-azurefunctions", | ||
| "golang.go" | ||
| ] | ||
| } | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This drops the trailing newline on a file that otherwise had one. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,24 +9,31 @@ | |
| // to ensure git tracks changes to this file again. | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| // If you set `AZD_DEBUG=true` in your environment, `azd` will pause early in start up and allow you to attach | ||
| // to it. Use the Attach to Process configuration and pick the corresponding `azd` process. | ||
| { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This drops the comment that explained |
||
| "name": "Attach to Process", | ||
| "type": "go", | ||
| "request": "attach", | ||
| "mode": "local", | ||
| "processId": "${command:pickGoProcess}" | ||
| }, | ||
| // This will launch azd cli (starting from cli/azd/main.go), under the debugger. | ||
| { | ||
| "name": "Debug azd cli", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "debug", | ||
| "program": "${workspaceFolder}/cli/azd", | ||
| "args": "${input:cliArgs}", | ||
| "console": "integratedTerminal", | ||
| "console": "integratedTerminal" | ||
| }, | ||
| { | ||
| "name": "Attach to Go Functions", | ||
| "type": "go", | ||
| "request": "attach", | ||
| "mode": "remote", | ||
| "host": "127.0.0.1", | ||
| "port": 2345, | ||
| "preLaunchTask": "func: host start", | ||
| "postDebugTask": "cleanup gofuncapp debug" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On the Core Tools version I tested, the second step never completes, it sits on the worker runtime prompt. No session means no That makes this more than the startup-failure path already raised on this line. It's the path you get by following the config exactly as written. Cleanup hung off the debug lifecycle can't cover setup that happens before the session exists. Copying the sample into a temp directory and pointing |
||
| } | ||
| ], | ||
| "inputs": [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,5 +4,9 @@ | |
| "-timeout", | ||
| "30m" | ||
| ], | ||
| "aspire.enableSettingsFileCreationPromptOnStartup": false | ||
| "aspire.enableSettingsFileCreationPromptOnStartup": false, | ||
| "azureFunctions.projectSubpath": "cli/azd/test/functional/testdata/samples/gofuncapp", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These three are committed workspace settings, so every contributor with the Functions extension installed gets azure-dev treated as a single Go Functions project rooted at a test fixture. The repo also has Could these move into a |
||
| "azureFunctions.projectLanguage": "Go", | ||
| "azureFunctions.projectRuntime": "~4", | ||
| "debug.internalConsoleOptions": "neverOpen" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies to every debug session in the repo, including the existing "Debug azd cli" config, so anyone debugging azd stops getting the debug console. |
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||
| { | ||||||
| "version": "2.0.0", | ||||||
| "tasks": [ | ||||||
| { | ||||||
| "label": "prepare gofuncapp debug", | ||||||
| "type": "shell", | ||||||
| "windows": { | ||||||
| "command": "cmd.exe /c \"if not exist go.mod copy /Y go.mod.txt go.mod >nul && if not exist go.sum copy /Y go.sum.txt go.sum >nul\"" | ||||||
|
Fernadoteixeira marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cmd.exe folds Line 36 has the same shape with I reproduced both on Windows. Wrapping each
Suggested change
Line 36 needs the same treatment: This is separate from the ownership question already raised on line 33. |
||||||
| }, | ||||||
| "osx": { | ||||||
| "command": "[ -f go.mod ] || cp go.mod.txt go.mod; [ -f go.sum ] || cp go.sum.txt go.sum" | ||||||
| }, | ||||||
| "linux": { | ||||||
| "command": "[ -f go.mod ] || cp go.mod.txt go.mod; [ -f go.sum ] || cp go.sum.txt go.sum" | ||||||
| }, | ||||||
| "problemMatcher": [], | ||||||
| "options": { | ||||||
| "cwd": "${workspaceFolder}/cli/azd/test/functional/testdata/samples/gofuncapp" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "type": "func", | ||||||
| "label": "func: host start", | ||||||
| "command": "host start", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I installed Core Tools 4.5.0 and ran Two things behind that. The fixture has no As a Did this launch for you locally? If it did, knowing your Core Tools version would help, because it doesn't on 4.5.0. Otherwise this needs a |
||||||
| "problemMatcher": "$func-golang-watch", | ||||||
| "isBackground": true, | ||||||
| "dependsOn": "prepare gofuncapp debug", | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That matters more than it looks. With The whole functional test package stops compiling until someone deletes it by hand, which is what the
|
||||||
| "options": { | ||||||
| "cwd": "${workspaceFolder}/cli/azd/test/functional/testdata/samples/gofuncapp" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "label": "cleanup gofuncapp debug", | ||||||
|
|
||||||
| "type": "shell", | ||||||
| "windows": { | ||||||
| "command": "cmd.exe /c \"if exist go.mod del go.mod & if exist go.sum del go.sum\"" | ||||||
| }, | ||||||
| "osx": { | ||||||
| "command": "rm -f go.mod go.sum" | ||||||
| }, | ||||||
| "linux": { | ||||||
| "command": "rm -f go.mod go.sum" | ||||||
| }, | ||||||
| "problemMatcher": [], | ||||||
| "options": { | ||||||
| "cwd": "${workspaceFolder}/cli/azd/test/functional/testdata/samples/gofuncapp" | ||||||
| } | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .venv | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
azd uses |
||
Uh oh!
There was an error while loading. Please reload this page.