Create an Azure Bot

This guide walks you through the process of creating a new bot using the Azure Bot Service. We'll cover the essential steps to get your bot up and running.

Prerequisites

Steps to Create a Bot

  1. Navigate to the Azure Portal:

    Open your web browser and go to https://portal.azure.com/. Log in with your Azure account credentials.

  2. Create a New Resource:

    Click on the + Create a resource button in the upper-left corner of the Azure portal.

  3. Search for "Bot":

    In the search bar, type "Bot" and select Azure Bot from the search results. Then, click Create.

  4. Configure Bot Settings:

    You will be presented with a form to configure your bot. Fill in the following details:

    • Bot handle: A unique name for your bot (e.g., MyAwesomeChatBot).
    • Subscription: Select your Azure subscription.
    • Resource group: Choose an existing resource group or create a new one.
    • Pricing tier: Select a pricing tier. The F0 (Free) tier is suitable for development and testing.
    • Microsoft App ID: Choose 'Create new Microsoft App ID'. This will automatically create an App Registration in Azure Active Directory for your bot.
    Azure Bot Creation Form Screenshot
  5. Review and Create:

    Once you have filled in all the required fields, click on the Review + create button. After Azure validates the settings, click Create.

  6. Deploy Your Bot:

    The deployment process will take a few minutes. Once completed, click Go to resource.

Note on App ID

The Microsoft App ID and password (or secret) are essential for authenticating your bot. When you choose to create a new App ID, Azure handles this for you. If you already have an App ID, you can select 'Use existing Microsoft App ID' and provide the details.

Next Steps

Congratulations! You have successfully created an Azure Bot resource. Now you can proceed to:

Here's a quick example of how you might interact with your bot using the Bot Framework SDK:


// Example using Node.js Bot Framework SDK
const builder = require('botbuilder');
const restify = require('restify');

// Setup Restify Server
const server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
   console.log('%s listening to %s', server.name, server.url);
});

// Create chat connector for communicating with the Bot Framework Service
const connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});

// Listen for messages from users
server.post('/api/messages', connector.listen());

// Create your bot with a single dialog that echoes the user's message
const bot = new builder.UniversalBot(connector, [
    function (session) {
        session.send('Hi, I am your bot. You said: %s', session.message.text);
    }
]);
            

Tip

For more complex bots, consider using the Azure Bot Service SDK and Bot Framework Composer, a visual designer for building conversational AI. You can find more examples and documentation on the SDKs page.

To test your bot, you can use the Web Chat channel directly within the Azure portal's Azure Bot resource page, or use the Bot Framework Emulator.

Get Started with Bot Development