Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(vscode): add Azure Functions debug setup for gofuncapp sample
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
Fernadoteixeira and Copilot committed Jul 27, 2026
commit 10a15d4cf9042a5992ba2318d8a9d394dd690e00
12 changes: 5 additions & 7 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"streetsidesoftware.code-spell-checker",
"redhat.vscode-yaml"
]
}
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-python.python"
]
Comment thread
Fernadoteixeira marked this conversation as resolved.
Outdated
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This drops the trailing newline on a file that otherwise had one. tasks.json and the new .funcignore don't have one either. Worth adding back so the diff stays to the intended change.

15 changes: 11 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This drops the comment that explained AZD_DEBUG=true, which is how you get azd to pause at startup so "Attach to Process" has something to attach to. That isn't discoverable from the config itself. The comment above "Debug azd cli" was removed too. Can both go back? They're unrelated to the Functions work.

"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 Python Functions",
"type": "debugpy",
Comment thread
Fernadoteixeira marked this conversation as resolved.
Outdated
"request": "attach",
"connect": {
"host": "localhost",
"port": 9091
},
"preLaunchTask": "func: host start"
}
],
"inputs": [
Expand Down
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
"-timeout",
"30m"
],
"aspire.enableSettingsFileCreationPromptOnStartup": false
"aspire.enableSettingsFileCreationPromptOnStartup": false,
"azureFunctions.projectSubpath": "cli\\azd\\test\\functional\\testdata\\samples\\gofuncapp",
"azureFunctions.deploySubpath": "cli\\azd\\test\\functional\\testdata\\samples\\gofuncapp",
Comment thread
Fernadoteixeira marked this conversation as resolved.
Outdated
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.projectLanguageModel": 2
}
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I installed Core Tools 4.5.0 and ran func host start against a copy of this fixture with go.mod/go.sum copied in exactly the way the prepare task does. It never starts the host, it stops on an interactive prompt:

Use the up/down arrow keys to select a worker runtime:
1. dotnet (isolated worker model)
2. dotnet (in-process model)
3. Node
4. Python
5. Powershell
6. Custom

Two things behind that. The fixture has no local.settings.json, so FUNCTIONS_WORKER_RUNTIME is unset and Core Tools falls back to asking. And there's no Go entry in that list. Go runs through Custom, which needs a customHandler block in host.json with a defaultExecutablePath plus a build step to produce the binary, and gofuncapp/host.json only carries version and extensionBundle.

As a preLaunchTask with isBackground: true that prompt never gets answered, so the task hangs, Delve never listens on 2345, and "Attach to Go Functions" has nothing to attach to.

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 local.settings.json with the worker runtime plus host.json and build wiring for the Go worker before the profile can do anything.

"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "pip install (functions)",
"options": {
"cwd": "${workspaceFolder}/cli\\azd\\test\\functional\\testdata\\samples\\gofuncapp"
Comment thread
Fernadoteixeira marked this conversation as resolved.
Outdated
}
},
{
"label": "pip install (functions)",
"type": "shell",
"osx": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
Comment thread
Fernadoteixeira marked this conversation as resolved.
Outdated
},
"windows": {
"command": "${config:azureFunctions.pythonVenv}\\Scripts\\python -m pip install -r requirements.txt"
},
"linux": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.venv is a Python virtualenv directory and this is a Go sample, so it won't match anything here.

azd uses .funcignore as the packaging ignore file for function apps (cli/azd/pkg/project/service_target.go:144), so this is an edit to a functional-test fixture rather than contributor tooling, which sits awkwardly with "does not change azd runtime behavior" in the description. Is it needed at all? None of the other samples ship one.

Loading