Open revs1 opened 4 years ago
@revs1 I did integrate the Dialogflow with Microsoft Teams about 4 months ago using the same approach as Skype., I think it is still working now. Have you tried integrating using the Skype approach mentioned here. The key is that Dialogflow does not directly connect to Microsoft Teams, instead, it connects to Azure Bot Service and you integrate Azure Bot Service with Microsoft Teams channel just like this.
@mekpavit What will be the messaging endpoint configuration for the server.js. I am unable to access the bot from the Microsoft bot framework channel TEST.
I have tried appending both "/webhook" and "/api/messages" to the cloud function URL https://xxxxxxxx.cloudfunctions.net/TeamsChannel
I am trying to integrate teams. I have followed the documentation for skype open source. But, instead of docker containers i am using cloud functions to deploy the server.js. (org level restrictions on docker).
@cah-prashanth-soma Have you tried using the Cloud Function url with adding any suffix? If you have, did you get any incoming request to your Cloud Function? I've never used Cloud Function for hosting the webhook before, but I think it should work.
thanks. if you meant without suffix? yes I did. And nothing is logged. Nothing is getting hit.
@cah-prashanth-soma I've already tested dialogflow-integration with Azure Bot Service. It did work but it requires some changes on server.js
since the Cloud Function works with only some project structure. Here is what I did:
botlib
folder to be in skype
.skype/server.js
to refer to the new location of botlib
. For example, you have to change const protoToJson = require('../botlib/proto_to_json.js');
to const protoToJson = require('./botlib/proto_to_json.js');
(remove one dot).const listener = app.listen(port, () => {
console.log('Your Skype integration server is listening on port '
+ listener.address().port);
});
module.exports = {
convertToSkypeMessage
};
to this (Cloud Function can only access to the exported class/function from a .js file declared in main
field of package.json
):
module.exports = {
convertToSkypeMessage,
app
};
nodejs12
runtime, app
entry point and service account that you created according to the instruction. For example,
gcloud functions deploy you-function-name --runtime nodejs12 --service-account=some-service-acount-email@some-project-id.iam.gserviceaccount.com --entry-point app --trigger-http
@mekpavit, it works. I thank you profusely for your quick and detailed response. Point 4 did the magic for me. (I have already implemented point 1 and 2 and redirected 3 to other port, but I was using convertToSkypeMessage as entry point ).
@cah-prashanth-soma You're welcome!!
@mekpavit what is the messaging endpoint for cloud run? I have set mine to https://skype-xxxxxxxxxx-uc.a.run.app, But my dialogflow intents still do not show up on Azure bot. can you pls help?
@mekpavit what is the messaging endpoint for cloud run? I have set mine to https://skype-xxxxxxxxxx-uc.a.run.app, But my dialogflow intents still do not show up on Azure bot. can you pls help?
@preethamjv Can you show your Cloud Run log? I want to ensure that the Microsoft Bot Service can't access your Cloud Run.
@mekpavit I get a series of error messages in my logs
@mekpavit I get a series of error messages in my logs
![]()
![]()
According to the logs, it looks like you misconfigure the microsoft secret. Can you show me your server.js file? Maybe take a screenshot around here:
@mekpavit Thanks for your quick follow-up, here is the screenshot
@preethamjv Okay, you already set the appId
and appPassword
. Could you check whether the appId
and appPassword
in server.js
are correct? (1. Is it really the appId of your chatbot? 2. Is the appId match the appPassword)
@mekpavit I have checked the app id and password, it was correct. I redeployed the code into a new cloud run service, it worked!
Adding the missing steps in documentation:
On dialogflow webhook fulfillment section, we need to give the MS Azure endpoint URL:
In the Azure bot configuration section, replace the existing MS Azure endpoint URL with the URL of the Cloud Run service that we have created.
Hope this helps someone!
@mekpavit thanks for your quick response!
@mekpavit just wanted to check, can we add google calendar schedule(book a slot) feature into this integration? Pls give your inputs, thanks in advance!
@mekpavit just wanted to check, can we add google calendar schedule(book a slot) feature into this integration? Pls give your inputs, thanks in advance!
I'm not sure if I really understand your feature. if I guess, it might be one of this:
When someone ask your chatbot to setup a meeting, you chatbot schedule a meeting on Google Calendar:
When someone schedule a meeting on the bot's Google Calendar, it triggers the Google's Dialogflow intent based on some properties on the meeting.
@revs1 I did integrate the Dialogflow with Microsoft Teams about 4 months ago using the same approach as Skype., I think it is still working now. Have you tried integrating using the Skype approach mentioned here. The key is that Dialogflow does not directly connect to Microsoft Teams, instead, it connects to Azure Bot Service and you integrate Azure Bot Service with Microsoft Teams channel just like this.
Hi, is there any video tutorial for the same, I am facing issues.
@ExceptionXD What's the issues you're facing?
@mekpavit So I followed all the steps and also got the URL but when i am keeping that as my messaging endpoint and testing web chat I am getting the following error : There was an error sending this message to your bot: HTTP status code Unauthorized
@mekpavit So I followed all the steps and also got the URL but when i am keeping that as my messaging endpoint and testing web chat I am getting the following error : There was an error sending this message to your bot: HTTP status code Unauthorized
Where did you get this error message? From Microsoft Teams web chat or from the logging page on GCP?
@mekpavit on Microsoft Team web chat
@mekpavit on Microsoft Team web chat
So, the situation is that, when Microsoft Teams sends a HTTP request to your Cloud Run application, it responses back with 401 status code. One possibility that can be the root clause is that "allow unauthenticated invocations" setting on your Cloud Run application is set to "no".
Could you confirm that, when you deploying using gcloud beta run deploy
command, you answer "y" when it is prompted to allow unauthenticated invocations?
Yes I had given 'y' as my response
@mekpavit the msg endpoint which i got, I am placing that in my web chat bot -> configurations -> messaging endpoint and then testing. This is what is mentioned right ?
Hey @mekpavit , @preethamjv has mentioned that " I have checked the app id and password, it was correct. I redeployed the code into a new cloud run service, it worked! Adding the missing steps in documentation: On dialogflow webhook fulfillment section, we need to give the MS Azure endpoint URL:"
so do i need to do this ?
Well.. 1) Cloud run service end point URL has to be plugged in Bot framework messaging end point (configuration section) 2) if you have a cloud function that has the webhook handling functionality .. you can mention its trigger URL On you dialogflow webhook fulfillment section.
From where to get MS Azure end point URL ?
@ExceptionXD Okay, so, 401 response does not come from Cloud Run authentication. Cloud you show your application logs on Cloud Run? I want to confirm that whether the 401 response was from BotFrameworkAdapter
or not.
@ExceptionXD Ok. According to the logs, it seems like the service account of your application does not have a permission to use Dialogflow. Could you confirm that you've done "Service Account Setup (GCP)" section here. If you've already done this, please show the screenshot of IAM page on your GCP console, so I can ensure that you give the right permission to the service account.
@mekpavit the second image has the permissions which are granted to me
@mekpavit I am using DialogFlowCX, so is the integration process different ?
@ExceptionXD After reading the API document of both Dialogflow ES and CSV, the API specification seems different (at least, the end point is different). Since this integration application only supports Dialogflow ES, I think you cannot use Dialogflow CX here.
BTW, there is one thing you can try. You can try changing the library used in botlib/dialogflow_session_client.js
from dialogflow
to dialogflow-cx
instead. Since the API exposed by these two library is almost identical, I think just changing the package name would be fine.
Hi @mekpavit, I follow the msteams integrations using cloud run, but facing the issue above. Can you assist to help?
@kyooi2 Hi. According to your logs, the response
object doesn't have response.payload.fields.skype
field. So, when convertToSkypeMessage
tried to get that field's value to convert to a valid MSTeam response, it encountered Cannot read property 'structValue' of undefined
error.
https://github.com/GoogleCloudPlatform/dialogflow-integrations/blob/master/skype/server.js#L148-L152
I would suggest you to find out why Dialogflow responded you back with that response
object. Do you use a webhook or just Dialogflow to process a message?
payload.fields.skype
fieldpayload.fields.skype
fieldserver.js
.https://github.com/GoogleCloudPlatform/dialogflow-integrations/blob/master/skype/server.js#L150
@mekpavit Hi. I think i found out the things that i have missed out. I forgot to add in the response for skype, so when it route back to default response, it will take the default payload. This is what I encounter for the error. Thanks alot for helping.
Hi. Using knowledge from this issue I have recently created this repo where I have put all code and instructions needed to integrate bots in DialogFlow with Microsoft Teams. HTH
Hello @mekpavit Hope you doing great. I am trying to integrate Google Dialog Flow with MS Teams but could not complete it. I have created Google dialog Flow intents ( request & response ). Created Azure Service Bot also & also followed the below link in order to compete the integration but it does not work. I don't receive any response on MS teams platform the response that i have written in my Google Dialog flow.
https://github.com/olivomarco/dialogflow-teams-integration If you can help me set up the integration of Google Dialog Flow with MS teams. Almost 90 % work is completed not sure what is causing the error. If you have any step by step to follow, if you can share it it will be big help also
Please see a more recent integration in this repo https://github.com/GoogleCloudPlatform/dialogflow-integrations/tree/master/cx/azure-bot-service
Has anyone got this gateway timeout issue for dialogflow cx integration with Azure bot service? https://github.com/GoogleCloudPlatform/dialogflow-integrations/tree/master/cx/azure-bot-service All env keys are correct as per the instructions.. but I still get this error.
September 23, 2023 at 9:53 PM GMT+5:30 There was an error sending this message to your bot: HTTP status code GatewayTimeout ca12f4b87b1ba4ae040098b5904c62e6
As I have noticed in official document, Teams integration is not part of built in integrations supported by Google. It being an independent integration, can someone help me with trusted third party organization to do the same?