Bot Service in Azure: The Switchboard Between Your Bot and the World

Bot Service in Azure: The Switchboard Between Your Bot and the World

An intermediate, plain-English guide to Azure Bot Service — how it connects one piece of bot logic to Teams, web chat, voice and more, how identity, state and security work, and what the retirement of the Bot Framework SDK means for the way you build bots today.

Imagine a large company with one brilliant receptionist who knows every answer. Customers, however, do not all walk in through the same door. Some phone, some send emails, some use the website chat, and some stop by the office in person. Instead of hiring a different receptionist for every door, the company builds one central switchboard. Every call, letter and visitor is routed to the same brain, and the answer is sent back through whichever door the customer used. Azure Bot Service is that switchboard for software conversations.

In this guide we will build up the whole picture step by step: what the service is, which parts live inside Azure and which parts you own, how a single message travels from a person’s phone to your code and back, how identity and security are handled, and how to run the whole thing in production. We will also be honest about how the bot world has changed recently, because the tools used to build bots have moved on even though the Azure resource that connects them is still very much alive.

1What Azure Bot Service Is and Why It Exists

A bot is only useful if people can reach it where they already spend their time.

A bot is a program that holds a conversation with a person using text, speech or small interactive cards. A bank bot may tell you your balance, a help-desk bot may reset your password, and an HR bot may answer questions about leave policy. The conversation itself is the easy part to imagine. The hard part is everything around it: how does a message typed inside Microsoft Teams, a website widget or a text message find its way to your program, and how does your reply find its way back?

Azure Bot Service is the managed Azure offering that solves this delivery problem. It registers your bot as a known, trusted identity, gives it a public address that channels can talk to, handles the secure handshake between each channel and your code, and provides a place in the Azure portal to configure channels, test your bot and watch basic analytics. Your bot logic, however, does not run inside the service. It runs in an application that you host somewhere else and that the service calls over HTTPS.

This split is the single most important idea in the whole topic. The service is the front desk and the translator. Your code is the brain. Many beginners assume the service “contains” the bot, and that misunderstanding leads to confusing questions about scaling, deployment and cost later on.

Simple Analogy

Think of a mobile phone network. The network does not write your messages and does not decide what you say. It authenticates your SIM card, routes your message to the right person, and delivers the reply. Azure Bot Service plays the network role, and your bot application plays the role of the person at the other end.

Why not simply expose a web API?

You could write your own web API and wire it directly to each messaging platform. In practice every platform has its own message format, its own security rules and its own quirks about attachments, buttons and typing indicators. Writing and maintaining that glue for many platforms is slow and error prone. The service gives you one consistent message shape and one security model, and it absorbs most of the per-channel differences for you.

1 bot
one codebase, many channels
HTTPS
the only way channels reach your code
Entra ID
identity behind every bot registration

2The Big Picture: Three Things Working Together

Almost every confusion about this topic disappears once you separate the three layers.

When people say “Azure Bot”, they may mean three different things. Keeping them apart will save you hours of debugging and a lot of miscommunication with colleagues.

Layer 1

The Azure Bot resource

The Azure resource you create in a subscription. It holds the bot’s identity settings, messaging endpoint, channel configuration and test tools.

Layer 2

The bot application

Your own program, hosted on App Service, containers, Functions or elsewhere. It receives messages and decides how to reply.

Layer 3

The channels

The places where users actually talk: Teams, web chat, Slack, Telegram, email, voice and so on. Each one is a door into the same switchboard.

Glue

The Bot Connector

The routing and translation layer that sits between channels and your endpoint. You never deploy it; it is part of the platform.

flowchart LR
  U["User on a channel"] --> C["Channel such as Teams or Web Chat"]
  C --> BC["Bot Connector Service"]
  BC --> E["Messaging endpoint over HTTPS"]
  E --> B["Your bot application"]
  B --> S["Other services: state, search, AI models, business APIs"]
  B --> BC
  BC --> C
  C --> U
        
FIG 1 — The two-way path between a user and your bot

Read the diagram from left to right and notice that the arrow returns along the same road. Replies do not go straight from your code to the user. They go back through the connector, which knows which channel and which conversation they belong to. That is why your code never needs to know how Teams or Slack actually deliver a message.

i
Remember

Creating the Azure Bot resource does not give you a working bot. It gives you a registered address and identity. Until your own application is deployed and its endpoint is reachable, the resource has nothing to talk to.

3Core Concepts You Must Know

A small vocabulary unlocks the rest of the documentation.

Every field has its own words, and bots are no exception. The following terms appear in portals, documentation, error messages and design discussions. Learn them once and you will read everything else faster.

Term 1

Activity

The basic unit of communication. A text message, a button click, a typing indicator, a member joining a chat and an end-of-conversation signal are all activities.

Term 2

Turn

One cycle of the bot receiving an activity, doing some work and sending zero or more activities back. A conversation is a long series of turns.

Term 3

Conversation

A thread of activities between a user, or a group of users, and the bot on one channel. It has its own identifier.

Term 4

Channel

A communication surface that connects users to the bot, such as Teams, Web Chat or a messaging app.

Term 5

Messaging endpoint

The public HTTPS address of your bot application where the service posts incoming activities.

Term 6

Adapter

The part of your application that checks incoming requests, turns them into activities and sends your replies out again.

Term 7

Adaptive Card

A portable, JSON-described card with text, images, inputs and buttons that each channel renders in its own style.

Term 8

Proactive message

A message your bot sends without the user having just written to it, such as a reminder or an alert.

Why the “activity” idea matters

Because everything is an activity, your bot can react to far more than typed text. A new member joining a Teams channel triggers an activity. A user pressing a card button triggers another one. Learning to look at the activity type before deciding what to do is the foundation of every well-behaved bot.

Simple Analogy

An activity is like an envelope arriving at a mail room. Some envelopes contain letters, some contain parcels and some are just a notice that someone new has joined the office. A good mail clerk looks at the label first and only then decides what to do.

!
Common Misconception

People often think a conversation lives inside the service. It does not. The service forwards activities and holds no memory of what was said earlier. Any memory has to be stored by your own application, which we cover in the chapter on state.

4Architecture and Components

Who owns what, and where each piece runs.

A production bot solution is a small system rather than a single program. Seeing it as a set of cooperating parts makes it much easier to secure, scale and troubleshoot. The table below separates what Microsoft operates for you from what your team owns.

ComponentWhat it doesWho runs it
ChannelsProvide the user interface in Teams, web pages, messaging apps and voicePlatform owners and Azure
Bot ConnectorRoutes activities between channels and your endpoint, handles channel differencesAzure
Azure Bot resourceStores identity settings, endpoint address, channel setup and test toolsYou configure, Azure hosts
IdentityProves that requests are genuine, using a Microsoft Entra application or managed identityYou configure, Entra ID enforces
Bot applicationHolds conversation logic, calls other services and shapes repliesYou
State storeRemembers conversation and user data between turnsYou choose, Azure storage services host
Intelligence servicesLanguage understanding, search and generative AI modelsYou choose, Azure hosts
ObservabilityLogs, traces, metrics and alertsYou configure, Azure Monitor hosts

A useful mental model: control plane and data plane

The Azure Bot resource is mostly a control plane object. It is the place where you declare how the bot should be reached. The data plane is the live traffic: activities flowing through the connector and into your application. When something goes wrong, it helps to ask which plane the problem lives in. A wrong endpoint address or a missing channel is a control plane problem. A slow reply or a crash while handling a message is a data plane problem, and it almost always lives in your application.

Control plane example

You enable the Teams channel and paste the wrong endpoint. Messages never arrive. The fix is a setting in the portal, not a code change.

Data plane example

Messages arrive but replies take twelve seconds because your bot calls a slow database on every turn. The fix is in your application or its dependencies.

5Internal Working: The Life of a Single Message

Follow one message from a thumb on a screen to a reply on the same screen.

Understanding the journey of one message is the best way to understand the entire service. The path has more stops than most people expect, and each stop is a place where something can be checked, delayed or broken.

sequenceDiagram
  participant User
  participant Channel
  participant Connector as Bot Connector
  participant Bot as Bot application
  participant Svc as Other services
  User->>Channel: Types a message
  Channel->>Connector: Delivers the message
  Connector->>Bot: HTTPS POST with signed token
  Bot->>Bot: Validate token and read activity
  Bot->>Svc: Load state, query data, call AI model
  Svc-->>Bot: Results
  Bot->>Connector: Send reply activity with token
  Connector->>Channel: Format for the channel
  Channel->>User: Shows the reply
        
FIG 2 — Sequence of one conversation turn
1

The user sends something

The channel packages the text, attachment or button press along with sender and conversation information.

2

The connector receives and normalises

The Bot Connector converts the channel-specific format into the common activity shape and finds your bot’s registration.

3

The activity is posted to your endpoint

The connector calls your messaging endpoint over HTTPS and includes a signed token that proves who is calling.

4

Your application authenticates the caller

The adapter validates the token before any business logic runs. Requests that fail validation are rejected.

5

Your logic runs the turn

The bot loads saved state, looks at the activity type, perhaps calls search or an AI model, and prepares one or more replies.

6

Replies travel back and state is saved

Your application sends reply activities to the connector using its own token, writes updated state to storage, and the channel finally shows the answer.

Why turns should be short

Channels do not wait forever. If your application takes too long to acknowledge an incoming request, the channel may retry or give up, and the user may see duplicate replies or an error. The healthy pattern is to respond quickly, and for long-running work to send an immediate acknowledgement first and deliver the result later as a proactive message.

i
Practical Tip

Send a typing indicator when you know a reply will take a few seconds. It tells the user the bot is alive and reduces repeated messages that create extra turns and extra cost.

6Channels in Depth

One bot, many doors — but each door has its own character.

Channels are the reason many teams adopt the service in the first place. You configure a channel in the portal, and the platform takes care of the connection details. Still, every channel has its own personality, and a bot that feels great in one place can feel awkward in another if you ignore the differences.

The main families of channels

Workplace

Microsoft Teams

The most common choice for internal bots. It supports rich cards, personal chats, group chats, channels, task modules and notifications.

Web

Web Chat and Direct Line

Lets you embed a chat window in your own website or app, or build a fully custom client over the Direct Line interface.

Social and messaging

Slack, Telegram, Messenger and others

Reach customers on the apps they already use. Features such as cards and buttons vary from one platform to another.

Email and SMS

Text based reach

Useful for notifications and simple flows. Interactive cards are limited, so replies must work as plain text.

Voice

Telephony and speech

Voice experiences are built through Azure Communication Services and speech capabilities. Replies must be short and spoken-friendly.

Custom

Your own client

A mobile app or kiosk can talk to the bot through Direct Line, giving you complete control of the interface.

Designing for the lowest common denominator

If your bot must work on many channels, design the core conversation so that it makes sense as plain text, then add richer cards as an enhancement where the channel supports them. Adaptive Cards help here because the same description is rendered by each host according to its own capability, but not every host supports every feature of a card.

!
Common Mistake

Testing only in the portal’s built-in test window and assuming everything will look the same in Teams or Slack. Always test on every real channel you plan to launch, with real accounts, before announcing a release.

i
Good to Know

Channel availability and exact feature lists change over time. Before you commit a design to a specific channel, confirm the current capabilities in the official documentation.

7Identity and Authentication

Both sides must prove who they are, every single time.

Security in bot solutions is two-way. Your application must be sure that a request really came from the Bot Connector and not from a stranger who discovered your endpoint. Likewise, the connector must be sure that a reply really came from your bot. Both directions use tokens issued by Microsoft Entra ID, the identity service that sits behind Azure sign-in.

sequenceDiagram
  participant Conn as Bot Connector
  participant App as Bot application
  participant Entra as Microsoft Entra ID
  Conn->>App: Request carrying a signed token
  App->>App: Check signature, issuer, audience and expiry
  App->>Entra: Ask for a token for the outbound reply
  Entra-->>App: Short-lived access token
  App->>Conn: Reply carrying that access token
  Conn->>Conn: Verify the token before delivering
        
FIG 3 — Tokens protect both directions of the conversation

Choosing the identity type

When you create the Azure Bot resource you decide what kind of identity the bot application uses. This choice affects secrets, rotation and who can use the bot. The options are summarised below.

Identity typeHow it worksBest for
User-assigned managed identityAn Azure-managed identity attached to your hosting resource; no secret to store or rotateMost new bots that run in Azure
Single-tenant app registrationAn Entra application that only accepts identities from your own directory, authenticated with a secret or certificateBots used inside one organisation, or hosted outside Azure
Multi-tenant app registrationAn application that can be used from many directories; Microsoft has been moving new bots away from this optionOlder bots; verify current guidance before using for new work
Simple Analogy

A secret-based identity is like a physical key that you must cut, store safely and replace regularly. A managed identity is like a smart badge issued by the building itself: nobody carries a copy, and it simply stops working when the person leaves the company.

Why managed identity is attractive

Secrets leak. They end up in configuration files, build logs and chat messages, and they expire at inconvenient moments. Managed identities remove the secret entirely, which means there is nothing to rotate and nothing to leak. That is why they are the sensible default for new bots hosted in Azure.

!
Operational Warning

A very common outage story is a client secret that quietly expired. The bot is still deployed and the endpoint is healthy, yet every reply is rejected. If you must use secrets, track their expiry dates like you track certificates.

8State, Storage and Conversation Memory

The service forgets everything. Your design must not.

Bots are normally hosted as stateless web applications, and the service itself keeps no conversation memory. Yet real conversations need memory: which step of a form the user is on, what language they prefer, what they asked two minutes ago. The solution is to store this information in an external store and load it at the start of every turn.

Three kinds of remembered information

Scope 1

Conversation state

Data about one specific conversation, such as the current step in a guided process or the last topic discussed.

Scope 2

User state

Data about a person that should follow them across conversations on a channel, such as name or preferences.

Scope 3

Private conversation state

Data about one user inside one conversation, useful in group chats where each person has their own progress.

Where to keep it

For quick experiments, in-memory storage is fine, but it disappears whenever the application restarts or when a second instance handles the next turn. For anything serious, use a durable store. Azure Cosmos DB is a common choice because it is fast, globally distributed and scales smoothly. Azure Blob Storage is a simpler and cheaper option for smaller solutions. Whichever you choose, the pattern is identical: read state at the start of a turn, change it during the turn, and write it back before the turn ends.

Simple Analogy

Imagine a doctor who sees thousands of patients and has no personal memory of any of them. Before each appointment a nurse hands over the patient’s file, and after the visit the notes go back in the cabinet. The file cabinet is your state store, and the file is what makes each visit feel continuous.

Advantages of external state

  • Any instance of your bot can handle any turn
  • Restarts and deployments do not lose conversations
  • Scaling out is simple
  • Data can be backed up and audited

Trade-offs

  • Extra latency on every turn
  • Concurrent writes can overwrite each other if not handled
  • Personal data stored there brings privacy duties
i
Design Tip

Store only what you need and set an expiry on old conversation data. Smaller state is faster to load, cheaper to keep and easier to defend in a privacy review.

9Hosting Your Bot Application

The service needs only one thing from you: a reachable HTTPS address that behaves.

Because the service just calls an endpoint, you have broad freedom in where the bot runs. The right choice depends on traffic, team skills, networking rules and budget. Here are the options that come up most often.

Azure App Service

The classic and simplest home for a bot. Managed web hosting with easy deployment, scaling rules, deployment slots and built-in integration with identity and monitoring. A strong default for most teams.

Azure Container Apps or Azure Kubernetes Service

A good fit when the bot is one part of a larger containerised system, or when you need fine control over networking, sidecars and scaling behaviour.

Azure Functions

Attractive for lightweight, spiky workloads because you pay per execution. Cold starts must be managed carefully, since slow first responses can cause channel timeouts.

Outside Azure or on premises

Allowed, as long as the endpoint is reachable over HTTPS from the service. This is common during migrations and in organisations with strict data residency rules.

Environments and release safety

Treat a bot like any other production service. Keep separate registrations for development, test and production, each with its own endpoint and identity. Use deployment slots or blue-green releases so that a bad version can be swapped out in seconds. Remember that a bot’s registration, channels and identity are configuration that must be reproducible, so define them with infrastructure-as-code rather than clicking through the portal each time.

flowchart TD
  A["Need to host a bot"] --> B{"Traffic steady or spiky?"}
  B -->|"Steady"| C{"Part of a container platform?"}
  B -->|"Spiky or rare"| F["Azure Functions with warm-up care"]
  C -->|"Yes"| D["Container Apps or AKS"]
  C -->|"No"| E["Azure App Service"]
        
FIG 4 — A simple way to think about hosting choices
!
Common Mistake

Letting the hosting plan scale to zero or sleep on idle. The first message after a quiet period can time out on the channel, and the user sees no reply at all. Keep at least one instance warm for any bot that real people depend on.

10Adding Intelligence to the Conversation

The service moves messages. The smarts come from what your application connects to.

On its own, Azure Bot Service does not understand language. It carries words between people and your program. Everything that makes a bot feel intelligent comes from services your application calls during a turn. Over the years the available building blocks have changed a lot, so it helps to see them as a ladder of increasing flexibility.

1

Rules and menus

Buttons, keywords and fixed flows. Predictable and cheap, but rigid. Excellent for short transactions like checking an order status.

2

Intent and entity recognition

Azure AI Language, through conversational language understanding, maps a sentence to an intent such as “reset password” and pulls out details such as dates or product names.

3

Question answering over documents

Custom question answering finds answers inside your own knowledge base, which suits FAQ and policy bots.

4

Generative AI with retrieval

A large language model produces natural replies, grounded in your own content retrieved from a search index so that answers stay accurate and current.

5

Agents that take actions

The model decides which tools to call, such as booking systems or ticketing APIs, and completes multi-step tasks on behalf of the user.

Simple Analogy

Rules are like a printed phone menu. Intent recognition is like a receptionist who understands what you mean. Retrieval with generation is like a knowledgeable assistant who looks things up in the company library before answering. An agent is like an assistant who can also walk to the next office and get the form stamped.

Grounding is the key word

A model that answers from memory may invent plausible but wrong details. Grounding means retrieving trusted content first and asking the model to answer only from it. For enterprise bots this is usually the difference between a demo that impresses and a system that can be trusted with real customers.

i
Practical Tip

Show sources or links in replies where possible and give users an easy way to hand over to a person. Trust grows when the bot is honest about what it does not know.

11The Changing Tool Landscape: What Happened to the Bot Framework SDK

The switchboard is still here, but the toolkit people use to wire up the brain has moved on.

For years, the standard way to write the code behind an Azure bot was the Bot Framework SDK, available for several programming languages. That SDK, together with the Bot Framework Emulator, has now been archived. Microsoft’s guidance states that support tickets for the SDK stopped being serviced after December 31, 2025. Existing bots built with it keep working, but the SDK no longer receives updates or regular dependency maintenance.

The recommended successor for code-first development is the Microsoft 365 Agents SDK, which supports C#, JavaScript and Python and lets you choose your own AI services, orchestration and knowledge sources. Microsoft also points to Microsoft Copilot Studio for teams that prefer a managed, low-code platform, and to its Foundry offerings for agent hosting. A migration guide exists for teams moving an existing bot to the newer SDK.

ApproachStyleTypical fit
Existing Bot Framework SDK botCode-first, no longer maintainedKeep running while a migration is planned
Microsoft 365 Agents SDKCode-first, flexible orchestrationNew custom agents and bots, Teams and other channels
Copilot StudioLow-code, managedBusiness-led assistants with quick delivery
Foundry agent offeringsManaged agent hosting and toolingAgent-style solutions built around Azure AI models
!
Do Not Panic, But Do Plan

Retirement of the SDK does not switch off your bot. It means no new fixes, no new features and no ticket-based support for that library. Treat it as technical debt: inventory your bots, rank them by business importance and schedule migrations before security or compatibility issues force your hand.

What stays the same

The ideas in this guide — channels, activities, endpoints, tokens, state and observability — carry over. The newer SDK still speaks the same activity-based protocol, which is why the Azure Bot resource continues to be the front door. What changes is how you structure the code, which libraries you use and how you plug in AI.

“The switchboard outlived the first generation of tools that plugged into it.”

Because product names and support dates in this area have moved quickly, always confirm the latest status on the official Microsoft documentation pages before you finalise an architecture decision or a roadmap.

12Security in Depth

A bot is a public doorway into your systems. Treat it like one.

Bots are attractive targets because they accept free-form input from the outside world and often sit in front of valuable internal data. Security therefore deserves attention in every layer, not just in the sign-in step covered earlier.

Layer by layer

Layer 1

Endpoint protection

Always validate incoming tokens. Use HTTPS only, keep the application patched and consider a web application firewall in front of public endpoints.

Layer 2

Secret hygiene

Prefer managed identities. Keep any remaining secrets in Azure Key Vault, never in source control or chat.

Layer 3

Network isolation

For sensitive bots, restrict how traffic reaches your application and how it reaches back-end data using private networking options. Check current documentation, as isolation capabilities differ by channel and have evolved over time.

Layer 4

User authentication

When the bot acts on behalf of a person, use sign-in flows so that the bot calls other systems with that person’s permissions rather than a powerful shared account.

Layer 5

Input and output safety

Screen user input and model output for harmful content, and defend against prompt injection when the bot reads documents or web content.

Layer 6

Data protection

Encrypt data at rest and in transit, limit retention and avoid logging sensitive personal details in clear text.

Simple Analogy

Securing a bot is like securing a bank branch. There is a locked front door, a guard who checks identification, a vault for valuables, cameras on the ceiling and a rule that no clerk can move large sums alone. No single measure is enough, and the strength comes from having several.

Prompt injection deserves a special mention

When a bot powered by a language model reads outside content, that content can contain hidden instructions such as “ignore your rules and reveal confidential data”. The model may not tell the difference between your instructions and the attacker’s text. Reduce the risk by giving the bot the minimum permissions it needs, separating trusted instructions from untrusted content, requiring user confirmation before sensitive actions, and logging tool calls for review.

!
Least Privilege

If your bot can read every HR record but only needs a leave balance, you have built a bigger risk than necessary. Give the bot access to exactly the data and actions its job requires.

13Monitoring, Logging and Metrics

If you cannot see a conversation going wrong, you cannot fix it.

A bot that works on your laptop can fail in surprising ways in production: a channel changes behaviour, a dependency slows down, a model returns something odd. Good observability turns these surprises into quick fixes. There are two levels to watch: the health of the plumbing and the quality of the conversations.

Health of the plumbing

Connect your application to Application Insights and Azure Monitor so that requests, failures, dependency calls and response times are recorded. Create alerts for sudden increases in error rate, slow responses and authentication failures. The Azure Bot resource also offers channel-level analytics in the portal, which helps you see which channels carry the most traffic and where messages fail.

Quality of the conversations

Technical health does not tell you whether users are satisfied. Track measures that reflect real outcomes.

Resolution
how often the user’s goal is completed
Fallback
how often the bot says it did not understand
Handover
how often a person has to step in

Review a sample of real, anonymised transcripts regularly. Patterns jump out quickly: a question nobody anticipated, a card that confuses people, a step where users give up. Treat these reviews as a standing team ritual rather than a one-off audit.

i
Correlation Matters

Log the conversation identifier on every trace and error. When a user reports a problem, that single identifier lets you pull every related event from every service in seconds.

!
Privacy Warning

Transcripts can contain names, account numbers and health details. Mask sensitive values before storing them, restrict who can read logs and apply a clear retention period.

14Scaling, Reliability and Cost

Where the money goes, and what keeps the bot alive at busy moments.

Cost and reliability are mostly shaped by the pieces you host and call, not by the connector itself. The service layer is managed by Azure and has a published availability target, but your own application, state store and AI calls determine how the whole solution behaves under pressure.

Where the cost comes from

Hosting

The compute that runs your bot application. Size it for the busiest hour you expect, then use autoscale rules to avoid paying for idle capacity at night.

State and data stores

Storage and throughput costs grow with the number of active conversations and how much data each one stores.

AI services

Language models are usually billed by the amount of text processed. Long histories, large retrieved documents and chatty prompts all raise the bill quickly.

Channels and the bot resource

The pricing model for the bot resource and for certain premium channels has changed over time. Check the official pricing page for the tier and channels you plan to use rather than relying on older articles.

Keeping it reliable

Run at least two instances of your application, spread across availability zones when the plan supports it. Use health probes so unhealthy instances are removed automatically. Set sensible timeouts and retries on every outgoing call, and protect your bot from a slow dependency with circuit breakers so that one failing service does not freeze every conversation. For high-stakes bots, consider a secondary region with a documented failover procedure that has actually been rehearsed.

Cost-saving habits

  • Trim conversation history sent to AI models
  • Cache answers to frequent questions
  • Use smaller models for simple classification steps
  • Autoscale hosting with sensible limits

Hidden cost traps

  • Retry loops that multiply AI calls
  • Verbose logging of every message body
  • Idle environments left running after testing

15Design Patterns and Anti-patterns

Proven shapes that work, and tempting shortcuts that hurt later.

Patterns worth adopting

Pattern 1

Router and specialists

A thin front component identifies the user’s goal and hands over to focused skills such as leave, IT support or expenses. Each skill can be built and tested on its own.

Pattern 2

Acknowledge, then work

Reply instantly with a short acknowledgement, perform slow work in the background and deliver the result as a proactive message.

Pattern 3

Graceful human handover

Detect frustration or low confidence and pass the conversation, with its history, to a human agent.

Pattern 4

Retrieve, then generate

Search trusted content first and let the model answer from what was found, including references to the sources.

Pattern 5

Channel-aware rendering

Keep core logic channel-neutral and apply a thin layer that formats replies for each channel’s strengths.

Anti-patterns to avoid

ANTI-PATTERN-01 Avoid
Problem

Conversation memory is kept in the memory of the running application.

Why It’s Harmful

A restart or a second instance wipes or splits the memory, so users are asked the same questions again and flows break in the middle.

Correct Approach

Store state in a durable external service and load it at the start of every turn.

ANTI-PATTERN-02 Avoid
Problem

One giant, all-powerful service account is used for every back-end call.

Why It’s Harmful

Any bug or successful attack exposes everything the account can reach, and audit trails cannot show which person triggered an action.

Correct Approach

Use user-level sign-in where actions are personal, and narrowly scoped identities elsewhere.

ANTI-PATTERN-03 Avoid
Problem

Doing long work inside the turn before replying.

Why It’s Harmful

Channels time out, retry and produce duplicate messages, and users lose confidence.

Correct Approach

Acknowledge quickly and finish the work in a background process, then notify the user proactively.

16Best Practices and Common Mistakes

Habits that separate a polished bot from a frustrating one.

Best practices

  • Start with the user’s goal. Write down the five most common tasks and make those perfect before adding anything else.
  • Keep replies short. Chat is not email. Two or three sentences with clear options work better than long paragraphs.
  • Always offer a way out. Let users restart, ask for a person or end the conversation at any step.
  • Be transparent. Tell users they are talking to a bot and explain what it can help with in the first message.
  • Automate the setup. Define the bot resource, channels, identity and hosting in infrastructure-as-code so every environment is identical.
  • Test on real channels. Run scripted conversations against each channel before every release.
  • Plan the lifecycle. Decide who owns the bot, who reviews transcripts and how knowledge content is kept fresh.

Common mistakes

!
Mistake 1

Wrong messaging endpoint. A typo, a missing path or an address that is not publicly reachable produces silence rather than a helpful error. Check the endpoint first whenever messages do not arrive.

!
Mistake 2

Mismatched identity settings. The identifier, tenant and credential configured in the application must agree with what the bot resource expects. Even a single mismatched value leads to authentication failures that look mysterious.

!
Mistake 3

Ignoring the “I did not understand” path. Many bots handle the happy path beautifully and respond with a dead end to everything else. Design the fallback as carefully as the main flow.

!
Mistake 4

Building on an unmaintained foundation without a plan. Starting a brand new project on a retired SDK, rather than a supported one, creates avoidable work later.

i
Troubleshooting Order

When a bot is silent, check in this order: Is the application running? Is the endpoint correct and reachable? Do the identity settings match? Is the channel enabled? What do the application logs say about the request? This sequence solves most incidents quickly.

17Real-world and Industry Examples

Where these ideas show up in everyday business.

The following scenarios are typical of how organisations use bot solutions. They are illustrative patterns rather than descriptions of specific companies.

Internal IT help desk in Teams

Employees ask for password resets, software requests or outage information without leaving Teams. The bot signs in as the employee, checks identity, creates tickets and posts proactive updates when a ticket changes status. This cuts routine ticket volume and gives the support team more time for complex issues.

Customer service on website and messaging apps

A retailer answers delivery, returns and product questions on its site and on a popular messaging app, using the same bot logic behind both. Hard cases are escalated to a human agent along with the full transcript so customers never have to repeat themselves.

HR and policy assistant

A company grounds a generative assistant in its policy documents. Employees ask about leave, travel or benefits and receive answers with links to the exact policy page. Access rules ensure each person only sees content they are allowed to read.

Banking and insurance notifications

Customers receive proactive alerts about payments or claims and can reply with simple actions. Strict identity checks, short data retention and detailed audit logs support regulatory requirements.

Field service and operations

Technicians use a mobile app with an embedded chat client to look up manuals, log work and request spare parts, even in poor network conditions where short, resilient messages matter.

Voice front door for contact centres

A telephony channel greets callers, understands the reason for the call and routes it to the right team, saving callers from long menu trees.

“The best bot is the one that solves the problem, or quickly and politely hands it to someone who can.”

18Frequently Asked Questions

Quick answers to questions that come up again and again.

Q1Does Azure Bot Service run my bot’s code?

No. The service registers, secures and connects your bot to channels. The code itself runs in an application that you host and that the service reaches through a public HTTPS endpoint.

Q2Do I have to host the bot in Azure?

No. Any location works if the messaging endpoint is reachable over HTTPS from the service. Azure hosting is simply the most convenient option because identity, networking and monitoring integrate neatly.

Q3Will my existing Bot Framework SDK bot stop working?

It will keep running, but the SDK is archived and no longer maintained or supported through tickets. Plan a migration to a supported option, and prioritise bots that handle sensitive data or critical business processes.

Q4What is the difference between the Azure Bot resource and the bot application?

The resource is the registration and configuration in Azure. The application is your own program with the conversation logic. You need both for a working bot.

Q5How does the bot remember earlier messages?

Through state that you store in an external service such as Cosmos DB or Blob Storage. The application loads that state at the start of each turn and saves it at the end.

Q6Which identity type should a new bot use?

For bots hosted in Azure, a managed identity is usually the safest choice because it removes secrets. Use a single-tenant app registration when hosting elsewhere or when a managed identity is not possible, and check current guidance for details.

Q7Can one bot serve Teams and a website at the same time?

Yes. You enable several channels on the same bot resource and all of them reach the same application. You may still tailor the formatting of replies to each channel.

Q8Is Azure Bot Service the same as Copilot Studio?

No. Azure Bot Service is the connectivity and identity layer for code-first bots. Copilot Studio is a managed, low-code platform for building assistants. They can work together in a larger solution.

Q9Why does my bot work in the test window but not in Teams?

Common causes are a channel that is not enabled, an app package that is not installed or approved, an identity setting that differs between environments, or a feature that the channel handles differently. Test with real accounts on the real channel.

Q10How can I make a bot with a language model safer?

Ground answers in trusted content, filter harmful input and output, give the bot only the permissions it needs, ask for confirmation before sensitive actions and review logs regularly for unusual behaviour.

19Summary and Key Takeaways

Azure Bot Service is best understood as a managed switchboard. It gives your bot an identity, a secure address and connections to many channels, while your own application supplies the conversation logic, memory and intelligence. Once you see the three layers — channels, the Azure Bot resource and your application — most design decisions about hosting, state, security and monitoring become straightforward. The tooling around the service has shifted toward the Microsoft 365 Agents SDK and managed platforms, so the practical advice is to keep the proven architectural ideas, choose supported tools for new work and plan the migration of older bots.

Key Takeaways

  • The service connects, your code thinks — Azure Bot Service handles identity, routing and channels, but the bot logic runs in an application you host.
  • Everything is an activity — messages, button clicks and membership changes all arrive as activities, and good bots check the type before acting.
  • State is your responsibility — store conversation and user data in a durable external service and load it at every turn.
  • Prefer managed identity — it removes secrets, prevents silent expiry outages and simplifies security reviews for bots hosted in Azure.
  • Secure in layers — validate tokens, isolate networks, limit permissions, filter content and defend against prompt injection.
  • Observe conversations, not just servers — track resolution, fallback and handover rates alongside technical health.
  • Plan for the new toolchain — the Bot Framework SDK is archived, so choose the Microsoft 365 Agents SDK or a managed platform for new work and schedule migrations for existing bots.