Create your first QnA Maker knowledge base

  1. Sign in to the portal with your Azure credentials.
  2. In the QnA Maker portal, select Create a knowledge base.
  3. On the Create page, skip Step 1 if you already have your QnA Maker resource.

    If you haven’t created the resource yet, select Create a QnA service. You are directed to the Azure portal to set up a QnA Maker service in your subscription. Remember your Azure Active Directory ID, Subscription, QnA resource name you selected when you created the resource.

    When you are done creating the resource in the Azure portal, return to the QnA Maker portal, refresh the browser page, and continue to Step 2.

  4. In Step 3, select your Active directory, subscription, service (resource), and the language for all knowledge bases created in the service.

    QNA 1

  5. In Step 3, name your knowledge base My Sample QnA KB.
  6. In Step 4, configure the settings with the following table:
    TABLE 1
    Setting Value
    Enable multi-turn extraction from URLs, .pdf or .docx files. Checked
    Default answer text Quickstart - default answer not found.
    + Add URL
    Chit-chat Select Professional
  7. In Step 5, Select Create your KB.

    The extraction process takes a few moments to read the document and identify questions and answers.

    After QnA Maker successfully creates the knowledge base, the Knowledge base page opens. You can edit the contents of the knowledge base on this page.

Add a new question and answer set

  1. In the QnA Maker portal, on the Edit page, select + Add QnA pair from the context toolbar.
  2. Add the following question:

    How many Azure services are used by a knowledge base?

  3. Add the answer formatted with markdown:

    * Azure QnA Maker service\n* Azure Cognitive Search\n* Azure web app\n* Azure app plan

    QNA 2

    The markdown symbol, *, is used for bullet points. The \n is used for a new line.

    The Edit page shows the markdown. When you use the Test panel later, you will see the markdown displayed properly.

Save and train

In the upper right, select Save and train to save your edits and train QnA Maker . Edits aren’t kept unless they’re saved.

Test the knowledge base

  1. In the QnA Maker portal, in the upper right, select Test to test that the changes you made took effect.
  2. Enter an example user query in the textbox.

    How many Azure services are used by a knowledge base?

    QNA 3

  3. Select Inspect to examine the response in more detail. The test window is used to test your changes to the knowledge base before publishing your knowledge base.
  4. Select Test again to close the Test panel.

Publish the knowledge base

When you publish a knowledge base, the contents of your knowledge base moves from the test index to a prod index in Azure search.


  1. In the QnA Maker portal, select Publish. Then to confirm, select Publish on the page.

    The QnA Maker service is now successfully published. You can use the endpoint in your application or bot code.

    QNA 5

Create a bot

After publishing, you can create a bot from the Publish page:

  • You can create several bots quickly, all pointing to the same knowledge base for different regions or pricing plans for the individual bots.
  • If you want only one bot for the knowledge base, use the View all your bots on the Azure portal link to view a list of your current bots.

When you make changes to the knowledge base and republish, you don’t need to take further action with the bot. It’s already configured to work with the knowledge base, and works with all future changes to the knowledge base. Every time you publish a knowledge base, all the bots connected to it are automatically updated.

  1. In the QnA Maker portal, on the Publish page, select Create bot. This button appears only after you’ve published the knowledge base.

    QNA 6

  2. A new browser tab opens for the Azure portal, with the Azure Bot Service’s creation page. Configure the Azure bot service. The bot and QnA Maker can share the web app service plan, but can’t share the web app. This means the app name for the bot must be different from the app name for the QnA Maker service.
    • Do
      • Change bot handle – if it is not unique.
      • Select SDK Language. Once the bot is created, you can download the code to your local development environment and continue the development process.
    • Don’t
      • change the following settings in the Azure portal when creating the bot. They are pre-populated for your existing knowledge base:
        • QnA Auth Key
        • App service plan and location
  3. After the bot is created, open the Bot service resource.
  4. Under Bot Management, select Test in Web Chat.
  5. At the chat prompt of Type your message, enter:

    Azure services?

    The chat bot responds with an answer from your knowledge base.

    QNA 7

What did you accomplish?

You created a new knowledge base, added a public URL to the knowledge base, added your own QnA pair, trained, tested, and published the knowledge base.

After publishing the knowledge base, you created a bot, and tested the bot.

This was all accomplished in a few minutes without having to write any code or clean the content.