Developing Chat bots in Azure

There have been a lot of blog articles about chat bots and robots that will invade our daily life. Don’t worry, they are already here. Microsoft Azure has a lot of services that can be used to create Bots of different kinds.
The Azure Bot Service helps developer to accelerate the development and testing of their bots. It offer a set of predefined templates for Basic, LUIS, Form, and Proactive bots. The bot can be developed and tested in the Azure portal, or set up environment for Continuous Integration and delivery in Azure Team Services.
Azure has some powerful cognitive services like LUIS that enable chat bot to accept user input categorized as utterance – either as voice or written text. Azure has Speech APIs and Translation APIs to convert back and forward between speech to text, in addition to translate between different languages.
By using LUIS the bot can define a language model for Natural Language Processing (NLP) to translate utterance (user input) into intents (commands). An intent indicate a task to execute with a set of parameters. These tasks can be executes as Azure functions and use a wide range of APIs and Azure services like Azure cognitive services, Azure storage and Azure compute resources.
The past years, Microsoft Azure has released a lot of services around analytics and data management. Many of them is centered around what is called Cortana Intelligence Suite (CIS) shown in the picture below:
This suite connect many services together and shows the way how Microsoft is defining Analytics for the future. On the right bottom side the chat bots are resides with mobile and web applications. In short, CIS collect on-premise and cloud data from a different of sources like IoT devices, external apps, APIs and similar. These data can be stored in Data Lake Store or SQL DW that is the basis for analytical services as Azure Machine Learning, Data Lake Analytics, HDInsight and Stream Analytics.  The data from the storage or result of analytics tools can be visualized with PowerBI, and queried with web/web/bot applications.
But this will be the topic of future blog posts – over and out!
Happy coding…

Coffee Machine Bot Project

In mid-February, I was discussing with some colleagues in EVRY to hold a hackathon soon. Immediately, I started to think of what I wanted to create independently of the Hackathon discussions. After a while I was fascinated by the idea of creating a coffee machine bot using Microsoft technologies to its full extent. The plan is to use this project to learn new things, and put everything together around the “Coffee Machine Bot” idea.

I have multiple inspirational sources for this Project

  • The fact that software developers consume huge amount of coffee all day (and nights)
  • The great GitHub project “hacker-scripts” (separate commands in the bot)
  • Homer’s fantastic kitchen machines

Basic requirements

  • Using cognitive APIs for voice and face recognition to identify persons
  • Bot should understand multiple languages, such as English, Norwegian and Swedish
  • Using advanced machine learning, analytics and cognitive services to suggest the drink based on drinking habits, time of day, weather, humour and emotion.
  • Commands
    • Rate drink
    • As usual
    • Add to favourites
    • Recommend New
    • Hacker-scripts
  • Back-Office
    • Automatically order new ingredients based on consumption, number of forthcoming workdays.
    • Schedule planned and predictive maintenance
    • Using HR, IFS, SM9 systems to look scheduled overtime and evening/night/weekend. Make sure participating employees had their drinks covered

This weekend I will do some research for the Face API and Emotion API available in Microsoft Azure.

WPF watermark/hint in TextBox control

After we found out that SOTI Enterprise Mobility Management system didn’t fully support Windows 10 Store Apps in “Kiosk Mode”, we had to rewrite out latest app using WPF technologi instead.

In this process. I wanted a kind of watermark in my TextBox Controls. After some googling, I found a pretty nice library called “Extended WPF Toolkit” on codeplex (and Nuget).

How to create a watermark input textbox

  1. Add “Extended.Wpf.Toolkit” via Nuget
  2. Add XML Namespace at the top of the XAML file
  1. Add “xctk:WatermarkTextBox” instead of “TextBox” Control With the Watermark attribute set to the help text
       <xctk:WatermarkTextBox x:Name="txtSearch" Watermark="type search pattern" />

Happy coding


Microsoft Azure Exams and Training Guide

Microsoft have released three Azure Specialist exams for the last few months. I have been watching a lot of videos on Microsoft Virtual AcademyChannel9 and Pluralsight the last few years, and very intensivly since  December 2014.

70-532 Developing Microsoft Azure Solutions. This is a developer exam for people who wants to be able to designing, programming, implementing, automating, and monitoring Microsoft Azure solutions.

70-533 Implementing Microsoft Azure Infrastructure Solutions. This is an exam for IT-pros and solution architects who wants to implementing an infrastructure solution in Microsoft Azure. Candidates have experience implementing and monitoring cloud and hybrid solutions as well as supporting application lifecycle management.

70-534 Architecting Microsoft Azure Solutions. This is an exam for Solution Arcitects should know the features and capabilities of Azure services to be able to identify tradeoffs and make decisions for designing public and hybrid cloud solutions. Candidates who take this exam are expected to be able to define the appropriate infrastructure and platform solutions to meet the required functional, operational, and deployment requirements through the solution lifecycle.

KiPi 2015 Challenge – Mobile Development

I’m having just some hours left of the first part of my KiPi 2015 Challenge for “Cloud Development“, and the next course path is “Mobile Development”.  This path will contain video sessions on C#, XAML, Universal app development and how Xamarin and Visual Studio can be used for cross-plattform development. These courses are about 32 hours in total watching.



KiPi 2015 Challenge – Cloud Development

As I wrote in the previous post, I’m participating in the KiPi 2015 Challange at Microsoft Virtual Academy (MVA). I have decided to focus on 100% on Microsoft Azure (cloud paths) during this challange – cloud development, mobile develogment, hybrid could.

The first path “Cloud Development” that consist of four different courses:

Currently, I have just compled “Part 2”, and looking forward to the next 2 parts.

Azure Service Bus Queues

Lately, I have been experimenting with Azure Service Bus, and especially Queues, but  the Azure Service Bus also have features like Event Hub, Topics and Relay. I have most experience with the concept of queues, and I started my journey there. A queue is called a FIFO data structure (FIFO, First-In-First-Out). This means that the first element added to the queue will be the first one to be removed. This ensures that elements come in the right order they were put into the queue. This can be illustrated with following figure:


In the middle, the queue receieved messages (items) from one or more message senders. These messages might reside the queue until they are taken out of the queue by one or more receiers, or automatically disposed into the “dead letter” (garbage bin). You also be able to take a look at the first element by a “peek” operation.

When you are working with queues in Microsoft Azure, you first have to create a namespace container where all the queues shall be located and grouped together. A namespace might conatin queues and topics. The code below shows the basic code for writing a test message to a Azure Service Bus Queue.

           const string qName = "SampleQueue";

            var nsmgr = NamespaceManager.Create();
            if (!nsmgr.QueueExists(qName))

            var qClient = QueueClient.Create(qName);

            var msg = new BrokeredMessage("test message");
            msg.MessageId = "1";


            //var msg1 = qClient.Peek();
            //var msg2 = qClient.Receive();


After I had written my first element to a Azure Queue, I thought: “How do I look at the element in the queue without writing the code for retrieving the element. Paolo Salvatori has written a nice Service Bus Explorer for this purpose. As you might see, I have commented the Peek and Receive operations. The receive require a Complete operation as well.

Happy coding….