Blue Bridge
使用 Model Context Protocol (MCP) 服务器查询和管理 Azure 资源的示例提示和操作指南,支持零密钥认证。应用场景包括:
- Azure Managed Grafana
- Azure Data Explorer (Kusto)
- Azure Resource Graph
- Azure Resource Manager
认证通过已登录的 Azure CLI 账户或托管身份(Managed Identity)处理,无需存储密码或密钥。
✨ 演示
- 给定 'manual-for-ai.md',展示我可以关闭的 5 台虚拟机以节省成本。
!结果
- 给定 'manual-for-ai.md',帮助我找到可以关闭的 2 台虚拟机以节省成本。同时关闭它们。在执行此操作之前,请为每台虚拟机请求权限。
!结果
- 给定 'manual-for-ai.md',获取订阅 '3a7edf7d-1488-4017-a908-e50d0a1642a6' 的 CPU 配额。
!结果
🚀 快速开始
0 · 克隆仓库
克隆仓库以获取必要的文件,包括
manual-for-ai.md
中的操作指南和使用示例。1 · 运行容器
Blue Bridge 默认支持 Azure Resource Graph 和 Azure Resource Manager,无需额外配置。
如果需要连接 Azure Managed Grafana 或 Azure Data Explorer (Kusto),请在运行容器时设置相应的环境变量。
设置所需的环境变量并启动镜像:
如果仅需连接 Kusto:
或者不连接任何外部服务:
2 · 一次性认证
首次启动容器时,会打印设备代码提示,例如:
3 · 添加到 MCP 主机
4 · 运行快速测试
向 MCP 主机提问:
!结果
🔧 环境变量
变量 | 用途 | 是否必填 |
AzureManagedGrafanaEndpoint | Azure Managed Grafana 端点 URL | 否 |
KustoUri | Azure Data Explorer (Kusto) 集群 URI | 否 |
UseManagedIdentity | 设置为 true 以使用托管身份。 | 否 |
ManagedIdentityClientId | 要使用的托管身份的客户端 ID。 | 否 |
当
UseManagedIdentity
设置为 true
时,Blue Bridge 将尝试使用计算资源上可用的托管身份进行认证。如果只有一个托管身份(系统分配或用户分配),此操作将自动完成。如果计算资源有多个托管身份,必须通过设置
ManagedIdentityClientId
环境变量来指定要使用的托管身份的客户端 ID。请注意,设置 ManagedIdentityClientId
意味着使用托管身份,因此无需将 UseManagedIdentity
设置为 true
。📚 链接
- Author:waytomcp
- URL:https://www.waytomcp.com/article/Azure/blue-bridge
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!