Connect Azure Bot to Google Assistant | Configure Google Actions | Part 1

Connect Microsoft Bot Framework Azure Bot to Google Assistant Action as a channel. We will use Actions SDK and DialogFlow Adapter for Bot Builder v4 .NET SDK.

I will be working on the Core Bot template considering the sequential conversation and testing it on Google Actions Console. Many other demos use the Echo bot for its simplicity.

This is the bot series on Connecting Microsoft Azure Bot to Google Assistant Action Channel and in this second part, we will Configure the Google Actions.

The Google adapter supports connecting to Actions on Google (the conversations webhook) or via DialogFlow. It is recommended to use Actions on Google if possible.

Prerequisites

Create an Actions on Google Project

Log in to Actions on Google Console and click on New Project.

Create a new project on Actions on Google

Provide the name of the project and choose the language and your country. Click on Create project.

Provide the name of the Actions project on Google

From the list of Actions, choose the Custom Action and click on Next.

Create a Custom Action in Google

Choose the Blank project and click on Start building.

Create a Blank project template

When the project is created, an Overview page will be shown. Click on Decide how your Action is invoked.

Go to the settings to provide the Invocation name

Give an Invocation name and click on Save. I have given the Invocation name as My Flight Booking Bot.

Give the Invocation name in Actions Console project

Now, go back to the Startup.cs file on your bot source code in Visual Studio. Add the Invocation name that you have provided in the previous step. Also, you will have to provide the project id. It can be found by clicking on the top menu and selecting Project settings.

Go to the Actions project settings

Copy the Project ID and paste it in the Startup.cs file.

Copy the project ID

Below is the Startup.cs Google adaptor services will look like.

services.AddSingleton(sp =>
            {
                return new GoogleAdapterOptions()
                {
                    ActionInvocationName = "My Flight Booking Bot",
                    ActionProjectId = "fli.....",
                    ValidateIncomingRequests = true,
                    WebhookType = GoogleWebhookType.Conversation
                };
            });

In this case, I have removed the DialogFlowAuthorizationHeader because this is the first way of doing this using Actions SDK. The other way is using the DialogFlow that we will see in the next parts.

Thank you All!!! Hope you find this useful.


Up ↑

%d bloggers like this: