Debug .NET isolated Azure Functions in Neovim with automatic process attachment and smart project detection.

vim.notify (optional)func CLI){
"fschaal/azfunc.nvim",
dependencies = { "mfussenegger/nvim-dap" },
config = function()
require("azfunc").setup({
mappings = {
start = "<leader>fs",
stop = "<leader>fS",
},
})
end,
}
use {
"fschaal/azfunc.nvim",
requires = { "mfussenegger/nvim-dap" },
config = function()
require("azfunc").setup()
end
}
Plug 'mfussenegger/nvim-dap'
Plug 'fschaal/azfunc.nvim'
Then in your init.lua:
require("azfunc").setup()
First, configure your .NET debugger with nvim-dap:
local dap = require("dap")
dap.adapters.coreclr = {
type = "executable",
command = "/path/to/netcoredbg",
args = { "--interpreter=vscode" },
}
require("azfunc").setup({
-- ⌨️ Key mappings
mappings = {
start = "<leader>fs", -- Start Azure Function
stop = "<leader>fS", -- Stop Azure Function
},
-- 🐛 Debug settings
debug = {
adapter_type = "coreclr", -- DAP adapter type
attach_retry_count = 20, -- Retry attempts
retry_interval = 2000, -- ms between retries
attach_timeout = 1000, -- Initial delay
},
-- 📟 Terminal settings
terminal = {
split = "vsplit", -- "vsplit", "split", or "tabnew"
size = nil, -- nil = default size
},
-- 🎨 UI settings
ui = {
notifications = true, -- Show notifications
spinner_preset = "default", -- "default", "dots", "arrows", "lines"
},
-- ⚙️ Azure Functions CLI
func_cli = {
command = "func",
args = "host start --dotnet-isolated-debug",
},
})
require("azfunc").setup()
require("azfunc").setup({
mappings = {
start = "<leader>af",
stop = "<leader>as",
},
})
require("azfunc").setup({
mappings = false,
})
-- Define your own
vim.keymap.set("n", "<F5>", require("azfunc").start)
vim.keymap.set("n", "<F6>", require("azfunc").stop)
require("azfunc").setup({
debug = {
attach_retry_count = 30,
retry_interval = 1500,
},
})
| Command | Description |
|---|---|
:AzFuncStart |
Start debugging (opens picker for multiple projects) |
:AzFuncStop |
Stop the current debug session |
:AzFuncList |
List all Azure Functions projects |
| Mapping | Action |
|---|---|
<leader>fs |
Start debugging |
<leader>fS |
Stop debugging |
-- Start with project picker
require("azfunc").start()
-- Start specific project
require("azfunc").start_from_path("/path/to/project")
-- Stop current session
require("azfunc").stop()
-- List all projects
local projects = require("azfunc").list_projects()
1. 🔍 Scan workspace for Azure Functions projects
2. 📋 Show project picker (if multiple found)
3. 📟 Open terminal for logs
4. ▶️ Start Azure Functions in debug mode
5. 🔎 Poll for .NET worker process
6. 🔌 Attach nvim-dap to the process
7. ✅ Ready to debug!
:lua require('dap').toggle_breakpoint()<leader>fs to start debugging<leader>fS when doneAlternative ways to stop:
<F5> (DAP continue) and then terminate the DAP session:lua require('dap').terminate() to stop the DAP session directlyMake sure you have nvim-dap installed and in your Neovim runtime path.
The plugin looks for .csproj files with <AzureFunctionsVersion>. Ensure:
.csproj has <AzureFunctionsVersion>v4</AzureFunctionsVersion>bin/ or obj/Common causes:
func --version)attach_retry_count in configStop the current session first with :AzFuncStop or <leader>fS.
Verify your DAP adapter configuration:
local dap = require("dap")
dap.adapters.coreclr = {
type = "executable",
command = "/path/to/netcoredbg",
args = { "--interpreter=vscode" },
}
Test with a simple .NET console app first.
Contributions are welcome! Here's how you can help:
MIT License - See LICENSE file for details
⭐ If you find this plugin useful, please star the repository!
☕ Like this plugin? Buy me a coffee!
💬 Questions or issues? Open an issue on GitHub!
Made with ❤️ for the Neovim community