Comments (17)
@dmvtech Hi Dana, I am tracking this issue from Microsoft Q&A platform. Could you please help take a look? Thanks.
from botframework-solutions.
I will take a look.
from botframework-solutions.
Is that error coming in log stream console? - may be you missed this second line I think not sure:
services.AddSingleton<IBotFrameworkHttpAdapter, DefaultAdapter>(); services.AddSingleton<BotAdapter>(sp => sp.GetService<BotFrameworkHttpAdapter>());
for webchat - I done basic implementation - token you can do after this works.
from botframework-solutions.
Is your /xxx.azurewebsites.net/.bot URL works? please check connecting from webchat client.
Looks like you've made some progress. Some additional questions:
- I'm assuming since this is a VA bot that it is using
BotFrameworkAdapter
and not the newerCloudAdapter
, correct?- You have correctly set
APPSETTING_WEBSITE_SITE_NAME
in the configuration?- When setting your secret for the bearer token, you are using the actual Directline secret (even though it is posting to your ASE generate endpoint) and not the Directline ASE secret, correct?
- Can you clarify on:
but while testing it from web chat client i am getting Failed to fetch error (chat.html:49 TypeError: Failed to fetch)
What is on line 49? Checking the console per @SSanjeevi is a great idea.
Hello @dmvtech , Hello @SSanjeevi ,
- Yes VA bot that it is using BotFrameworkAdapter and not Cloud Adapter
- Yes APPSETTING_WEBSITE_SITE_NAME is correctly configured
- Yes The secrete used for token generated in Direct Line Secrete and not ASE secrete
About the error in console , I dig down further and found that the timeout is happening upon calling token generation service : https://XXX.azurewebsites.net/api/directline/token, i am yet to find reason why timeout is happening
but meanwhile i tried skipping token call (Just for Test purpose) and directly provided Direct Line secrete as token to renderWebChat() method and could see Web chat rendered successfully.
Few concerns still to address :
- Adaptive card attachment does not work directly
- Refresh token logic
Do you have any idea why request token gets timeout, is this related to app service hosted environment or plan ?
from botframework-solutions.
Not sure about issue when using the token. What I analyzed(understood) is that its using WebSocket connection to connect between client and server using ASE - not sure whether we can create token before that socket connection is established - @dmvtech and team will help you on that.
Hello @SSanjeevi , @dmvtech
I think i found the culprit, the url we use for token generation has to be : https://XXX.azurewebsites.net/.bot/v3/directline/tokens/generate and not
https://XXX.azurewebsites.net/api/directline/token/generate
It was my bad.
from botframework-solutions.
please close the issue - if its resolved 🥇 happy to help.
from botframework-solutions.
Thanks @SSanjeevi & @dmvtech for your help.
from botframework-solutions.
I will take a look.
@dmvtech Hello Dana,
Did you got time to look into this, i really failed to understand root cause for the issue, at one side Test In Web chat works fine,
i have a feeling that there is some issue with the way client side request is communicating with bot over direct line and the definition for createDirectLineAppServiceExtension function defined in botframework-webchat js
as the constant error : WebSocket connection to XXX failed. is there and there is literally nothing i could fix about this.
Moreover calls to https://directline.botframework.com/v3/directline/conversations working fine in Postman, it means secrete and bot app is correctly configured.
And even the client side code is simple and as per Bot Framework documentation.
index.txt
another question : The token i generated have issuer and Audience as :
"iss": "https://directline.botframework.com/",
"aud": "https://directline.botframework.com/"
Where as documentation from: https://github.com/microsoft/BotFramework-WebChat/tree/main/samples/01.getting-started/i.protocol-direct-line-app-service-extension says it should be :
The token is a JSON Web Token and the iss and aud fields are both https://directlineextension.botframework.com/
https://directlinextension.botframework.com
Does that make any difference,, if yes, how can we get directlineextension as iss and aud ?
It would be really helpful if get cause for the issue.
Thank you again.
from botframework-solutions.
I will take a look.
@dmvtech Hello Dana,
Did you got time to look into this, i really failed to understand root cause for the issue, at one side Test In Web chat works fine,
i have a feeling that there is some issue with the way client side request is communicating with bot over direct line and the definition for createDirectLineAppServiceExtension function defined in botframework-webchat js
as the constant error : WebSocket connection to XXX failed. is there and there is literally nothing i could fix about this.
Moreover calls to https://directline.botframework.com/v3/directline/conversations working fine in Postman, it means secrete and bot app is correctly configured. And even the client side code is simple and as per Bot Framework documentation. index.txt
another question : The token i generated have issuer and Audience as : "iss": "https://directline.botframework.com/", "aud": "https://directline.botframework.com/"
Where as documentation from: https://github.com/microsoft/BotFramework-WebChat/tree/main/samples/01.getting-started/i.protocol-direct-line-app-service-extension says it should be :
The token is a JSON Web Token and the iss and aud fields are both https://directlineextension.botframework.com/
https://directlinextension.botframework.comDoes that make any difference,, if yes, how can we get directlineextension as iss and aud ?
It would be really helpful if get cause for the issue. Thank you again.
---------------Update-----------------------
I continued investigation and have tried to generate token from my own app service url (https://xxx.azurewebsites.net/.bot/v3/directline/tokens/generate) in token controller but the call returns null or empty token
and when i check log in portal i am getting 404 error for the service call :
Could you please suggest why i am getting 404. ?
from botframework-solutions.
@pravinambekar - I have tried the same and it seems to be working - please refer my repo with complete sample, if you see any issues let me know :
https://github.com/SSanjeevi/VirtualAssistantDirectlineExtn
You can check the app service log stream window when accessing the webchat, you will see the logs if you see any issue - by following my repo code for serilog logging.
from botframework-solutions.
@pravinambekar - I have tried the same and it seems to be working - please refer my repo with complete sample, if you see any issues let me know : https://github.com/SSanjeevi/VirtualAssistantDirectlineExtn
You can check the app service log stream window when accessing the webchat, you will see the logs if you see any issue - by following my repo code for serilog logging.
Hello @SSanjeevi ,
Thank you for sharing repo, while checking your source i am getting serilog error as below :
[ERR] Some services are not able to be constructed
(Error while validating the service descriptor 'ServiceType: Microsoft.Bot.Builder.Integration.IAdapterIntegration
Lifetime: Singleton ImplementationType: VirtualAssistantSample.Adapters.DefaultAdapter':
Unable to resolve service for type 'Microsoft.Bot.Connector.Authentication.AuthenticationConfiguration'
while attempting to activate 'VirtualAssistantSample.Adapters.DefaultAdapter'.)
(Error while validating the service descriptor 'ServiceType: Microsoft.Bot.Builder.Integration.AspNet.Core.IBotFrameworkHttpAdapter
Lifetime: Singleton ImplementationType: VirtualAssistantSample.Adapters.DefaultAdapter':
Unable to resolve service for type 'Microsoft.Bot.Connector.Authentication.AuthenticationConfiguration'
while attempting to activate 'VirtualAssistantSample.Adapters.DefaultAdapter'.)
(Error while validating the service descriptor 'ServiceType: Microsoft.Bot.Builder.ChannelServiceHandler
Lifetime: Singleton ImplementationType: VirtualAssistantSample.TokenExchange.TokenExchangeSkillHandler':
Unable to resolve service for type 'Microsoft.Bot.Solutions.Skills.SkillsConfiguration'
while attempting to activate 'VirtualAssistantSample.TokenExchange.TokenExchangeSkillHandler'.)
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, ServiceProviderOptions options)
Is this related to version issue ? i have seen similar error you reported on SO, but the thread seems not have concrete soultion, may be you could help here. (while i will keep on investigating)
additionally I am bit concerned with the way client code is implemented, here we are directly exposing Direct Line Secret.
which is suppose to be generate in separate api controller
Do you have any suggestion over the error i am getting during DI, may be token part we can take care in controller
Regards,
Pravin
from botframework-solutions.
Is that error coming in log stream console? - may be you missed this second line I think not sure:
services.AddSingleton<IBotFrameworkHttpAdapter, DefaultAdapter>(); services.AddSingleton<BotAdapter>(sp => sp.GetService<BotFrameworkHttpAdapter>());
for webchat - I done basic implementation - token you can do after this works.
Hello @SSanjeevi ,
I was able to run bot locally but i guess there is some issue with running bot on local IIS (getting timeout when run on local iis but was able to run on console)
In spite of that i deployed bot and related services on azure but getting 502 error upon access app service.
ModuleName AspNetCoreModuleV2
Notification EXECUTE_REQUEST_HANDLER
HttpStatus 502
HttpReason Bad Gateway
HttpSubStatus 5
ErrorCode The app didn't start in the required time. (0x8027025a)
Do you have any idea what possibly could go wrong ? I guess something is wrong with IIS configuration, or the way app is running on IIS
from botframework-solutions.
Is your /xxx.azurewebsites.net/.bot URL works?
please check connecting from webchat client.
from botframework-solutions.
Is your /xxx.azurewebsites.net/.bot URL works? please check connecting from webchat client.
Hi @SSanjeevi ,
The https:/xxx.azurewebsites.net/.bot is now returning json response :
{
v: "1.0.0.0.55fa54091a1e3b168628d4000ee2b06a88bbc2ac",
k: true,
ib: true,
ob: true,
initialized: true
}
but while testing it from web chat client i am getting Failed to fetch error
chat.html:49 TypeError: Failed to fetch
at chat.html:34:27
at chat.html:49:9
from botframework-solutions.
check browser console - net work tab - you may have to check that and restart app service and enable socket.
from botframework-solutions.
Looks like you've made some progress. Some additional questions:
- I'm assuming since this is a VA bot that it is using
BotFrameworkAdapter
and not the newerCloudAdapter
, correct? - You have correctly set
APPSETTING_WEBSITE_SITE_NAME
in the configuration? - When setting your secret for the bearer token, you are using the actual Directline secret (even though it is posting to your ASE generate endpoint) and not the Directline ASE secret, correct?
- Can you clarify on:
but while testing it from web chat client i am getting Failed to fetch error (chat.html:49 TypeError: Failed to fetch)
What is on line 49? Checking the console per @SSanjeevi is a great idea.
from botframework-solutions.
@pravinambekar - thanks for confirming that bot works when using secret in webchat.
Not sure about issue when using the token. What I analyzed(understood) is that its using WebSocket connection to connect between client and server using ASE - not sure whether we can create token before that socket connection is established - @dmvtech and team will help you on that.
from botframework-solutions.
Related Issues (20)
- [Docs] Missing " in dispatch add --type "qna" --name "kb-name ` HOT 1
- Can we have more examples in TypeScript HOT 1
- Store Transcript and Logging in CosmosDB HOT 2
- MS Teams: refresh_token not coming from OAuhCard in AAD v2 HOT 3
- Oauth Card Login button not working in MS teams HOT 2
- VA + Skill Template Bots do not start up when hosted Out-Of-Process HOT 2
- Azure Devops Pipeline failing on Nuget restore with latest bot-solutions package 1.1.0 HOT 9
- Bot works in Test in Web Chat & Emulator but not in Microsoft Teams HOT 2
- Data source error: DataSource.Error: <pii>Web.Contents failed to get contents from (long url here) 400): Bad Request. The exception was raised by the IDbCommand interface. Table: EventTelemetry. HOT 11
- how to include metadata in the insight query for QnAMaker logs HOT 4
- conversationId is not coming in BotMessageSend telemetry event HOT 6
- Bot Framework Emulator: Invalid `applicationId` value detected HOT 1
- [Docs] Download and install the Virtual Assistant and Skill Templates. - Requested page not found HOT 1
- Knowledgebase is not getting created through Virtual Assistant template PowerShell script HOT 9
- QNA Maker HOT 2
- Problems to understand the Users Inputs on Virtual Assistant Sample - Virtual Assistant Sample not work HOT 4
- Azure bot app hosting startup assembly exception HOT 1
- Azure bot telephony channel not working HOT 1
- Add Custom Commands application as a skill in Bot framework composer application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botframework-solutions.