azure 源代码中没有 bot 扩展文件
There is no bot extension file in azure source code
我是 azure 机器人服务的新手。我第一次创建了新的机器人并从 Azure 门户网站下载了源代码。在源代码中有一个机器人扩展设置文件。那里放置了所有与机器人相关的设置。我的问题是,我再次创建了新的机器人并从 Azure 门户下载了源代码。但是源代码中不存在任何bot扩展文件。如何获取机器人扩展设置文件。请给出你的建议。
机器人框架团队不再将机器人信息存储在 .bot 文件中,而是将密钥放入 appsettings.json。从 Azure 下载的机器人源代码现在遵循这一原则,并且应该包含一个 ConfigurationCredentialProvider.cs,它将在您的 appsettings.json:
中查找信息
public class ConfigurationCredentialProvider : SimpleCredentialProvider
{
public ConfigurationCredentialProvider(IConfiguration configuration)
: base(configuration["MicrosoftAppId"], configuration["MicrosoftAppPassword"])
{
}
}
此 ConfigurationCredentialProvider 已作为单例添加到 Startup.cs 文件中:
// 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>();
}
我是 azure 机器人服务的新手。我第一次创建了新的机器人并从 Azure 门户网站下载了源代码。在源代码中有一个机器人扩展设置文件。那里放置了所有与机器人相关的设置。我的问题是,我再次创建了新的机器人并从 Azure 门户下载了源代码。但是源代码中不存在任何bot扩展文件。如何获取机器人扩展设置文件。请给出你的建议。
机器人框架团队不再将机器人信息存储在 .bot 文件中,而是将密钥放入 appsettings.json。从 Azure 下载的机器人源代码现在遵循这一原则,并且应该包含一个 ConfigurationCredentialProvider.cs,它将在您的 appsettings.json:
中查找信息public class ConfigurationCredentialProvider : SimpleCredentialProvider
{
public ConfigurationCredentialProvider(IConfiguration configuration)
: base(configuration["MicrosoftAppId"], configuration["MicrosoftAppPassword"])
{
}
}
此 ConfigurationCredentialProvider 已作为单例添加到 Startup.cs 文件中:
// 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>();
}