Documentation Index

Fetch the complete documentation index at: https://azure-cost-management-playbook.turbo360.com/llms.txt

Use this file to discover all available pages before exploring further.

Azure Bot Service

Prev Next

What it does

Azure Bot Service is the channel-management and hosting layer for conversational bots built with the Bot Framework SDK. It decouples the bot logic (your code) from the channels it communicates through:

  • Channel connectivity — a single registered bot connects to Teams, Web Chat, Slack, Facebook Messenger, Twilio SMS, email, and more through the Bot Service channel configuration.

  • Bot registration — provides the identity (App ID, endpoint) that channels use to authenticate and route messages to your bot.

  • Direct Line channel — a secure REST API channel for embedding a bot into a custom web or mobile app.

  • Teams integration — deep integration with Microsoft Teams for tabs, messaging extensions, and proactive messaging.

  • Activity handler model — the Bot Framework SDK (C# or Node.js) provides a structured programming model for handling messages, events, card interactions, and dialogs.

  • Adaptive Cards — rich, platform-agnostic card rendering for structured interactive messages in any channel.

Azure Bot Service does not provide the AI or NLP capabilities — it is purely the plumbing. Intelligence comes from services the bot calls: Azure OpenAI, Azure AI Language (CLU/QnA), LUIS, or any other API.

When you'd use it

  • You need full programmatic control over bot logic that Copilot Studio's low-code canvas cannot express.

  • You are building complex, stateful, multi-turn dialog flows with branching logic, custom authentication, or deep integrations.

  • You need to publish a bot across multiple channels (Teams + Web Chat + Slack) from a single codebase.

  • You want to avoid the message-based billing model of Copilot Studio for high-volume scenarios.

  • You are integrating a chatbot into a custom mobile or web application via Direct Line.

Sample use case

A telecoms provider builds a customer service bot that handles account queries, plan upgrades, and fault reports. The bot logic runs as an Azure App Service, connecting to CRM APIs for account data, Azure AI Language for intent recognition, and Azure OpenAI for generative fallback responses. The bot is published to both the company's website (via Direct Line) and Microsoft Teams for internal support staff. The development team owns the full codebase and can iterate on dialog flows without any platform constraints.

Example reference architecture

Pricing & How Costs Work

Azure Bot Service itself is structured around two components: the Bot registration (control plane) and the channels (communication routing). The cost model is deliberately simple — the Service is mostly free, with costs concentrated in the compute hosting the bot and the AI services it calls.

Bot Service channel charges

Component

Cost

Bot registration (the Azure Bot resource)

Free

Standard channels (Teams, Web Chat, Slack, Facebook, Twilio, email, etc.)

Free — no per-message charge

Direct Line channel

Free for standard usage; Direct Line Speech (audio streaming) has per-hour charges

Direct Line Speech

Per audio hour processed (same structure as Azure AI Speech STT/TTS)

Premium channels (if applicable)

Some third-party channel integrations may carry their own platform fees outside Azure

Where bot costs actually come from

The Bot Service channel layer is free; all meaningful cost is in the resources the bot uses:

Cost source

Azure service billed

Billing model

Bot hosting compute

Azure App Service / Azure Functions / Container Apps

Per instance-hour (App Service plan) or per execution (Consumption plan)

NLP / intent recognition

Azure AI Language (CLU)

Per 1,000 text records

Generative AI responses

Azure OpenAI Service

Per token (input + output)

Question answering knowledge base

Azure AI Language (QnA)

Per 1,000 text records + hosting fee

State storage (conversation state, user profiles)

Azure Cosmos DB / Azure Blob Storage

Per RU or per GB

Logging and monitoring

Application Insights

Per GB ingested

Key pricing mechanics:

  • App Service hosting: If the bot runs on an App Service plan (S1, S2, etc.), it bills continuously regardless of message volume — this is an always-on cost. Scaling up (larger SKU) or out (more instances) multiplies this cost.

  • Azure Functions (Consumption plan): Bot logic hosted on serverless Functions bills only per execution + memory consumption — well-suited to low- or medium-volume bots with variable traffic.

  • Container Apps: A modern hosting option that scales to zero; suits bots with intermittent traffic and removes the always-on App Service cost.

  • Cosmos DB state storage: Multi-turn conversations require storing state (dialog stack, user data) between turns. Each read/write consumes Request Units (RUs). High-volume bots with complex dialog state can generate significant Cosmos DB costs.

What Drives Costs

Cost driver

Why it matters

Bot hosting compute

The largest steady-state cost for a production bot. An App Service plan runs 24×7 regardless of traffic.

Azure OpenAI token consumption

If the bot uses generative AI for responses, token costs scale with conversation volume and message length.

AI Language / CLU call volume

Every user message processed through CLU for intent recognition = one text record billed.

Conversation turn volume

Drives all downstream costs: compute, AI service calls, state storage reads/writes.

State storage RU consumption

Complex dialogs with rich state read/write Cosmos DB on every turn. High-concurrency bots need sufficient provisioned throughput.

Number of channels deployed

Channels themselves are free but each additional channel increases traffic volume and therefore downstream service costs.

Direct Line Speech usage

Audio streaming is billed per hour — significant if the bot handles voice interactions at scale.

Cost optimisation levers:

  • Use Azure Functions or Container Apps instead of App Service for variable-traffic bots to eliminate always-on compute cost.

  • Right-size the App Service plan based on actual CPU/memory usage, not anticipated peak — many bots run comfortably on S1 or even B2.

  • Use GPT-4o mini or AI Language CLU for intent recognition instead of GPT-4o — CLU is significantly cheaper per call for structured intent matching.

  • Implement response caching for FAQ-style intents — cache common answers rather than calling AI services on every identical input.

  • Minimise Cosmos DB state size — store only essential dialog state, not full conversation history, to reduce RU consumption.

  • Set Application Insights sampling to reduce log ingestion volume for high-traffic bots; full telemetry is rarely needed for every message in production.

  • Use free standard channels rather than building custom Direct Line integrations where Teams or Web Chat meets the requirement.

Azure Cost Data — Meters & Meter Subcategories

Azure Bot Service channel costs appear under the Bot Service service family in Cost Management. Resource type: Microsoft.BotService/botServices.

Meter name

Meter subcategory

What it counts

Standard Messages

Free

Standard channel messages — $0; shown in billing but with zero charge

Direct Line Speech Hours

Standard

Audio streaming hours through the Direct Line Speech channel

The Bot Service resource itself generates almost no billable meters. The cost picture for a bot is assembled from multiple other services:

Cost

Azure service family

How to find in Cost Management

App Service hosting

Web

Filter ServiceName = Azure App Service, ResourceId = the App Service resource

Functions compute

Functions

Filter ServiceName = Azure Functions

Container Apps

Container Apps

Filter ServiceName = Azure Container Apps

Azure OpenAI tokens

Cognitive Services

Filter ServiceName = Cognitive Services, MeterName contains model name

AI Language CLU

Cognitive Services

Filter ServiceName = Cognitive Services, ResourceId = Language resource

Cosmos DB state

Azure Cosmos DB

Filter ServiceName = Azure Cosmos DB, ResourceId = the state store account

Application Insights

Monitor

Filter ServiceName = Azure Monitor

Key notes for cost attribution:

  • Because Bot Service itself is free, there is no single resource in Cost Management that represents the "total bot cost." A resource group per bot (containing the App Service, Cosmos DB, AI services, and the Bot registration) is the most effective way to see a complete cost picture in Cost Management's resource group view.

  • Tagging the resource group (e.g. bot=customer-service, env=prod) ensures that all resources within it inherit the tags and can be filtered consistently in cost exports.

  • For bots with shared AI service resources (e.g. one Azure OpenAI account used by multiple bots), the bot-level cost attribution requires Azure Monitor Metrics or custom logging — billing data alone cannot distinguish which bot's calls generated which token charges.


Common Developer Mistakes That Drive Up Costs

  • Hosting the bot on an App Service Plan when it could run on Consumption Functions. App Service plans bill 24×7 regardless of traffic. A bot with low or intermittent traffic running on an S1 App Service plan pays for idle compute around the clock. Azure Functions on the Consumption plan only bills per execution — significantly cheaper for bots that handle fewer than a few hundred thousand messages per month.

  • Using GPT-4o for all bot responses regardless of intent complexity. Bots that route every user message — including simple navigation or FAQ responses — through GPT-4o accumulate token costs for queries that CLU (Azure AI Language) or a simple rule-based match would have handled at a fraction of the cost.

  • Storing full conversation history in the state store. Bot Framework's built-in state management allows storing arbitrary data per conversation. Teams often store the full message transcript in Cosmos DB state, driving up RU consumption per turn. Only the dialog stack and essential user context should be stored in state.

  • Not implementing response caching for frequently repeated queries. Many bots handle the same 20–30 questions repeatedly. Without caching, each instance generates a new AI service call, even for questions answered identically every time.

  • Scaling App Service instances for headroom that never materialises. Teams provision multiple App Service instances for anticipated peak load that never arrives, paying for unused capacity indefinitely.

  • Not disposing of unused bot registrations. While the Bot Service registration itself is free, the attached App Service, Cosmos DB, and AI service resources continue to bill after a bot is decommissioned if they are not deleted.


What Could Make Your Bill Go Up or Down Next Month

Could go UP:

  • A bot is promoted from internal to external use, significantly increasing conversation volume and therefore App Service CPU, AI service call counts, and Cosmos DB RU consumption.

  • A new intent handler is added that calls GPT-4o for every response, replacing a previously rule-based topic that made no AI service calls.

  • App Service plan is scaled up (e.g. S1 → S2) to handle a load test and not scaled back down afterwards.

  • Cosmos DB RU consumption increases because a new feature stores richer state per conversation turn.

  • Application Insights sampling is disabled for debugging and not re-enabled, causing full telemetry ingestion at high volume.

  • A Direct Line Speech channel is added, introducing per-audio-hour charges from Azure AI Speech.

Could go DOWN:

  • Bot is migrated from App Service plan to Azure Functions Consumption plan as traffic analysis shows it is well within serverless limits.

  • CLU is adopted for intent classification on common intents, replacing GPT-4o calls for those paths.

  • A response cache is implemented for the top 20 FAQ intents, eliminating AI service calls for those queries.

  • Cosmos DB state storage is pruned — only the dialog stack is retained rather than full conversation history.

  • App Service is scaled from 2 instances to 1 after load profiling shows 1 instance handles peak load comfortably.

  • Application Insights sampling is configured at 10% for high-volume, low-value telemetry events.


Most Common Optimisation Techniques

Technique

Mechanism

Typical saving

Use Azure Functions (Consumption) for low/medium-traffic bots

Pay per execution rather than 24×7 App Service plan; break-even at roughly 500K+ messages/month

Eliminates idle compute cost for bots below that threshold

Use CLU for intent recognition on structured intents

Azure AI Language CLU costs a fraction of a GPT-4o call per turn; route to LLM only for unstructured queries

60–90% reduction on AI cost for structured intent paths

Implement response caching for FAQ intents

Cache responses to the top N most common questions; serve from cache without calling AI services

Proportional to cache hit rate — often 20–50% of total traffic

Minimise Cosmos DB state payload

Store only dialog stack and essential fields; avoid storing conversation transcripts in state

Reduces RU/turn; scales with conversation volume

Right-size App Service plan

Profile actual CPU/memory usage under peak load; downsize SKU to match

30–60% reduction if currently over-provisioned

Use Container Apps for bots with variable traffic

Scales to zero when idle; no always-on compute cost; scales out under load

Eliminates idle cost; competitive with Functions at mid-range traffic

Configure Application Insights sampling

Sample at 10–25% for high-volume, low-value telemetry; retain full sampling for errors

50–80% reduction in Application Insights ingestion cost