You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
Install Azure Storage Emulator and check operation
Steps to reproduce using SampleAADv2Bot:
Install NuGet Package Autofac.WebApi2
Install NuGet package Microsoft.BotBuilder.Azure
in Global.asax.cs
Add the following after the Application Start method
private void ConfigureBotTableStorage()
{
string tableName = "UserStateDev";
TableBotDataStore store = new TableBotDataStore(CloudStorageAccount.DevelopmentStorageAccount, tableName);
var builder = new ContainerBuilder();
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder
.Register(c =>
{
return new CachingBotDataStore(store, CachingBotDataStoreConsistencyPolicy.ETagBasedConsistency);
})
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
// Get your HttpConfiguration.
var config = GlobalConfiguration.Configuration;
// Register your Web API controllers.
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
// OPTIONAL: Register the Autofac filter provider.
builder.RegisterWebApiFilterProvider(config);
// Set the dependency resolver to be Autofac.
//var container = builder.Build();
builder.Update(Conversation.Container);
config.DependencyResolver = new AutofacWebApiDependencyResolver(Conversation.Container);
@@}
Before the line GlobalConfiguration.Configure(WebApiConfig.Register);
insert the line ConfigureBotTableStorage();
Install Azure Storage Emulator and check operation
Steps to reproduce using SampleAADv2Bot:
in Global.asax.cs
Add the following after the Application Start method
private void ConfigureBotTableStorage()
{
string tableName = "UserStateDev";
Before the line
GlobalConfiguration.Configure(WebApiConfig.Register);insert the line
ConfigureBotTableStorage();Save and compile
Connect to the bot on http://localhost:3978/api/messages with the Bot Framework Channel Emulator
Send logon to the bot inthe emulator
Click the Authentication Required link in the emulator
Log in using a Microsoft account in the browser window that opens
Copy the magic number to send back to the bot
Expected behavior
Bot prompts for the magic number
Actual behavior
Bot displays sign-in card again.