DEV Community

Introducing azure.nvim: A Neovim Plugin for Azure Function Management π
If you're a Neovim user working with Azure Functions, you know the frustration of constantly switching between your editor and external tools just to manage application settings. While Visual Studio Code users enjoy a seamless experience with the Azure extension, terminal-based editors like Neovim have been left outβuntil now.
Enter azure.nvim, a lightweight Neovim plugin designed to bring Azure Function App management directly into your favorite editor. No more context switching, no more breaking your workflow.
The Problem: Workflow Interruptions
Working with Azure Function Apps often involves:
- Accessing application settings for local development
- Converting Azure settings to the
local.settings.json
format - Troubleshooting configuration issues without leaving your editor
For Neovim users, this typically means switching to the Azure Portal or Azure CLI in a separate terminal window, disrupting focus and productivity.
The Solution: azure.nvim
azure.nvim leverages the Azure CLI to fetch Function App settings and seamlessly converts them into the familiar local.settings.json
format. With just a few keystrokes, you can:
- Retrieve all application settings from any Azure Function App
- Generate a properly formatted
local.settings.json
file - View settings directly within a Neovim buffer
- Optionally decrypt sensitive settings (coming soon)
What's New in This Version
The latest release of azure.nvim includes several improvements:
- Better Error Handling: Improved validation and debugging for Azure CLI commands
- Interactive Settings: Prompts for Function App name and resource group
-
Proper JSON Formatting: Converts Azure settings to
local.settings.json
with ease - Multiple Output Options: View settings in a buffer or save directly to a file
- Improved Keybindings: Configurable shortcuts for all plugin functionality
Installation
You can install azure.nvim using your favorite plugin manager.
With Packer.nvim
use({
"edwinboon/azure.nvim",
config = function()
require("azure").setup({
decrypt = false, -- Enable to decrypt sensitive settings
keymaps = {
fetch_app_settings = "<leader>af", -- Customize keybinding
}
})
end,
})
With Lazy.nvim
require("lazy").setup({
{
"edwinboon/azure.nvim",
config = function()
require("azure").setup({
decrypt = false,
keymaps = {
fetch_app_settings = "<leader>af",
}
})
end,
},
})
How It Works
The plugin is built with a clean, modular architecture:
azure.nvim/
βββ lua/
β βββ azure/
β βββ fetch.lua # Core functionality for fetching settings
β βββ init.lua # Plugin setup and configuration
βββ README.md
βββ ...
When you trigger the fetch operation (default: <leader>af
), the plugin:
- Prompts for the Azure Function App name and resource group
- Constructs an Azure CLI command to fetch application settings
- Executes the command and captures the output
- Parses the JSON response and converts it to
local.settings.json
format - Displays the result in a new Neovim buffer and/or saves it to a file
Example Workflow
- Press
<leader>af
in normal mode - Enter the Azure Function App name when prompted
- Enter the resource group when prompted
- View the fetched settings in a new buffer
- Optionally edit or save the settings as needed
Behind the Scenes
The plugin uses the Azure CLI command az functionapp config appsettings list
to fetch settings. It processes the JSON output into this structure:
{
"IsEncrypted": false,
"Values": {
"Setting1": "Value1",
"Setting2": "Value2",
...
}
}
Future Enhancements
This is just the beginning for azure.nvim. Planned features include:
- Setting Decryption: Automatically decrypt sensitive settings
- Upload Capability: Push local settings back to Azure
- Multiple Function App Support: Save configurations for different apps
- Diff View: Compare local and Azure settings
- Azure Key Vault Integration: Directly access secrets from Key Vault
Requirements
- Neovim 0.5.0 or higher
- Azure CLI installed and configured (run
az login
) - Lua support in your Neovim configuration
Conclusion
If you're a Neovim user working with Azure Functions, azure.nvim can save you countless context switches and streamline your workflow. Say goodbye to jumping between your editor and the Azure Portal just to check configuration settings.
Give it a try and let me know what you think! Contributions, ideas, and feature requests are welcome on GitHub.
Happy coding! π
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)