Azure资源查询管理工具

Blue Bridge是一个通过Model Context Protocol (MCP)服务器查询和管理Azure资源的工具,支持零秘密认证,适用于Azure Managed Grafana、Azure Data Explorer等多种场景。

  • by Azure
  • 本地部署
  • 10 星标
  • 更新于
在 GitHub 查看 azure/blue-bridge

使用说明

蓝桥

使用模型上下文协议(MCP)服务器通过零秘密身份验证查询和管理Azure资源的示例提示和食谱。
场景包括:

  • Azure管理的Grafana
  • Azure数据浏览器(Kusto)
  • Azure资源图
  • Azure资源管理器

身份验证由登录的Azure CLI帐户或托管身份处理,不存储密码或密钥。


✨ 演示

  1. 给定“ai.md手册”,向我展示5个可以关闭机器以节省资金的虚拟机。

  2. 给定“ai.md手册”,帮我找到2个可以关闭以节省资金的虚拟机。请同时关闭它们。在执行此操作之前,请先征得每个VM的许可。

  3. 给定“ai.md手册”,请为我获取订阅“3a7edf7d-1488-4017-a908-e50d0a1642a6”的CPU配额


🚀快速启动

0·克隆存储库

克隆存储库以获取必要的文件,包括中的配方和使用示例 manual-for-ai.md.

git clone https://github.com/Azure/blue-bridge.git
cd blue-bridge

1·运行容器

蓝桥支架 Azure资源图 和 Azure资源管理器 开箱即用,无需任何额外配置。

要连接到 Azure管理的Grafana 或 Azure数据浏览器(Kusto),在运行容器时设置相应的环境变量。

设置所需的可选环境变量并启动映像:

docker run --name bluebridge -p 6688:6688 \
  -e AzureManagedGrafanaEndpoint=https://<my‑grafana>.wcus.grafana.azure.com \
  -e KustoUri=https://<my‑kusto>.westus2.kusto.windows.net \
  bluebridge.azurecr.io/bluebridge:latest

如果你只需要Kusto:

docker run --name bluebridge -p 6688:6688 \
  -e KustoUri=https://<my‑kusto>.westus2.kusto.windows.net \
  bluebridge.azurecr.io/bluebridge:latest

或者没有外部服务:

docker run --name bluebridge -p 6688:6688 \
  bluebridge.azurecr.io/bluebridge:latest

2·认证一次

首次启动时,容器会打印一个设备代码提示,例如:

To sign in, use a web browser to open the page https://microsoft.com/devicelogin
and enter the code ABCD‑EFGH to authenticate.

打开链接,输入代码,然后授予同意。
之后,服务器准备就绪 http://localhost:6688.

3·添加到您的MCP主机

{
  "mcpServers": {
    "blue-bridge": {
      "url": "http://localhost:6688/sse",
      "transportType": "sse",
      "timeout": 60,
      "disabled": false,
      "autoApprove": []
    }
  }
}

4·快速测试

询问您的MCP主机:

Given 'manual-for-ai.md', show me 5 VMs that I can turn off machines to save money.

🔧环境变量

变量 目的 必填
AzureManagedGrafanaEndpoint Azure托管Grafana端点URL 否
KustoUri Azure数据资源管理器(Kusto)群集URI 否
UseManagedIdentity 设置为 true 使用托管身份。 没有
ManagedIdentityClientId 要使用的托管标识的客户端ID。 没有

当 UseManagedIdentity 设置为 true,Blue Bridge将尝试使用计算资源上可用的托管身份进行身份验证。如果只有一个托管身份(系统分配或用户分配),则此功能会自动工作。

如果计算资源具有多个托管标识,则必须通过设置 ManagedIdentityClientId 将环境变量转换为所需托管身份的客户端ID。请注意,设置 ManagedIdentityClientId 意味着使用托管身份,因此设置 UseManagedIdentity 向 true 在这种情况下没有必要。


📚友情链接

  • 文档和示例:https://aka.ms/blue-bridge