# Creating your Bot Service

## Creating a Bot Service resource

Before we can start working on the bot logic itself, we need to make the Bot Service that will support the rest of this project. In your Microsoft Azure portal, head to the resource group you want the resource to be created in. Then, click the Create button.

![](/files/TIDr1bF4WptYZ1qbXvgi)

In the Marketplace, search for Bot and create a new Azure Bot resource

{% hint style="info" %}
Tip: Check the "Azure Services Only" box to easier find Azure resources
{% endhint %}

<figure><img src="/files/3NLyHaq0l5a2LWOwSw5p" alt=""><figcaption></figcaption></figure>

On the Basics tab, create a handle for your bot. This is a unique ID for your bot, and while you can change its display name later, you cannot change the handle. Set the subscription, resource group, and data residency. Select the free plan under Pricing.

<figure><img src="/files/PrUSVMeaZFpSd9fLU6Z3" alt=""><figcaption></figcaption></figure>

### Types of App Identities

Choosing the correct App Type under Microsoft App ID is crucial. The different types are:

* Single Tenant Identity
  * For Bots that will only be accessed from your tenant and will use your tenant for authentication. This is only supported by the C# and JavaScript SDK.&#x20;
  * Authentication is handled with Client ID and Secret
* Multi Tenant Identity
  * For bots that will be accessed from multiple Microsoft tenants and will use the bot service for authentication. Supported by all SDKs.
  * Authentication is handled with Client ID and Secret
* User Assigned Managed Identity
  * For bots that will be accessed from multiple Microsoft tenants and will use the bot service for authentication. Supported by only the C# and JavaScript SDK.
  * Authentication is handled by an Azure Managed Identity, and cannot be used with Client ID and Secret

Given these behaviors, we'll choose Multi-Tenant as we want a Client ID and Secret to be used by our RPA platform. If we were making a bot that was hosted on an Azure App Service, Managed Identity would be recommended.

<figure><img src="/files/XyqpItVTXcyxawEUOaoO" alt=""><figcaption></figcaption></figure>

You can now proceed to assign any tags you may want, and create the resource

## Configuring the Bot Service

#### Customizing your bot

Once your resource is created, navigate to it. Select Bot Profile under Settings in the left navigation bar

![](/files/5vpGHzr9uTDq5ZNTixbm)

On the Profile page you can set your bot's icon, name, and description

<figure><img src="/files/gcB5QbzLFBYTEkbhjV3m" alt=""><figcaption><p>Icon courtesy of DALL-E :)</p></figcaption></figure>

#### Connecting your bot to Teams

Click the Channels button in the left navigation bar

![](/files/B9DjnmuYoM7YZBGaoZRP)

Select the Microsoft Teams channel

<figure><img src="/files/oLNhNW4Qbs1FQkdbfW0o" alt=""><figcaption></figcaption></figure>

Accept the terms and click the Apply button to choose the Microsoft Teams Commercial channel. You'll now see Teams under your connected channels with a Healthy icon

<figure><img src="/files/JVGqw4lMmnqUP4TzsNLz" alt=""><figcaption></figcaption></figure>

## Getting your bot's Authentication

Your bot will happily send requests to you all day, but when responding you need to specify who you are back. By selecting Multi-Tenant on our app type, a new App Registration has been created in our Azure Active Directory tenant. Head on over to the Entra portal -> Azure AD -> Applications -> App Registrations

![](/files/CznCQeLdas05Rc5xnXib)

Under Owned Applications, select your bot

<figure><img src="/files/B9enRMY5eGlU48BFYbyr" alt=""><figcaption></figcaption></figure>

In the Essentials tab on the Overview page, note the Application (client) ID, and Directory (tenant) ID

![](/files/zLF04vGFrzj1AwEobQ4g)

Go to Certificates & Secrets, then create a new Client Secret. Name this secret and set its validity length

<figure><img src="/files/YL0YXPdnGZZu8wn3cQCe" alt=""><figcaption></figcaption></figure>

Copy the Secret Value to your clipboard before leaving the page! This secret will not be shown again, so document it somewhere safe

<figure><img src="/files/0O9iSGcf3pcYCbzcb9E8" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.gigacode.dev/technology/cloud-concepts/microsoft-azure/bot-framework/creating-your-bot-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
