Загрузка...

Part 3 - Azure AI Foundry Agent & MCP Integration with C# & ASP.NET, User Sign In

Overview
This is the second part of a tutorial series demonstrating how to integrate an ASP.NET Core application with Azure AI Foundry using an MCP (Model Context Protocol) server. The video focuses on implementing two-way communication by fetching and displaying user data from Azure Storage Table in a web application.

Key Topics Covered
1. Project Setup & MCP Tool Enhancement
Extends the existing user management system from Part 1

Creates a new MCP tool called "Get All Users" that retrieves user data from Azure Storage Table

Demonstrates adding new tools to the existing MCP server infrastructure

2. Backend Development
MCP Server Enhancement: Adds a new method GetAllUsers() in the user management service

Azure Storage Integration: Shows how to query and retrieve all user records from Azure Table Storage

Testing: Uses Postman to verify the MCP tool works correctly before web integration

3. Frontend Integration
Creates a new "Get All Users" page in the ASP.NET Core application

Implements UserManagementAgent with a new method to call the Azure AI Foundry agent

Handles agent response parsing and JSON deserialization with proper camel case configuration

4. Prompt Engineering & Response Handling
Addresses challenges with AI agent responses containing extra text

Demonstrates prompt engineering techniques to ensure clean JSON responses:

"Please give me a list of all users and make sure you return me raw JSON"

"Please don't add any extra text or formatting"

Implements JSON parsing with JsonSerializerOptions for proper property mapping

5. UI Implementation
Uses Razor pages to display user data in a tabular format

Shows full name, email address, and phone number (excludes passwords for security)

Demonstrates end-to-end data flow from storage to web interface

Technical Achievements
✅ Two-way communication between web app and Azure AI Foundry

✅ Data retrieval from Azure Storage Table via MCP tools

✅ JSON response parsing with proper serialization settings

✅ Real-time data display in ASP.NET Core web application

✅ Agent prompt optimization for consistent JSON output

Prerequisites
Part 1 of the series (user creation functionality)

Existing ASP.NET Core application with Azure AI Foundry integration

MCP server with user management tools

Azure Storage Table for data persistence

Видео Part 3 - Azure AI Foundry Agent & MCP Integration with C# & ASP.NET, User Sign In канала Code & Cloud
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять