AI-900Chapter 19 of 100Objective 4.6

Azure Bot Service and QnA Maker

This chapter covers Azure Bot Service and QnA Maker, two key services in Microsoft's AI portfolio for building conversational AI solutions. For the AI-900 exam, this topic appears in roughly 10-15% of questions, focusing on understanding the purpose, components, and use cases of these services. You will learn how to create a knowledge base with QnA Maker, integrate it with a bot, and deploy across channels. Mastery of this chapter ensures you can answer scenario-based questions about when to use each service and how they complement each other.

25 min read
Intermediate
Updated May 31, 2026

Restaurant Menu and Waiter System

Imagine a busy restaurant where customers can ask questions about the menu, place orders, or request modifications. The restaurant employs a team of waiters who are trained to handle common questions and tasks. However, instead of memorizing every possible question, the waiters have a well-organized menu book that lists all dishes, ingredients, and common modifications. When a customer asks, 'What's in the Caesar salad?', the waiter simply looks up 'Caesar salad' in the menu book and reads the ingredients. If the customer says, 'I'd like a Caesar salad, but no croutons,' the waiter understands the intent and modifies the order accordingly. The key is that the waiters are not natural language experts; they rely on the menu book (a knowledge base) to answer questions. The menu book is created and updated by the chef (the developer) who knows the menu inside out. In this system, the waiter is like the Azure Bot Service—it receives requests and routes them appropriately. The menu book is like QnA Maker—a structured repository of question-answer pairs. When a customer asks a question, the waiter (bot) searches the menu book (QnA Maker) for the best match, and if found, serves the answer. If not, the waiter might ask for clarification or escalate to a manager (human handoff). The restaurant can also have multiple waiters (bot channels) serving different tables (web, mobile, Teams), but all use the same menu book. This analogy shows how a bot with a curated knowledge base can handle customer interactions efficiently without deep language understanding.

How It Actually Works

What is Azure Bot Service and QnA Maker?

Azure Bot Service and QnA Maker are two distinct but complementary services in Azure AI that enable the creation of conversational interfaces. Azure Bot Service is a platform for building, testing, deploying, and managing intelligent bots that interact naturally with users across multiple channels such as web, mobile, Microsoft Teams, Skype, and Facebook Messenger. QnA Maker is a cognitive service that extracts question-answer pairs from semi-structured content like FAQs, product manuals, or support documents and creates a knowledge base that can be queried using natural language. Together, they allow you to build a bot that answers frequently asked questions without needing to train a custom language model.

How They Work Internally

QnA Maker works in three phases: extraction, training, and runtime. First, you provide source content such as URLs, PDFs, or DOCX files. QnA Maker uses built-in NLP to extract question-answer pairs, grouping them into a knowledge base. During training, you can edit pairs, add alternate phrasing, and publish the knowledge base. At runtime, when a user asks a question, the bot sends the query to QnA Maker's REST API endpoint. QnA Maker returns a ranked list of answers with confidence scores. The bot then selects the top answer if the score exceeds a configurable threshold (default 0.5). The scoring uses a combination of keyword matching, semantic similarity, and machine learning.

Azure Bot Service provides the Bot Framework SDK (available in C#, JavaScript, Python, and Java) to handle user messages, manage conversation state, and integrate with AI services like QnA Maker, LUIS, or Azure Cognitive Search. The bot runs as a web service that communicates via the Bot Framework Protocol, which uses JSON messages over HTTP. The Bot Service handles channel-specific transformations, so your bot code remains channel-agnostic. It also provides built-in features like dialogs, prompts, and waterfall steps for complex conversations.

Key Components and Defaults

QnA Maker Resource: You must create a QnA Maker resource in Azure, which includes a search service (Azure Cognitive Search) and a web app plan. The default tier is the Free tier, which supports up to 3 documents, 1 MB of content, and 50 transactions per minute. For production, use the Standard tier.

Knowledge Base: Contains question-answer pairs. Each pair has:

- Question (primary) - Alternate questions (synonyms) - Answer (rich text) - Metadata (key-value pairs for filtering) - Context (for follow-up prompts) - Confidence Score Threshold: Default 0.5 (50%). If no answer exceeds this, the bot returns a default message or prompts the user. - Bot Framework SDK: Supports multiple languages. The bot is typically hosted as an Azure App Service or a Function App. - Channels: Pre-configured connectors for Teams, Web Chat, Facebook Messenger, Slack, etc. You configure them in the Azure portal.

Configuration and Verification

To create a QnA Maker knowledge base: 1. Go to the QnA Maker portal (https://www.qnamaker.ai) or use the Azure portal. 2. Create a QnA Maker service (select tier, location, etc.). 3. Create a new knowledge base, specify source URLs or upload files. 4. Extract and edit pairs, add alternate questions. 5. Test in the built-in chat window. 6. Publish to get a REST endpoint.

To create a bot: 1. In Azure portal, create a 'Web App Bot' resource. 2. Choose SDK language and template (e.g., Echo Bot or QnA Bot). 3. In the bot code, configure the QnA Maker endpoint and knowledge base ID:

// C# example using Microsoft.Bot.Builder.AI.QnA
var qnaMaker = new QnAMaker(new QnAMakerEndpoint
{
    KnowledgeBaseId = "your-kb-id",
    EndpointKey = "your-endpoint-key",
    Host = "https://your-host.azurewebsites.net/qnamaker"
});
4.

Deploy the bot. Test using the Web Chat channel in Azure portal or the Bot Framework Emulator locally.

Interaction with Related Technologies

LUIS (Language Understanding): QnA Maker is for fixed Q&A; LUIS is for intent recognition and entity extraction. For complex bots, you can use both: LUIS identifies the user's intent (e.g., 'BookFlight'), and QnA Maker answers FAQs. The Bot Framework SDK provides a 'Dispatch' tool to route queries to the correct service.

Azure Cognitive Search: For large-scale document retrieval, you can combine QnA Maker with Cognitive Search to provide answers from unstructured content.

Power Virtual Agents: A low-code alternative to Bot Service, built on the same technology but with a graphical interface. It also uses QnA Maker for knowledge bases.

Step-by-Step Process

1.

Create a QnA Maker knowledge base - In the QnA Maker portal, create a new knowledge base and provide source URLs or files. The service extracts Q&A pairs.

2.

Edit and test the knowledge base - Review extracted pairs, add alternate questions, and test queries in the portal. Adjust confidence threshold if needed.

3.

Publish the knowledge base - Click 'Publish' to deploy the knowledge base to a REST endpoint. Note the endpoint host, knowledge base ID, and endpoint key.

4.

Create a bot using Azure Bot Service - In Azure portal, create a Web App Bot resource. Select the QnA template to automatically include QnA Maker integration.

5.

Configure the bot with QnA Maker - In the bot's application settings, add the QnA Maker endpoint details. Deploy the bot code.

6.

Test the bot - Use the Web Chat channel in Azure portal or the Bot Framework Emulator to send messages and verify answers.

7.

Add channels - In the Azure portal, add channels like Teams, Facebook Messenger, or Slack to reach users on their preferred platform.

8.

Monitor and improve - Use Application Insights to log conversations and identify unanswered questions. Add those as new Q&A pairs.

Real-World Scenario

Consider a large e-commerce company that receives thousands of customer support queries daily about order status, returns, shipping policies, and product details. They deploy a bot using Azure Bot Service with a QnA Maker knowledge base built from their FAQ page and return policy documents. The bot is integrated with Microsoft Teams for internal employees and the company's website for customers. During Black Friday, the bot handles 10,000 queries per hour with 95% accuracy. When a customer asks 'Where is my order?', the bot uses QnA Maker to find the answer about order tracking. If the query is not in the knowledge base, the bot escalates to a human agent via a handoff mechanism. The bot is configured with a fallback intent that logs missed queries for knowledge base improvement. Without proper configuration, the bot might return irrelevant answers or fail to escalate, leading to customer frustration. Common issues include setting the confidence threshold too low (causing wrong answers) or too high (causing too many fallbacks). Monitoring and iterative improvement are essential.

Walk-Through

1

Create QnA Maker knowledge base

Log into the QnA Maker portal (https://www.qnamaker.ai) or use Azure portal. Click 'Create a knowledge base'. Select an existing QnA Maker service or create a new one. Provide a name for the knowledge base. Add sources: URLs (e.g., FAQ pages), files (PDF, DOCX, Excel), or unstructured text. QnA Maker will extract question-answer pairs. For example, from a FAQ URL, each FAQ entry becomes a Q&A pair. You can also add chit-chat personality for casual interactions. After creation, the knowledge base is in 'draft' state.

2

Edit and test knowledge base

In the portal, review each extracted pair. You can add alternate phrasing (e.g., 'How do I reset my password?' as alternate for 'I forgot my password'). You can also add metadata tags for filtering (e.g., category='billing'). Use the 'Test' pane to simulate user queries. The system returns the best match with a confidence score. Adjust the confidence score threshold in the bot code (default 0.5). If a query returns low confidence, you can add that query as an alternate question or create a new pair. Also, use the 'Inspect' feature to see why a particular answer was chosen.

3

Publish knowledge base

Once satisfied, click 'Publish'. This deploys the knowledge base to a production endpoint. You will receive an endpoint URL, knowledge base ID, and endpoint key. For example, the endpoint might be 'https://yourhost.azurewebsites.net/qnamaker'. The endpoint key is a secret used for authentication. Note that publishing overwrites the previous version. You can also set up a 'Test' environment separately. The published endpoint is now ready to accept queries via HTTP POST requests.

4

Create Azure Bot Service

In Azure portal, search for 'Web App Bot' and create a new resource. Choose a subscription, resource group, and region. Select the SDK language (C#, JavaScript, Python, or Java) and the Bot template. For QnA integration, choose the 'QnA Bot' template, which preconfigures the bot to use QnA Maker. Alternatively, you can start with an 'Echo Bot' and manually add QnA code. The bot will be hosted as an Azure App Service. After creation, the bot's source code is available for download or online editing via App Service Editor.

5

Configure bot with QnA Maker

In the bot's application settings (Azure portal > App Service > Configuration), add the following settings: 'QnAKnowledgebaseId', 'QnAEndpointKey', and 'QnAEndpointHostName'. These values come from the published QnA Maker knowledge base. The bot code reads these settings at startup. For example, in C#, the QnAMaker class is instantiated with these values. After configuration, the bot will automatically call QnA Maker for every user message. You can also customize the logic, e.g., to handle multiple intents using LUIS.

6

Test bot

In Azure portal, go to the bot resource and open 'Test in Web Chat'. Type a question like 'What are your business hours?'. The bot should respond with the answer from QnA Maker. You can also download the Bot Framework Emulator (a desktop app) to test locally. In the emulator, connect to your bot's endpoint (e.g., 'http://localhost:3978/api/messages'). Verify that the bot returns correct answers and handles unknown queries gracefully. Use Application Insights to monitor performance and errors.

7

Add channels

In the bot's Azure portal, under 'Channels', you can add various channels: Web Chat (already enabled), Microsoft Teams, Facebook Messenger, Slack, Telegram, etc. For each channel, you need to configure credentials (e.g., app ID and secret for Facebook). The Bot Framework handles the translation between channels. For Teams, you also need to register the bot in Teams app catalog. Once configured, users can interact with the bot on their preferred platform.

8

Monitor and improve

Enable Application Insights for the bot to log all conversations. You can query logs to find unanswered questions or low-confidence answers. Use this data to add new Q&A pairs or alternate questions. Also, consider using the 'Active Learning' feature in QnA Maker, which suggests new alternate questions based on user queries. Periodically republish the knowledge base to deploy improvements. For high-volume scenarios, scale the App Service plan and the QnA Maker tier.

What This Looks Like on the Job

Enterprise Scenario 1: Customer Support Portal A global software company deploys a bot on their website to handle common support queries about installation, licensing, and troubleshooting. They create a QnA Maker knowledge base from their public FAQ, support articles (PDFs), and a chit-chat dataset. The bot is integrated with Azure Bot Service and deployed on the website via Web Chat. During a product launch, the bot handles 50,000 conversations per day, reducing support ticket volume by 40%. The bot uses a confidence threshold of 0.6 to avoid incorrect answers. If confidence is below 0.6, the bot offers to connect to a human agent via a live chat handoff. The company monitors Application Insights to identify top unanswered questions and updates the knowledge base weekly. Without proper tuning, the bot might return wrong answers (threshold too low) or frustrate users (threshold too high).

Enterprise Scenario 2: Internal HR Bot A large retail chain uses Azure Bot Service with QnA Maker to create an internal HR bot for employees. The knowledge base contains information about benefits, payroll, policies, and leave requests. The bot is published to Microsoft Teams, where employees can ask questions like 'How many vacation days do I have?' or 'What is the company policy on remote work?'. The bot uses metadata to filter answers based on the employee's role and location. For example, an employee in the US sees different benefits than one in Europe. The bot also integrates with Azure Active Directory for authentication. Performance is critical: the bot must respond in under 2 seconds. The company uses the Premium tier of QnA Maker for higher throughput. A common mistake is not using metadata filtering, resulting in irrelevant answers.

Scenario 3: Healthcare Appointment Bot A hospital system deploys a bot for patients to ask about appointment scheduling, medication refills, and visiting hours. The knowledge base is built from the hospital's website and patient guides. The bot is integrated with the hospital's scheduling system via custom code (not QnA Maker) for transactional queries. QnA Maker handles only informational queries. The bot is deployed on the hospital's mobile app and website. Security is paramount: the bot uses Azure Bot Service's Direct Line channel with a secret key. The hospital monitors for PHI leakage and ensures no patient data is stored in QnA Maker logs. A common pitfall is exposing sensitive information in answers; the team carefully reviews all Q&A pairs before publishing.

How AI-900 Actually Tests This

AI-900 Exam Focus on Azure Bot Service and QnA Maker

Objective Codes: The relevant objective is 'Describe features of conversational AI workloads on Azure' (AI-900 objective 4.6). Specifically, you should be able to identify the capabilities of Azure Bot Service and QnA Maker, and know when to use each.

Common Wrong Answers: 1. 'QnA Maker can understand complex conversations and maintain context.' Wrong. QnA Maker is stateless—each query is independent. For multi-turn conversations, you need the Bot Framework's dialogs or use the context feature in QnA Maker (which is limited). 2. 'Azure Bot Service is required to use QnA Maker.' Wrong. QnA Maker can be used standalone via REST API without a bot. However, the exam may present a scenario where a bot is needed for a conversational interface. 3. 'QnA Maker can answer any question with high accuracy.' Wrong. QnA Maker works best for factoid questions; it cannot handle open-ended or generative responses. 4. 'You must train a custom model to use QnA Maker.' Wrong. QnA Maker uses pre-built extraction and scoring; no custom training is needed, though you can improve accuracy by editing pairs.

Specific Values and Terms: - Default confidence score threshold: 0.5 (50%). - Supported source types: URLs (public FAQ pages), files (PDF, DOCX, TXT, Excel), and Q&A content. - QnA Maker tiers: Free (50 transactions/min, 3 documents, 1 MB), Standard (unlimited transactions, 50 documents, 10 GB). - Bot Framework SDK languages: C#, JavaScript, Python, Java. - Channels: Web Chat, Microsoft Teams, Facebook Messenger, Slack, Telegram, etc.

Edge Cases: - If a query does not match any Q&A pair, the bot should return a default message like 'I'm sorry, I don't have an answer for that.' The exam may test whether you know to configure a fallback. - Active Learning: QnA Maker can automatically suggest new alternate questions based on user queries. This is a key feature to know. - Multi-turn conversations: QnA Maker supports 'context' to handle follow-up questions (e.g., 'What is the price?' followed by 'And the warranty?'). The exam may ask how to enable this.

How to Eliminate Wrong Answers: - If the scenario involves understanding user intent (e.g., 'Book a flight'), the answer should involve LUIS, not QnA Maker. - If the scenario requires a conversational interface with multiple channels, the answer should include Azure Bot Service. - If the scenario is about extracting answers from a FAQ, the answer is QnA Maker. - If the scenario mentions 'low-code' or 'no-code', think Power Virtual Agents (which also uses QnA Maker).

Key Takeaways

Azure Bot Service is a platform for building, deploying, and managing bots across multiple channels.

QnA Maker extracts question-answer pairs from semi-structured content like FAQs and PDFs.

The default confidence score threshold in QnA Maker is 0.5 (50%).

QnA Maker supports sources: URLs, PDFs, DOCX, TXT, Excel, and manual Q&A pairs.

Active Learning in QnA Maker suggests new alternate questions based on user queries.

Bot Framework SDK supports C#, JavaScript, Python, and Java.

Common channels include Web Chat, Microsoft Teams, Facebook Messenger, and Slack.

QnA Maker is stateless; for multi-turn conversations, use Bot Framework dialogs.

Power Virtual Agents is a low-code alternative to Azure Bot Service for building chatbots.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

QnA Maker

Answers factoid questions from a fixed knowledge base.

Returns a direct answer with a confidence score.

No training required; extraction from documents.

Stateless; each query is independent.

Best for FAQ-style chatbots.

LUIS

Extracts user intent and entities from natural language.

Returns a structured intent and entities, not an answer.

Requires training on labeled utterances.

Can maintain context across utterances.

Best for task-oriented bots (e.g., booking, ordering).

Watch Out for These

Mistake

QnA Maker is a chatbot platform.

Correct

QnA Maker is a question-answering service that creates a knowledge base. It is not a bot platform. You use Azure Bot Service or Power Virtual Agents to build the chatbot that uses QnA Maker.

Mistake

You can use QnA Maker without any data.

Correct

QnA Maker requires source data (URLs, files, or text) to extract Q&A pairs. It cannot generate answers from nothing.

Mistake

QnA Maker can handle multi-turn conversations natively.

Correct

QnA Maker supports basic context for follow-up prompts, but complex multi-turn conversations require the Bot Framework's dialogs. The exam may test that QnA Maker is stateless.

Mistake

Azure Bot Service can only be used with QnA Maker.

Correct

Azure Bot Service can integrate with many AI services, including LUIS, Azure Cognitive Search, and custom APIs. QnA Maker is just one option.

Mistake

Publishing a knowledge base makes it available to everyone.

Correct

Publishing creates a REST endpoint that requires an endpoint key for access. You control who can query it.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between QnA Maker and LUIS?

QnA Maker is for answering factoid questions from a fixed knowledge base, returning a direct answer. LUIS is for understanding user intent and extracting entities, returning a structured intent. Use QnA Maker for FAQs; use LUIS for task-oriented conversations like booking a flight. They can be combined in a single bot.

Do I need Azure Bot Service to use QnA Maker?

No. QnA Maker can be used standalone via its REST API. However, to build a conversational interface (chatbot), you typically use Azure Bot Service or Power Virtual Agents. The exam may present a scenario where a bot is required.

How do I improve the accuracy of QnA Maker?

Add alternate questions to existing pairs, use metadata for filtering, enable Active Learning to suggest new questions, and adjust the confidence score threshold. Also, ensure your source content is well-structured.

Can QnA Maker handle multiple languages?

Yes. When creating a knowledge base, you specify the language. QnA Maker supports dozens of languages. Each knowledge base is language-specific; you need separate knowledge bases for different languages.

What is the purpose of the confidence score in QnA Maker?

The confidence score indicates how likely the answer is correct. The bot uses a threshold (default 0.5) to decide whether to return the answer or a fallback message. You can adjust this threshold in your bot code.

How do I deploy a bot to Microsoft Teams?

In Azure portal, under your bot resource, go to Channels and add the Teams channel. You also need to register the bot in the Teams app catalog. The Bot Framework handles the protocol translation.

What is Active Learning in QnA Maker?

Active Learning automatically suggests new alternate questions based on user queries that were answered with low confidence. You can review and accept these suggestions in the portal to improve the knowledge base over time.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Azure Bot Service and QnA Maker — now see how well it sticks with free AI-900 practice questions. Full explanations included, no account needed.

Done with this chapter?