Bots usually consume lots of different services, such as LUIS.ai, or QnaMaker.ai. When you are developing a bot, there is no uniform place to store the metadata about the services that are in use. This prevents us from building tooling that looks at a bot as a whole.
To address this problem, we have created a .bot file to act as the place to bring all service references together in one place to enable tooling. For example, the Bot Framework Emulator V4 uses a the .bot file to create a unified view over the connected services your bot consumes.
Via the .bot file, you can register services like:
- Localhost local debugger endpoints
- Azure Bot Service Azure Bot Service registrations.
- LUIS.AI LUIS gives your bot the ability to communicate with people using natural language..
- QnA Maker Build, train and publish a simple question and answer bot based on FAQ URLs, structured documents or editorial content in minutes.
- Dispatch models for dispatching across multiple services.
- Azure Application Insights for insights and bot analytics.
- Azure Blob Storage for bot state persistence.
- Azure Cosmos DB - globally distributed, multi-model database service to persist bot state.
Apart from these, your bot might rely on other custom services. You can leverage the generic service capability to connect a generic service configuration.
- If you create a bot using Azure Bot Service, a .bot file is automatically created for you with list of connected services provisioned. The .bot is encrypted by default. See here to learn more about encrypting and decrypting the .bot file.
- If you create a bot using Bot Builder V4 SDK Template for Visual Studio or using Yeoman BotBuilder Generator, a .bot file is automatically created for you. No connected services are provisioned in this flow and the bot file is not encrypted.
- If you are starting with BotBuilder-samples, every sample for Bot Builder V4 SDK includes a .bot file and the .bot file is not encrypted.
Here's an example .bot file.
- Do I need to use the .bot file to build a bot?
- Why do I need the bot file?
.bot file is not a requirement to build bots with Bot Builder SDK.
Also, you can continue to use appsettings/ web.config/ env, keyvault or any mechanism they you see fit to keep track of service references and keys that your bot depend on.
The advantages of using .bot file are:
- Bot Builder V4 SDK will be available in 4 platforms x languages – C#, JS, Python, Java. Each platform have their recommended way of keeping track of keys + env settings (appsettings.json, web.config, .env ...).
- Elegant tooling solutions around services creation and management is harder without a well defined schema (.bot file).
- Bot Framework Emulator, CLI tools rely on and work great with tracking connected services in a consistent format (in a .bot file)