Azure Bicep
$ bicep 官方出品 低风险Azure Bicep(bicep)可将简洁的 .bicep 基础设施代码编译为 ARM JSON 模板(bicep build),支持 ARM JSON 反编译(bicep decompile)、代码格式化以及通过 bicep lint 配合 --diagnostics-format Sarif 进行规则校验。
brew install azure/bicep/bicep bicep build 与 bicep lint 属于毫秒级确定性本地编译/静态检查步骤,无需网络往返即可验证修改。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
完全非交互、确定性执行,支持 --stdout 输出 ARM JSON 及 --diagnostics-format Sarif 结构化诊断。
- Supports
bicep build --stdoutand--diagnostics-format Sarif - Clean non-zero exit codes on syntax or lint errors
纯本地编译与静态分析工具,无云端部署副作用,仅 bicep publish 会写入远程模块仓库。
- Pure local compilation/linting via
build --stdoutandlint
提供 macOS、Linux、Windows 自包含原生二进制,可通过 Homebrew tap、winget 或 az bicep install 安装。
- Standalone
brew install azure/bicep/bicepand GitHub release binaries
是 Agent 编写 Azure IaC 在交给 az deployment 或 azd 前的核心快速校验环节。
- Fast local feedback loop for syntax, types, and best-practice rules
Microsoft 官方基础设施编译器(Azure/bicep),MIT 开源协议且月度持续更新。
- Official
Azure/biceprepository under MIT license
Microsoft Learn 文档详尽,本地 --help 说明清晰。
- Official Microsoft Learn Bicep CLI documentation
安全边界、鉴权与放权指南
离线编译无需任何凭证;发布或拉取私有模块仓库时复用 Azure CLI / Entra ID 凭证。
MIT 开源编译器完全免费;本身不直接部署产生费用的云资源。
# Azure Bicep Agent Rules - Run `bicep lint <file> --diagnostics-format Sarif` and `bicep build <file> --stdout` after editing `.bicep` files. - Pass `--no-restore` in air-gapped sandboxes. - Never run `bicep publish` to shared registries without explicit approval.
Agent 高频安全命令配方
只读查询(安全推荐)
bicep lint main.bicep --diagnostics-format Sarif
输出机器可读的 SARIF JSON 静态检查结果,不写入多余文件。
bicep build main.bicep --stdout
直接向 stdout 将 .bicep 编译输出为 ARM JSON,不污染工作区文件。
受控写入与预演
bicep format main.bicep
对本地 .bicep 文件应用官方标准格式。
核心优势
- +
bicep build --stdout可直接输出 ARM JSON 而不残留编译产物。 - +
--diagnostics-format Sarif提供结构化 JSON 诊断便于自动化解析。 - + 纯本地安全校验,零 Azure 云费用风险。
注意事项与踩坑点
- ! 引用外部模块仓库时需要网络与认证,离线沙箱需加
--no-restore。 - ! 仅负责编译与静态检查,实际部署仍需配合
az或azd。