GithubHelp home page GithubHelp logo

microsoft / botbuilder-azure Goto Github PK

View Code? Open in Web Editor NEW
78.0 46.0 92.0 470 KB

Azure specific functionality of the Microsoft Bot Builder

License: MIT License

CSS 10.85% HTML 5.15% Batchfile 0.18% JavaScript 9.96% TypeScript 7.36% C# 66.05% ASP 0.05% PowerShell 0.39%

botbuilder-azure's Introduction

V3 Deprecation Notification

Microsoft Bot Framework SDK V4 was released in September 2018, and since then we have shipped a few dot-release improvements. As announced previously, the V3 SDK is being retired with final long-term support ending on December 31st, 2019. Accordingly, there will be no more development in this repo. Existing V3 bot workloads will continue to run without interruption. We have no plans to disrupt any running workloads.

We highly recommend that you start migrating your V3 bots to V4. In order to support this migration we have produced migration documentation and will provide extended support for migration initiatives (via standard channels such as Stack Overflow and Microsoft Customer Support).

For more information please refer to the following references:

Bot Builder SDK Azure Extensions

The Microsoft Bot Builder SDK Azure Extensions allow for interactions with specific Azure components.

Bot Builder SDK

For More information about the Bot Builder SDK, which is one of the three main components of the Microsoft Bot Framework, please Review the documentation.

The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.

Bots (or conversation agents) are rapidly becoming an integral part of one’s digital experience – they are as vital a way for users to interact with a service or application as is a web site or a mobile experience. Developers writing bots all face the same problems: bots require basic I/O; they must have language and dialog skills; and they must connect to users – preferably in any conversation experience and language the user chooses. The Bot Framework provides tools to easily solve these problems and more for developers e.g., automatic translation to more than 30 languages, user and conversation state management, debugging tools, an embeddable web chat control and a way for users to discover, try, and add bots to the conversation experiences they love.

Azure Extensions

Bot Azure Storage

The Bot Builder SDK Azure Extensions enable bot developers to integrate bots with specific Azure components.

  • Azure Table Storage: Allows bot developers to store bot state in their own Azure Storage accounts. For more information on Azure Table Storage, visit the Azure Table Storage Documentation
  • Azure CosmosDB: Allows bot developers to store bot state in CosmosDB. For more information on Azure CosmosDb, visit the Azure CosmosDB Documentation

Azure Table Logging

The Bot Builder SDK Azure Extensions also include TableLogger, an implementation of IActivityLogger which will log activities to the specified Azure Table.

Azure Extensions Samples

Get started quickly with our samples:

See all the support options here.

Published Libraries

Botbuilder v4

botbuilder-azure's People

Contributors

andrea-orimoto avatar carlosscastro avatar ejadib avatar jasonsowers avatar martabrzeszczyk avatar mburleigh avatar msft-shahins avatar mzilberman avatar negativeeddy avatar nt-7 avatar scheyal avatar shwalker-msft avatar stevengum avatar stevenic avatar tomlm avatar willportnoy avatar xtellurian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botbuilder-azure's Issues

Cannot retrieve documents from database

I am trying to retrieve the documents from database. However, it shows me the following.
`
TypeError: Cannot read property 'queryDocuments' of undefined

at DocumentDbClient.retrieve (node_modules/botbuilder-azure/lib/DocumentDbClient.js:45:35)

at MyBot.send (bot/bot.js:959:26)

at app.js:57:13

`

Cannot read property 'statusCode' of null

Anybody else seeing the following error or know what could possibly be causing it? It happens regularly, but no steps to reproduce.

/Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/lib/AzureTableClient.js:38
            if (response.statusCode == Consts.HttpStatusCodes.NotFound) {
                         ^

TypeError: Cannot read property 'statusCode' of null
    at /Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/lib/AzureTableClient.js:38:26
    at finalCallback (/Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/services/table/tableservice.js:1297:9)
    at /Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/common/filters/retrypolicyfilter.js:178:13
    at /Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/common/services/storageserviceclient.js:756:17
    at /Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/common/services/storageserviceclient.js:959:11
    at /Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/common/services/storageserviceclient.js:755:15
    at processResponseCallback (/Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/services/table/tableservice.js:1301:5)
    at Request.processResponseCallback [as _callback] (/Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/azure-storage/lib/common/services/storageserviceclient.js:316:13)
    at self.callback (/Users/alexanderknipfer/Projects/chronos/node_modules/botbuilder-azure/node_modules/request/request.js:187:22)
    at Request.emit (events.js:180:13)

Exception when trying to use SQLExpress

stacktrace.txt

I am hoping windows authentication in web.config is ok/ or should i use sql username /passwords?

<connectionStrings>
    <add name="BotDataContextConnectionString"
      providerName="System.Data.SqlClient"
      connectionString="Data Source=HIDD68201\SQLEXPRESS;Initial Catalog=botstate;Integrated Security=True" />
  </connectionStrings>

i have a blank database in sqlexpress called botstate.

Any ideas what could be the exception about?
I have attached the stacktrace here.

How to save bot chat history ?

Hello,

I am using node js sdk to write ms bot service. Currently, I am saving everything in data bags (conversationData, userData etc) and using documentDb to store the state. I have also implemented middleware logging to intercept user to Bot and bot to user messages and logging them on console.
There are few concerns with this approach,

  1. conversationData is cleared when we call endConversation() in dialog. Thats expected by design but we would like to persist this data for multiple conversation flows with same user (same conversation id.) Now, json document in db gets replaced with new keys on conversationData when user start new intent.
    Ex: schedule a meeting with {name} for {day} at {place}.
    we save conversationData.name , conversationData.day , and conversationData. place.

same user starts over schedule a meeting with {name2} for {day2} at {place2}.
documentDb entry gets replaced with conversationData.name1 , conversationData.day2 , and conversationData. place2

Ideally, we would like to keep everything.

  1. Issue 2 is middleware logging is not able to hold session object so I can't save each event.text to any databag? Is this correct approach or there is better way to save chat history ?

const logUserConversation = (event) => {
console.log(' ******** BOT/User Message: ' + event.text);
//Want to save event.text somewhere ??
};

//Middleware for logging
bot.use({
receive: function (event, next) {
logUserConversation(event);
next();
},
send: function (event, next) {
logUserConversation(event);
next();
}
});

Also, I am not sure why ConversationData data bag is cleared even though I set to true as follows for persistence.

bot.set('persistConversationData', true);

any help would me much appreciated. Thanks in advance.

Node.js function issues when trying to connect to Azure SQL Database

Hey everyone,

So for some reason I'm having issues when using the code at the bottom. It will run anything that I place in my first function:

 function (session) {
        session.send("Hi there!");
        builder.Prompts.text(session, "What's your name?");   
    },

but will not run the function that follows. It will just re-run the first function when it receives an answer to "what's your name?"

However, if I switch over to table storage on my account or use the in-memory storage, then this will work without any issues. I've even tried running two simple functions like this:

 function (session) {
        session.send("Hi there!"); 
    },
 function (session) {
        builder.Prompts.text(session, "What's your name?");   
    },

with no success. The table in the database that I'm writing to will capture the initial state of the program (for instance):

{"BotBuilder.Data.SessionState":{"callstack":[{"id":"*:/","state":{"BotBuilder.Data.WaterfallStep":0}},{"id":"BotBuilder:prompt-text","state":{"options":{"prompt":"What's your name?","promptAfterAction":true,"libraryNamespace":"*"},"turns":0,"lastTurn":1111111111111,"isReprompt":false,"name":"umm"}}],"lastAccess":1111111111111,"version":0}}

(I replaced the "lastTurn" and "lastAccess" values with 1's because I'm not exactly sure what data they hold)

I'm assuming that it's probably my lack of knowledge regarding how I'm connected to the database that's causing this issue, but I'm completely stuck and haven't been able to find anything via searching. My full code is the following:

var restify = require('restify');
var builder = require('botbuilder');
var botbuilder_azure = require("botbuilder-azure");

// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
   console.log('%s listening to %s', server.name, server.url); 
});
  
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
    appId: process.env.MicrosoftAppId,
    appPassword: process.env.MicrosoftAppPassword,
    openIdMetadata: process.env.BotOpenIdMetadata 
});

// Listen for messages from users 
server.post('/api/messages', connector.listen());

var sqlConfig = {
    userName: 'USERNAME',
    password: 'PASSWORD',
    server: 'SERVER_NAME',
    //enforceTable: true, // If this property is not set to true it defaults to false. When false if the specified table is not found, the bot will throw an error.
    options: {
        database: 'DATABASE',
        table: 'TABLE',
        encrypt: true,
        rowCollectionOnRequestCompletion: true
    }
}

var sqlClient = new botbuilder_azure.AzureSqlClient(sqlConfig);
var sqlStorage = new botbuilder_azure.AzureBotStorage({ gzipData: false }, sqlClient);

var bot = new builder.UniversalBot(connector, [
    function (session) {
        session.send("Hi there!");
        builder.Prompts.text(session, "What's your name?");   
    },
    function (session, results) {
       session.userData.name = results.response;
       session.send("Nice to meet you, %s", session.message.text);
       session.send(`Name confirmed: <br/>${session.userData.name}`);
       session.save();
       session.endDialog();
    }
]).set('storage', sqlStorage);

Swallow of original StorageException in TableBotDataStore

In LoadAsync() and SaveAsync() , the StorageException is not passed to the HttpException as innerException. The StorageException contains valuable information about the exception that is lost. I wast couple of hours/days trying to find an issue I had recently that would have been spot immediately if i had access to the original StorageException. thanks

Azure Table Storage GZIP

This is not an issue, just a clarification why GZip was used on Azure Table Storage:

Is there a penalty for save bot data as a string and not Gzip Binary?

DocumentDbBotDataStore causes HTTP 404 responses under normal operating conditions

DocumentDbBotDataStore under normal operation generates at least two 404 Not Found responses from CosmosDb for each new conversation. These cause exceptions in the client and also appear as failures to system monitoring tools which are tracking calls between system components.

This happens when the data store checks to see if the storage already exists in the database. If it doesn't exist, it has to create it. But the check is using ReadDocument instead of a db query. Using a db query will successfully return an empty set instead of returning a 404 response eliminating the false error condition.

PR #56 has the fix.

Adding support to MongoDB

Hi,

This issue is for starting a pull request process. I have a working MongoDb integration that works exactly as DocumentDb client for the Node SDK. I am testing it with CosmosDB with MongoAPI without problems.

Repo

MongoClient

https://github.com/rafadorado/BotBuilder-Azure/blob/mongodbclient/Node/src/MongoDbClient.ts

Test

https://github.com/rafadorado/BotBuilder-Azure/blob/mongodbclient/Node/test/MongoDbClientTest.js

Example

https://github.com/rafadorado/BotBuilder-Azure/blob/mongodbclient/Node/examples/feature-mongoDb/app.js

Credit

Credit to @aakashkag for this: https://github.com/Manacola/msbotframework-mongo-middlelayer

no more than one bot in the same bot data store

Hi, I need to share the same collection (CosmosDB) as StateClient for more than one bot.
I experienced that the values into data property of json of UserData are a merge of all bot that share the collection with the BotId of the last bot that write.

Inspecting the DocumentDbBotDataStore.cs code at line 261

case BotStoreType.BotUserData:
                    return $"{key.ChannelId}:user{key.UserId.SanitizeForAzureKeys()}";

the entity key not include BotId,
same thing on SqlBotDataStore.cs at line 289


case BotStoreType.BotUserData:
                    entity = await query.FirstOrDefaultAsync(d => d.BotStoreType == botStoreType
                                                    && d.ChannelId == key.ChannelId
                                                    && d.UserId == key.UserId);

query ignore the BotId.

My idea is to add BotId to EntityKey :bot{key.BotId} in order to make it unique across multiple bot.

                case BotStoreType.BotUserData:
                    return $"{key.ChannelId}:bot{key.BotId}:user{key.UserId.SanitizeForAzureKeys()}";

Other suggestions ?

Thanks

az bot create fails when --storage/-s switch is used

I was trying to create a new bot with az bot create, but wanted to link to an already existing storage and whenever I tried this it would fail with the following stack trace:

local variable 'site_name' referenced before assignment
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\knack\cli.py", line 197, in invoke
    cmd_result = self.invocation.execute(args)
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qw7dqhq0\azure-cli-core\azure\cli\core\commands\__init__.py", line 372, in execute
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\six.py", line 693, in reraise
    raise value
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qw7dqhq0\azure-cli-core\azure\cli\core\commands\__init__.py", line 346, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qw7dqhq0\azure-cli-core\azure\cli\core\commands\__init__.py", line 182, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qw7dqhq0\azure-cli-core\azure\cli\core\__init__.py", line 436, in default_command_handler
  File "C:\Users\drmarsh\.azure\cliextensions\botservice\azext_bot\custom.py", line 97, in create
    storageAccountName, location, sku_name, appInsightsLocation, language, version)
  File "C:\Users\drmarsh\.azure\cliextensions\botservice\azext_bot\custom.py", line 177, in create_app
    "siteName": site_name,
UnboundLocalError: local variable 'site_name' referenced before assignment

Using own mongodb storage server

Hi guys, thank you for the great lib! But it seems like it can operate only with cloud infrastructure of the Azure, but what if I want to store some data on my own mongodb instance? How can it be implemented?

Migrating existing data to docdb

Hi,
I have a live bot, with some amount of data stored already in the free Microsoft's default storage.
I want to move it to my own docdb, but i don't want all the user to lose their data.

How can i migrate the existing data?

Skype: Why fails skype, when I send 12 button

var builder = require("botbuilder");
var botbuilder_azure = require("botbuilder-azure");

var useEmulator = (process.env.NODE_ENV == 'development');

var connector = useEmulator ? new builder.ChatConnector() : new botbuilder_azure.BotServiceConnector({
appId: process.env['MicrosoftAppId'],
appPassword: process.env['MicrosoftAppPassword'],
stateEndpoint: process.env['BotStateEndpoint'],
openIdMetadata: process.env['BotOpenIdMetadata']
});

var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session) {
builder.Prompts.choice(session,"Choose time","09:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|20:00" , {
listStyle: builder.ListStyle.button,
});
});

if (useEmulator) {
var restify = require('restify');
var server = restify.createServer();
server.listen(3978, function () {
console.log('test bot endpont at http://localhost:3978/api/messages');
});
server.post('/api/messages', connector.listen());

} else {
module.exports = { default: connector.listen() }
}

failskypebot

Azure bot storage: Converting circular structure

TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at addWrite (D:\home\site\wwwroot\project\node_modules\botbuilder-azure\lib\AzureBotStorage.js:105:33)
    at D:\home\site\wwwroot\project\node_modules\botbuilder-azure\lib\AzureBotStorage.js:117:25
    at tryCallOne (D:\home\site\wwwroot\project\node_modules\promise\lib\core.js:37:12)
    at D:\home\site\wwwroot\future-street\project\promise\lib\core.js:123:15
    at flush (D:\home\site\wwwroot\project\node_modules\asap\raw.js:50:29)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

I have found this on the logs of the server. Cannot give further details more than the stringify seems to convert a structure that is circular. Any idea? Maybe would be nice, if the user tries to store something that is circular to provide a different error explaining something or what is it doing?

Typescript compilation error when using BotBuilder-Azure package

Issue Description

When building bots using NodeJS and typescript, including botbuilder-azure reference to include Cosmos DB for storage causing build issues.

Packages used

"botbuilder": "^3.13.1",
"botbuilder-azure": "^3.0.4"

Code Example

import * as builder from 'botbuilder';
import * as azureState from 'botbuilder-azure';

Reproduction Steps

  1. Create a new Node JS project
  2. Use typescript to create the main files
  3. Include the packages and import the packages to the main file
  4. Running tsc causing compilation errors

Expected Behavior

No typescript compile errors.

Actual Results

import { ConnectionOptions, ConnectionConfig } from "tedious"; is missing in the type definition file and is causing compilation errors.

node_modules/botbuilder-azure/lib/botbuilder-azure.d.ts(252,49): error TS2304: Cannot find name 'ConnectionConfig'.
node_modules/botbuilder-azure/lib/botbuilder-azure.d.ts(259,43): error TS2304: Cannot find name 'ConnectionOptions'.

Some requests to azure storage account yields 404 responses

We're maintaining the bot state in azure storage account (table service)

    var azureTableClient = new azure.AzureTableClient(environment.config.BOT.TABLE_NAME, environment.config.BOT.STORAGE_NAME, environment.config.BOT.STORAGE_KEY);

    var tableStorage = new azure.AzureBotStorage({gzipData: false}, azureTableClient);

some of the requests to the table however seem to yield 404 responses (despite the values actually being on the table)

here's an example query for the request

1.0;2018-02-01T12:45:39.3986312Z;QueryEntity;ClientOtherError;404;98;97;authenticated;prodbotstate;prodbotstate;table;"https://prodbotstate.table.core.windows.net:443/botstate(PartitionKey=%27xxxxxxxx%27,RowKey=%xxxx-xxxx-11e8-xxxx-15d2ff98ccae%27)";"/prodbotstate";

I manually tried querying the table using the provided partition key and the value does exist in the table. How can i further debug this to see whats going on?

Thanks

It is currently not possible to use a CosmosDB partitioned collection as the BotDataStore

When I pass a partitioned collection to the DocumentDbBotDataStore() constructor in the BotBuilder-Azure sample application, and run the application, it throws the following CosmosDB exception:

System.InvalidOperationException: PartitionKey value must be supplied for this operation.

This restricts us to the 10 GB storage limitation of a non partitioned CosmosDB collection. Is there any upcoming feature to support a partitioned collection?

Update azure-storage npm dependency

The azure storage npm module used by this project is set to 1.3.2 which is very old. The current azure table storage version is 2.6.0.

  1. Please update the azure-storage npm dependency.
  2. buildTableService() function is called each time an entity is inserted or retrieved. This further calls azure.createTableService method from azure-storage library. This could be moved to constructor and store tableService as an instance variable (this.tableService) instead of creating the tableService object on each execution.

I can submit a PR for this but it'll be internal breaking change as AzureTableClient expects IStorageError, IHttpResponse and other interfaces as return values which are not compatible with tableService return values types.

Localization not working in Azure Bot Service Node

Hi!

I've been playing around with the botframework and Azure Bot Service for quite some time now and noticed that setting the preferredLocale of the session changes the language of all prompts but not the sent texts.

session.preferredLocale('es', (error) => { if (typeof error === 'undefined') { session.send('greeting'); } });

Setting the locale in this way changes the built-in prompts to Spanish but does not load the localized greeting message but sends the plain-text message 'greeting' instead.

var bot = new builder.UniversalBot(connector) .set('localizerSettings', { botLocalePath: "./locale", defaultLocale: "en" });

My bot uses the default localization configuration, as shown in this example, but my locale folder is called locale instead of customLocale.

Any ideas?

Missing definitions in botbuilder-azure.d.ts

I get the following when installing 3.0.4 ...

node_modules/botbuilder-azure/lib/botbuilder-azure.d.ts(252,49): error TS2304: Cannot find name 'ConnectionConfig'.
node_modules/botbuilder-azure/lib/botbuilder-azure.d.ts(259,43): error TS2304: Cannot find name 'ConnectionOptions'.

Do the definitions need updating?

Misleading error with BotServiceConnector: req.on is not a function

I'm developing a bot in Azure using functions. While testing the API with Postman following error is raised.

2017-03-14T12:52:04.234 Exception while executing function: Functions.messages. mscorlib: TypeError: req.on is not a function
    at D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:46:21
    at D:\home\site\wwwroot\node_modules\botbuilder-azure\lib\BotServiceConnector.js:17:13
    at handler (D:\home\site\wwwroot\messages\index.js:160:10)
    at D:\Program Files (x86)\SiteExtensions\Functions\1.0.10774\bin\azurefunctions\functions.js:93:24.

After looking into sources (https://github.com/Microsoft/BotBuilder/blob/master/Node/core/lib/bots/ChatConnector.js#L41) it was noticed how body is required in POST or otherwise ChatConnector expects req to have on method which does not exist.

Perhaps something to improve in ChatConnector or BotServiceConnector? Dummy methods, perhaps?

[Info] Update documentation, create cosmodb as SQL API.

Hi,

Just want to share a simple error I've had today, hopefully it helps someone. I created the Cosmodb as Azure Table API and I was getting this error:

error: failed to initialize azure table client. error: error: error code: 400 error body: {"odata.error":{"code":"badrequest","message":{"lang":"en-us","value":"one of the input values is invalid.

Once I created it with SQL API, everything went fine :-)

Cheers

Cannot upgrade WindowsAzure.Storage passed 8.7

ref: microsoft/botframework-sdk#4179

Upgrading to the latest will result in:

Buffer cannot be null. Parameter name: buffer. ParamName: "buffer", Source: "mscorlib"

The following is the stack trace,

   at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)
   at System.IO.MemoryStream..ctor(Byte[] buffer)
   at Microsoft.Bot.Builder.Azure.BotDataEntity.Deserialize(Byte[] bytes)
   at Microsoft.Bot.Builder.Azure.TableBotDataStore.<Microsoft-Bot-Builder-Dialogs-Internals-IBotDataStore<Microsoft-Bot-Connector-BotData>-LoadAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore.<LoadFromInnerAndCache>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore.<Microsoft-Bot-Builder-Dialogs-Internals-IBotDataStore<Microsoft-Bot-Connector-BotData>-LoadAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AppName.Filters.RefreshTokenFilter.<OnActionExecutingAsync>d__0.MoveNext() in D:\TFS\Source\Workspaces\TP_APPNAME\Development\Source\Dev_AppName_Version1\FolderName\AppName\Filters\RefreshTokenFilter.cs:line 49

Writing and Reading from documentDB is not clear in documentation

I install botbuilder-azurenpm package on my chatbot project. I have azure account, when I start my bot, a database and a collection is created automatically. I get input from Users and keep it in session. conversationData but I couldn't see my new state on Data Explorer on My Azure Portal. Am i missing something or I should use another SDK also?

By the way I am using ngrok to debug my bot.

Update to latest version on botbuilder

C# currently depends on 3.5.5 and Node on 3.0.2. This is preventing users using this library to upgrade their bots to the latest version of the sdks.

Question about encrypting logs in Table Logger

I am using the TableLogger.cs code to log messages to Table Storage. I am encrypting the activity object using TableEncryptionPolicy:
` TableEncryptionPolicy policy = new TableEncryptionPolicy(EncryptionHelper.Rsa, null);

        _tableRequestOptions = new TableRequestOptions()
        {
            EncryptionResolver = (pk, rk, propName) =>
            {
                if (propName.StartsWith("Activity"))
                    return true;

                return false;
            },
            EncryptionPolicy = policy
        };`

Can you please explain why the following code is required in ActivityEntity? Is it because the Activity object can get too big and we need to compress it?

`public override IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext)
            {
                var props = base.WriteEntity(operationContext);
                var buffer = JsonConvert.SerializeObject(Activity).Compress();
                var start = 0;
                var blockid = 0;
                while (start < buffer.Length)
                {
                    var blockSize = Math.Min(buffer.Length - start, FieldLimit);
                    var block = new byte[blockSize];
                    Array.Copy(buffer, start, block, 0, blockSize);
                    props[$"Activity{blockid++}"] = new EntityProperty(block);
                    start += blockSize;
                }
                return props;
            }`

Since, you can only encrypt strings, I have removed the above code. Instead, I am simply serializing the Activity object into string so it can be encrypted.

Utils.GetAppSettings method removed from this package

Hi Folks,
I had been using the Utils.GetAppSettings method from Microsoft.Bot.Builder.Azure v 3.15 in my C# bot developed using v3.

I had the requirement to read the appsettings keys created directly from ARM template in Azure in the code and the above method worked.

But now I am looking forward to migrate to v4 so I created a project from v4 template but I am not able to fulfill this requirement.

Please help me on how to implement it with v4 having some settings read from appsettings.json existing within project and rest of the settings read from AppSettings on App Service in Azure.

Thanks

storage exception during createifexists every second run of the bot emulator.

Hi guys im using TableLogger.cs implementation to log conversation history to azure table storage. At first fire on my bot emulator it will run smoothly but after you stop it and do a rerun, It will encounter a storageexception 409 conflict error. This happens when i stop visual studio and do a rerun on vs and a refresh on bot emulator, then as soon as you type your first message. boom! More details : https://stackoverflow.com/questions/48395464/tablelogger-cs-throwing-storageexception-409-conflict

Global Asax:

` var tableName = ConfigurationManager.AppSettings["TableName"].ToString();
var account = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);

    //Azure StateData
    Conversation.UpdateContainer(
        builder =>
        {
            //azure botdata
            builder.RegisterModule(new AzureModule(Assembly.GetExecutingAssembly()));
            var store = new TableBotDataStore(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
            builder.Register(c => store)
               .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
               .AsSelf()
               .SingleInstance();
            //azure conversation history
            account.CreateCloudTableClient().GetTableReference(tableName).DeleteIfExists();
            builder.RegisterModule(new TableLoggerModule(account, tableName));
        });

`

store chat log in database

Hi,
I saw AzureTable example. my question is little different
I want to save chat log in our database , sql server.
can any one pls give me idea of how do I achieve so...

This is little urgent. Will be great if anyone can address.

Thanks..
Ashay

Key generation for private MSTeams conversations can exceed 255 characters

Releated to microsoft/botframework-sdk#3637

I'm currently seeing in a subset of 1:1 conversations to the bot in MSTeams, dialogue fails on an attempt write to state service. Happy to PR something here but guidance to make this backwards compatible would be appreciated.
System.Web.HttpException (0x80004005): Message: {"Errors":["The input name 'msteams:private{large key}' is invalid. Ensure to provide a unique non-empty string less than '255' characters.","The request payload is invalid. Ensure to provide a valid request payload."]}

Not able to set up Cosmos State Client in Unit Test Project

I am setting up a Unit Test Solution for my .Net Bot developed using Bot SDK 3.15.3. The first problem is there are no updates test project examples that correspond to current running SDK.
I am using the DialogTestBase.cs, FiberTestBase.cs and MockConnectorFactory.cs files borrowing from source code. The problem is StateClient which is marked deprecated.
My first question is if it is okay to avoid the warning and use InMemoryDataStore for Unit Tests.
Second question is if it is feasible to use any other Data Store say Cosmos and what code changes are to be done for it. Any directions will help.

IBotToUser implementation stops from activity logging

Hi,

We implemented IBotToUser interface to handle translations of messages sent by the bot to the user and registered it as below. The translation works fine but for some reason the bot responses are not logged in Table Storage.

     Builder.RegisterType<InterceptBotToUser>().AsSelf().InstancePerLifetimeScope();
     Builder.Register(c => new InterceptBotToUserTranslator(c.Resolve<InterceptBotToUser>()))
                    .AsImplementedInterfaces()
                    .InstancePerLifetimeScope();

Is there any known fix for this behavior or this is unrelated?

Slack's 'reaction_added' event is not captured by the bot service

I'm not sure if that is proper place for the issue, however I haven't found a specific botservice-slack repo.

My goal is to capture emoji reactions from the slack bot.

I have following code deployed to azure:

...
var connector = new azure.BotServiceConnector(...);
var bot = new builder.UniversalBot(connector);
bot.use({
  receive: function (session, next) {
    history.addIncomingMessage(session, next);
  },
  send: function (event, next) {
    history.addOutgoingMessage(event, next);
  }
});
...

Then in slack:

  • Send message 1
  • Receive message 2 from my bot
  • React with emoji on the message 2
    image

In my history I see message 1 event and message 2 event, but no emoji event. Seems like bot service slack integration should listen to reaction_added and reaction_removed slack events.

please add null checking !

documentDb needs updating

currently I am using 1.18 but unable to run the project because botbilder.azure is dependant on 1.11 that is quite a good few ( more than 10 ) major releases and patches behind.

I don't want to have to downgrade the whole project, just to get table storage logging. and cant seem to remove the un-needed table storage, as again, the whole thing is stuck on being well behind and dependant.

any idea if this project is still alive and going to be updated?

ta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.