This week we published our agenda for TechBash 2018. It is time for you to register!

You can see the schedule of the breakout sessions here. If you haven’t registered yet, now is the time to do it.

Not familiar with TechBash? Here’s some additional information…

TechBash 2018 is Oct 2-5, 2018, hosted at the Kalahari Resort in Poconos Manor, PA!

Techbash is quite affordable, especially when compared to our competition (because we are non-profit). Our 3 day pass plus 3 hotel nights is only about $875 (book before our Kalahari discount expires). We are also local to many people – less than 2 hours from NY and Philly. So if you live in the northeast US we keep your travel expenses down!

2017 Keynote with Donovan Brown

 

Come to Learn

Techbash features all the content you need to take your career a level up! We feature content for .NET, Azure, DevOps, JavaScript, Mobile, AI, Bots and much more. And our speakers are world class. These are actually many of the same presenters you’ll find at more expensive conferences.

Great Content

 

Come to Network!

We’ve built a safe, welcoming and exciting environment that is designed for all attendees to get the most out of the event. In the many informative sessions at TechBash, you’ll learn a crazy number of new things, but we know amazing interactions happen outside of the talks too. Our attendee lounge will have plenty of space for you to hang out and talk with old friends and make new ones. Speakers, attendees, and vendors will gather in the lounge to follow up talks after sessions over coffee and snacks. Our awesome, big name vendors will be there, presenting their latest gadgets and code, and a few job listings as well.

Networking

 

Come Have Fun

In addition to all the learning, we have an attendee welcome reception, game night, and a 200,000 sq. ft. indoor waterpark – the largest in the country! This year we are expanding our Friday family content so bring the kids. Soon, we’ll update our website with much more information about this.

2017 JewelBots session for kidsWaterslides

 

Please Help Us – Spread the Word!

Did you know TechBash is run by volunteers who don’t get paid? Every dime we charge goes right back into running the event. We started this because we wanted to have an awesome, destination conference with world class speakers in our part of the country! And this year we want TechBash to be better than ever. To do that, we need more attendees. Quite frankly, the larger the crowd, the more money we have to enhance the event. So if you have read this far, you must be interested. All we need you to do is spread the word. The event sells itself pretty well, the problem is, people don’t know about it! Tell your friends, co-workers, LinkedIn contacts, and your plumber.

I’ve updated my presentation Creating Awesome Chat Bots with the Bot Framework and C# to use BotBuilder v4. The new way to create bots is quite different from v3. At the time of this post, Bot Builder v4 is still in preview mode. Hopefully it will be going live soon.

In the talk, I demonstrated how to use quite a few tools:

 

Here are the slides for the presentation: BotFrameworkDemoSlides

The code sample can be found on my GitHub repo here: https://github.com/schwammy/conference-bot.

Enjoy!

image

 

I’ve been using the Azure Portal more and more these days and one thing is for sure, I still have a lot to learn. There is soooo much to do in Azure. This presents a problem with clutter. Since I don’t use all of the features, I find the “menu” of options to be pretty noisy. But the good news is, that is an easy problem to solve.

 

To the left I’ve pasted a screenshot of the Azure Portal’s side menu (actually, that is only part of it). You’ll note that the items on that list are shown as “favorites”. But I didn’t favorite them! With a few clicks I can clean this up.

 

 

 

 

 

 

 

 

 

Just click “All services” and you can see the complete list. The list is pretty long but I’ve included a screenshot of some of it below:

image

From this screen you can easily select which items really are your favorites. That will immediately reduce the size of the side menu. In addition, you will find a TON of other options that were not displayed on the favorites list originally. That’s a little depressing because it shows that there is even more to learn in Azure than I first thought. But I guess that is a good problem to have.

But wait, there’s more!

 

imageimage

Next, notice that as you hover over each item in the favorite list, you will see an icon indicating that you can grab it. If you do, you can drag the item up or down in the list.

 

 

 

 

 

 

image

When I am done selecting favorites and moving them around, I am left with a menu that makes it really easy for me to find what I need. No noise. Only the items I want in the order I want them. Now I can get to work!

 

The Microsoft Bot Framework makes it pretty easy to get started creating Chat Bots. If you haven’t gotten started yet, I recommend checking out this site: Bot Framework.

For a recent Bot that I created, we had the need for the Bot to expand. What I mean is, I want my bot chat UI to start out collapsed like a search box but then expand once a user starts talking to my bot.

7F9021F8-69F8-40A0-A26B-8EEC0CD32A1B

 

There are lots of examples for getting started with the Bot Framework. For this post, I will assume you already know how to do that. Hopefully you already know how to hook up the Web Chat control to communicate with your bot – here are some details about that.

I’ll start with the client-side code for this feature

For this feature, we will utilize the Web Chat’s backchannel using the DirectLine connection to the Bot. Then we can respond to events sent to the Web Chat from the bot. Here is the JavaScript needed to do this.

First, create a connection to the Bot with DirectLine:

        var directLine = new BotChat.DirectLine({ secret: "YOUR KEY GOES HERE" })

Next, subscribe to the event. All I am doing is listening for the event named “init” and when it occurs, add a class “fullSize” to the HTML element that hosts the bot.

        directLine.activity$
            .filter(isInitEvent)
            .subscribe(changeSize);

        function isInitEvent(activity) {
            return activity.type === "event" && activity.name === "init";
        }

        function changeSize(activity) {
            console.log("here")
            var container = document.getElementById("bot-chat-container");
            container.classList.add("fullSize");
        }

Lastly, create the Web Chat:

        BotChat.App({
            botConnection: this.directLine,
            user: { id: 'user' },
            bot: { id: 'bot' },
        }, document.getElementById("bot-chat-container"));

I’m just using a little CSS to hide and show the rest of the Web Chat UI. Feel free to enhance this part a little, it could be better. Hopefully you get the idea.

        #bot-chat-container {
            border: 1px solid #333;
            height: 50px;
        }

        #bot-chat-container.fullSize {
            height: 300px;
        }

        .wc-header {
            display: none;
        }

        .fullSize .wc-header {
            display: block;
        }

        .wc-console svg {
            fill: black;
            margin: 11px;
        }

        /* These styles are used to hide the upload button...*/

        .wc-console label {
            display: none;
        }

        .wc-console .wc-textbox {
            left: 10px;
        }

All that is left to show of the UI is this DIV. But this isn’t too exciting:

<div id="bot-chat-container" />

Here is the Server-Side Code

This whole thing is based on an event coming to the Web Chat UI from the Bot on the server. I’m using C# and it is pretty simple stuff. When you create a Bot, the MessagesController is stubbed out for you to handle various Activity Types. In this case, I am concerned with ActivityType.ConversationUpdate. Check to see if the a new member is added to the conversation and if so, send event named “init”.

private async Task&lt;Activity&gt; HandleSystemMessage(Activity message)
        {
            if (message.Type == ActivityTypes.DeleteUserData)
            {
		// ...
            }
            else if (message.Type == ActivityTypes.ConversationUpdate)
            {
                using (var scope = Microsoft.Bot.Builder.Dialogs.Internals.DialogModule.BeginLifetimeScope(Conversation.Container, message))
                {
                    var client = scope.Resolve&lt;IConnectorClient&gt;();
                    if (message.MembersAdded.Any())
                    {
                        foreach (var newMember in message.MembersAdded)
                        {
                            if (newMember.Id != message.Recipient.Id)
                            {
                                var reply = message.CreateReply();
                                reply.Type = ActivityTypes.Event;
                                reply.Name = &quot;init&quot;;
                                await client.Conversations.ReplyToActivityAsync(reply);

                            }
                        }
                    }
                }
            }
		// ... etc. etc.

That’s all.

I wanted to point out one difference between ConfigurationManager and WebConfigurationManager. I know there are other differences but here’s an issue I ran into recently.

I’ve been working on some Bot Framework stuff (really cool and fun, by the way). The Bot uses a QnAMakerService and QnAMakerDialog which worked great when I ran the Bot locally (debugging in Visual Studio) but it didn’t work when I deployed it to Azure. I knew that a lot of features of my bot were working but when it needed to use the QnA features it was just bombing out. A coworker helping out said he fixed my problem by putting settings in for the QnaSubscriptionKey and QnaKnowledgebaseId via the Azure Portal (navigate to your App Service, then Settings > Application Settings)

image

 

Yeah, I knew those were needed of course, but I had already added them. The settings were in my web.config file:

image

I was glad the Bot was working and I had a major clue to my issue. I wasn’t going to let it end there. Why weren’t the web.config settings being used? I took a close look at my code:

[Serializable]
public class QnADialog : QnAMakerDialog
{
public QnADialog() : base(new QnAMakerService(
new QnAMakerAttribute(
ConfigurationManager.AppSettings[“QnaSubscriptionKey“],
ConfigurationManager.AppSettings[“QnaKnowledgebaseId“],
Sorry, I couldn’t find an answer for that“,
0.5)))
{
}
}

The code seemed pretty straightforward. As a matter of fact, I recalled copying it from a sample on the web! Then I noticed that the code was using “ConfigurationManager” which was not the normal thing for me. I usually create web applications and I therefor use “WebConfigurationManager” to read from web.config files. And since my bot runs as an App Service in Azure, it IS a web application. I proceeded to make the major refactor of adding the text “Web” to the word “ConfigurationManager”. I then removed the Application Settings from the Azure Portal, leaving the values I had previously entered into the web.config file. And it worked perfectly.

As developers we have a variety of options to access configuration data and that data can be stored in several places. In addition to the two previously mentioned, there is also the CloudConfigurationManager class. My understanding is that this would have worked similarly to WebConfigurationManager. And, in fact, good old plain ConfigurationManager would have worked fine for this Azure App Service if I used the Portal to set my app settings instead of the web.config file. So, choose carefully and get to know the differences between the ConfigurationManager classes