Why Need a Teams Bot?
A Microsoft Teams bot integrated with OpenAI enhances
team collaboration by automating repetitive tasks, providing instant responses to queries, and streamlining
workflows. It improves productivity and ensures round-the-clock support, offering human-like interactions within
the team's environment.
Key Advantages:
- Automated Assistance: Reduces repetitive work and answers common questions instantly.
- Natural Conversations: Uses AI to understand and respond naturally in multiple languages.
- Integration and Personalization: Customizable to meet specific
business needs and integrate with other tools
This blog is divided into two parts to help you easily navigate and follow the steps for creating and
deploying a bot:
Part 1: Azure Configuration for Your Bot
- Setting up a new resource group for your bot.
- Set up the Azure Bot and Key Vault resources.
- Setting up the web application along with its service plan.
- Configuring the bot credentials and channels
- Add the Bot Framework v4 SDK Templates to Visual Studio.
- Create an Echo Bot Solution in Visual Studio.
- Configure the OpenAI API in the Echo Bot Solution.
- Test the Bot Locally in BotFramework-Emulator.
- Deploy the Bot to Azure App Service.
- Create a manifest.json for Microsoft Teams.
- Add the App to Microsoft Teams.
This blog covers the points of Part 1: Azure Configuration for Your Bot.
- Setting up a new resource group for your
bot.
- Launch the Azure Portal in your browser.
- Navigate to Resource Groups from the menu on the left, and click Create.
- Choose the subscription you want to use.
- Enter a name for the resource group, following your organization's naming standards.
- Pick a region close to your users (for example, the US
if your users are in Europe
- Set up the Azure Bot and Key Vault
resources.
- Within the newly created resource group, click the 'Create Resource' button. This will take you to the Marketplace.
- In the search bar, type Azure Bot and select it from the
results.
- Click Create to start setting up your
bot.
- Enter a unique name for the bot as its identifier (e.g., projectname-bot). This will serve as the bot’s "handle." You can set a separate display name, but the handle is just a unique identifier.
- Verify that the correct subscription and resource group are preselected.
- The default pricing tier is Standard, but you can downgrade it to Free by selecting Change plan if premium channels aren't needed.
- Choose 'Multi-Tenant' as the app type.
- Keep the creation type set to its default option, which is
'Create a new Microsoft App ID'.
- Finally, navigate to the 'Review + Create' tab and click on 'Create.'
- Once the bot resource is created, click on 'Go to the resource.'
- Setting up the web application along
with its service plan.
- After the bot resource is created, click on 'Go to the resource.'
- In the search bar, type Web App and select
it
- Click on Create.
- Subscription: Select your Azure subscription.
- Resource Group: Choose an existing resource group or create a new one.
- Name: Enter a unique name for your web app.
- Publish: Choose Code if you are deploying code directly, or Docker Container if you are using a container.
- Runtime Stack: Select the runtime stack (e.g., .NET, Node.js, Python, etc.).
- Region: Choose the region closest to your users.
- App Service Plan: Select an existing plan or create a new one.
- Review all the configurations and click on Create.
Azure will deploy your web app, which might take a few minutes.
- Configuring the bot credentials and channels
.
- Navigate to the Configuration section in the bot resource settings.
- Go to your Azure Bot > Configuration > Messaging
endpoint: set to the URL that your App Service gave you +
“api/messages”
- Copy the Microsoft App ID to a place like Notepad, as
you'll need to use it later in your bot code project.
- Click on the 'Manage' link just above the field containing the GUID you copied. This will take you to the Azure AD app registration created alongside your bot resource.
- You will land on the 'Certificates and Secrets' section. Generate a new client secret (valid for 24 months) and save its value in Notepad for future use.
- Now that we have the authentication details, let's enable the bot to communicate with our client application. Although I am setting up a bot for Teams here, you can choose another platform as the bot channel in a similar manner.
- Return to the bot resource and navigate to the Channels section.
- Open the Channels section.
- Select Microsoft Teams (or another
platform)
- Accept the terms of service if required.
- Use the default settings (Teams Commercial, calling off) or adjust them for your bot’s needs (e.g., GCC environment, calling enabled)
- Click Apply and Close.
Thank you for reading! We hope this guide helped with Azure configuration for your bot. Click here to read Part 2 and complete your bot setup!
If you have any questions you can reach out our SharePoint Consulting team here.
No comments:
Post a Comment