Azure Functions Core Tools
$ func 官方出品 中风险Azure Functions Core Tools(func)可在本地运行 Node.js、Python、.NET、Java 与 PowerShell 触发器宿主,通过 func init 生成项目骨架,并使用 func azure functionapp publish 发布到云端(部分子命令支持 --no-interactive)。
brew install azure/functions/azure-functions-core-tools@4 func 直接在本地仓库运行无服务器宿主、读取 local.settings.json 并打包部署,MCP 无法替代本地运行时仿真。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持显式模板参数与部分命令的 --no-interactive,但缺少全局 --json 输出且 func start 为常驻阻塞进程。
func init/func newprompt interactively if runtime flags are omitted- No universal
--jsonflag across CLI output
本地脚手架与仿真风险较低,但 func azure functionapp publish 会覆盖线上函数应用,且 local.settings.json 常包含敏感连接串。
- Keep
local.settings.jsongitignored when runningfunc settings
体积较大(内嵌 .NET Functions 宿主运行时),支持 npm、Homebrew tap(azure/functions)及独立压缩包安装。
- Available via
npm install -g azure-functions-core-toolsand Homebrew tap
是本地仿真 Azure Functions 触发器/绑定及打包发布的官方必备工具。
- Only official local emulator for Azure Functions triggers and bindings
Microsoft 与 .NET Foundation 官方维护(Azure/azure-functions-core-tools),MIT 协议开源。
- Official Microsoft repository under MIT license
Microsoft Learn 提供完整的 v4 命令与参数参考。
- Official Core Tools command reference on Microsoft Learn
安全边界、鉴权与放权指南
本地运行时读取 local.settings.json(应加入 gitignore);发布到 Azure 时复用 Azure CLI(az login)凭证。
MIT 开源 CLI 免费;本地调试免费,发布操作会部署到计费的 Azure Function App。
# Azure Functions Core Tools (func) Agent Rules - Always pass explicit runtime/template flags to `func init` and `func new` to avoid interactive menus. - Run `func start` in a background task with a port check rather than blocking synchronously. - Never commit `local.settings.json` or run `func azure functionapp publish` without user approval.
Agent 高频安全命令配方
只读查询(安全推荐)
func --version
确认已安装的 v4 版本号是否符合项目要求。
受控写入与预演
func init my-func-app --python --model V2
显式传入 --python 与 --model,避免 func init 弹出交互式菜单阻塞。
核心优势
- + 高保真本地仿真 Python、Node.js、.NET 与 Java 的 Azure Functions 运行时。
- + 显式传入
--python/--typescript/--template可绕过交互式选择菜单。 - + 与 Azure CLI 登录态无缝衔接,直接驱动
func azure functionapp publish发布。
注意事项与踩坑点
- ! 缺少统一的
--json输出格式,输出以纯文本与日志为主。 - ! 安装包内含 .NET 运行时宿主,下载与磁盘占用偏大。