I am new to azure bot service. I have created new bot first time and downloaded the source code from azure portal. In the source code there is a bot extension settings file. There all bot related settings are placed. My problem is, again I have created new bot and downloaded the source code from azure portal. But there is no any bot extension file is exists in the source code. How can I get the bot extension settings file. Please give your suggestion.
The bot framework team is moving away from storing bot information in the .bot file, and is now putting the keys in appsettings.json. Bot source code downloaded off Azure now follows this principle, and should include a ConfigurationCredentialProvider.cs that will look for the info in your appsettings.json:
public class ConfigurationCredentialProvider : SimpleCredentialProvider
{
public ConfigurationCredentialProvider(IConfiguration configuration)
: base(configuration["MicrosoftAppId"], configuration["MicrosoftAppPassword"])
{
}
}
This ConfigurationCredentialProvider is added as a singleton in the Startup.cs file:
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
if (!string.IsNullOrEmpty(Configuration[BotOpenIdMetadataKey]))
ChannelValidation.OpenIdMetadataUrl = Configuration[BotOpenIdMetadataKey];
// Create the credential provider to be used with the Bot Framework Adapter.
services.AddSingleton<ICredentialProvider, ConfigurationCredentialProvider>();
// Create the Bot Framework Adapter.
services.AddSingleton<IBotFrameworkHttpAdapter, BotFrameworkHttpAdapter>();
// Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
services.AddTransient<IBot, EchoBot>();
}