1. Introduction
Chatbots have become an essential part of modern customer support systems. They provide 24/7 assistance, automate repetitive queries, and improve user engagement. In enterprise applications, especially customer portals, integrating a chatbot offers instant support and reduces manual load on customer service teams.
In this article, we’ll learn how to build and integrate a chatbot into an Angular-based customer portal using the Microsoft Bot Framework and ASP.NET Core as the backend.
We’ll also cover how to handle authentication, context-based responses, and communication between the chatbot and Angular components step by step.
2. Why Chatbot Integration Matters in Enterprise Portals
Before diving into the implementation, let’s understand why chatbot integration is valuable for enterprises:
Instant Support: Customers receive instant responses to FAQs or ticket-related queries.
Operational Efficiency: Reduces the dependency on live support agents for repetitive questions.
Scalable Communication: Supports multiple languages, intents, and business workflows.
Data-Driven Insights: Chat transcripts can help improve customer satisfaction analysis.
For example, an enterprise service portal can have a chatbot that assists users in checking order status, raising support tickets, or retrieving invoice details from APIs.
3. Technical Workflow
Here’s the workflow diagram that shows the data flow between Angular, the Bot Framework, and the backend APIs.
Flowchart: Chatbot Integration Workflow
User (Customer Portal UI)
|
v
Angular Chat Widget
|
v
ASP.NET Core Bot Controller (Direct Line / Bot Connector)
|
v
Microsoft Bot Framework SDK
|
v
Business Logic / Knowledge Base / API Calls
|
v
Response sent back to Angular Chat Interface
4. Architecture Overview
Frontend (Angular)
Embeds the chatbot widget using Direct Line API or Web Chat SDK.
Handles authentication tokens from backend.
Displays chat interface and messages in real time.
Backend (ASP.NET Core)
Hosts the bot using the Microsoft.Bot.Builder SDK.
Connects to services like QnA Maker, Azure Cognitive Services, or OpenAI API for AI-powered responses.
Exposes a token generation API for Angular frontend.
Bot Framework
Manages conversation flow, state, and NLP.
Supports both text and adaptive cards for richer responses.
5. Setting up the Bot in ASP.NET Core
Let’s start by building a bot using Microsoft Bot Framework SDK v4 in an ASP.NET Core project.
Step 1: Create a New Bot Project
Use Visual Studio or the CLI:
dotnet new webapp -n CustomerSupportBot
cd CustomerSupportBot
dotnet add package Microsoft.Bot.Builder.Integration.AspNet.Core
dotnet add package Microsoft.Bot.Builder.AI.QnA
Step 2: Configure the Startup Class
In Program.cs:
var builder = WebApplication.CreateBuilder(args);
// Add Bot Framework services
builder.Services.AddControllers().AddNewtonsoftJson();
builder.Services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
builder.Services.AddTransient<IBot, CustomerSupportBot>();
var app = builder.Build();
app.MapControllers();
app.Run();
Step 3: Create Bot Logic
Create CustomerSupportBot.cs:
using Microsoft.Bot.Builder;
using Microsoft.Bot.Schema;
using System.Threading.Tasks;
public class CustomerSupportBot : ActivityHandler
{
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var userMessage = turnContext.Activity.Text?.ToLower();
if (userMessage.Contains("order"))
await turnContext.SendActivityAsync("Please provide your order ID, I’ll check the status for you.");
else if (userMessage.Contains("ticket"))
await turnContext.SendActivityAsync("You can raise a new ticket from the Help section.");
else
await turnContext.SendActivityAsync("I'm here to help! Try asking about your order or ticket.");
}
}

Join the conversation! Your thoughts help the community grow.