首页
/ Azure Durable Functions 监控工具安装与配置指南

Azure Durable Functions 监控工具安装与配置指南

2025-04-18 18:26:01作者:曹令琨Iris

1. 项目基础介绍

Azure Durable Functions 监控工具(DurableFunctionsMonitor)是一个开源项目,旨在为 Azure Durable Functions 提供一个用户友好的监控和调试界面。通过此工具,开发者可以轻松查看和管理他们的 orchestrations 和活动函数。该项目主要使用 TypeScript 和 C# 编程语言。

2. 关键技术和框架

  • TypeScript: 用于编写客户端用户界面。
  • C#: 用于实现后端服务,该服务在 .NET 环境中运行。
  • React: 客户端 UI 是一个使用 React 框架编写的单页面应用。
  • Durable Task Framework: 支持在 Azure Functions 中创建有状态的函数。
  • Azure Functions: 服务器less 计算服务,用于运行后端服务。

3. 安装和配置准备工作

在开始安装之前,请确保您的开发环境中安装以下软件:

  • Node.js 和 npm(用于安装前端依赖)
  • .NET Core SDK(用于构建和运行 .NET 后端)
  • Git(用于克隆项目)

安装步骤

克隆项目

首先,您需要从 GitHub 上克隆项目:

git clone https://github.com/microsoft/DurableFunctionsMonitor.git
cd DurableFunctionsMonitor

安装前端依赖

接着,进入 durablefunctionsmonitor.react 目录安装前端依赖:

cd durablefunctionsmonitor.react
npm install

构建前端

在相同目录下,运行以下命令来构建前端:

npm run build

这将构建前端并在 durablefunctionsmonitor.react/dist 目录下生成编译后的文件。

安装后端依赖

回到项目根目录,安装后端依赖:

cd durablefunctionsmonitor.dotnetisolated.core
dotnet restore

构建后端

durablefunctionsmonitor.dotnetisolated.core 目录下,运行以下命令来发布后端:

dotnet publish -c Release -o ../durablefunctionsmonitor.dotnetisolated

确保在发布时选择正确的配置文件,例如 appsettings.json

配置和运行

配置 durablefunctionsmonitor.dotnetisolated 目录下的 local.settings.json 文件以包含:

{
  "IsEncrypted": false,
  "Values": {
    "FunctionAppSettings": {
      "durablefunctionsmonitor.dotnetisolated.core": {
        "CounterName": "DurableFunctionsMonitor"
      }
    }
  }
}

现在,您可以运行 durablefunctionsmonitor.dotnetisolated 目录下的项目,以启动后端服务。

cd durablefunctionsmonitor.dotnetisolated
func start

按照提示在浏览器中输入 http://localhost:7000,您应该能够看到监控界面。

以上步骤概述了安装和配置 DurableFunctionsMonitor 的过程。实际部署时,您可能需要根据具体环境进行适当调整。

登录后查看全文
热门项目推荐