I've customized my web chat by cloning from the source here. No I want to deploy this to Azure and host it on one of my websites. I'm building the app based on the instructions in the above. When I try deploying, I either get a "You do not have permission to view this page" or a 503 Gateway Error.
Where should I point the Azure website to look at. When I run locally, I need to point it to one of the samples in the samples directory. When I try doing the same on Azure, the chat never loads and shows a blank window. Is there a mistake in the way the app is being deployed ?
"You do not have permission to view this page"
I suspect that there is no default page in your Azure website, which cause the issue. You can add/specify a web page as the default document.
Same issue appears if no default document (web page) in my project folder:
I've customized my web chat by cloning from the source here. Now I want to deploy this to Azure and host it on one of my websites.
You can follow the following steps to customize&build your own Web Chat, and then add it to your website.
1) Refer to the steps described in “Building Web Chat” to build your own Web Chat
2) Include your own customized botchat.css and botchat.js in your website project
3) Add references to botchat.css and botchat.js in the section of the web page
4) Add and initiate BotChat with directLine_secret, botid etc information
<script>
BotChat.App({
directLine: { secret: "{directline_secret}" },
user: { id: 'You' },
bot: { id: '{bot_id}' },
resize: 'detect'
}, document.getElementById("bot"));
</script>
5) Test it on local, if WebChat works as expected then publish the website to Azure
I did a test with the above steps and it works fine both on local and Azure website.
Related
Working with the Azure enterprise bot model, everything is deployed, enabled and functioning. But all calls to LUIS are failing in the chatbot, both on desktop and in Azure's web environment. My LUIS model works in luis.ai when testing, but when connecting to LUIS from the bot I get the error below:
The only thing that does not work is the call to LUIS from the chatbot. It returns unauthorized. I've spent about 8 hours on google and verifying settings. Can somebody tell me where the checkbox is that i've missed?
Basic chatbot function is good.
microsoft app id and secret are good.
QNA maker implementation is good.
Publish cycles from Visual Studio is working fine.
I have verified the LUIS app functions in luis.ai.
I have verified all keys are properly written in cognitivemodels.json
I have verified all keys are correct by changing them incrementally, noting that the app fails, restoring to the correct value, and noting that the app functions.
trace results:
App ID:
Version: Unknown
Slot: Production
Recognizer ResultRaw Response
{
"recognizerResult": {
"alteredText": null,
"entities": {
"$instance": {}
},
"intents": {
"l_general": {
"score": 0.6153312
}
},
"text": "test"
}
}
Top-Scoring Intent
l_general (0.6153312)
Please add your LUIS service to enable reassigning.
Entities
No Entities
error from emulator log:
[LUIS] Unauthorized: Your bot is not configured to interact with LUIS app: . Please connect your bot to LUIS using the services pane.
The service pane appears, I add in all the keys and information as copied from luis.ai for the referenced appID. On save, the pane disappears and nothing changes.
This error looks to be specific to the Bot Framework Emulator as per this code.
I can reproduce the error locally by doing the following:
Debugging my bot.
Submitting a query that will trigger a request to LUIS.
Clicking on the hyperlinked trace text next to a LUIS Trace log entry in the log pane.
You aren't actually able to add a service to a bot without creating a bot configuration first (File > New Bot Configuration). Fill out the following:
Bot name
Endpoint URL (use your local one)
Microsoft App ID
Microsoft App password
Save and connect
Save the configuration somewhere
Then you will be able to add the services:
Click the + next to the Service.
Add your LUIS apps by filling out the dialogs.
Try the steps in the first set of my bullet points again and see if errors come through. If they do then you will need to add a service for the GUID that comes back in the error message - this GUID will match one of your LUIS app ids.
Even after doing this I still got the error message in the Log page, starting the emulator and bot didn't help. So I would advise raising an issue on the official GitHub for the Bot Framework Emulator about adding the services not working.
My AD password changed, Powershell had cached my credentials. Although I was not actively using powershell, apparently my credentials are locally cached on the dev box and used for some specific funcitons, which manifests as seemingly random authentication errors in logs. logging out of azure and logging back in (in powershell) resolved the issue.
Oh the hours of my life I will never get back.
I have an existing asp.net core 2.0 web app that uses a local database to store logins (individual user accounts). However, I now want to hide a page on the applications behind AD authentication.
I created another test app selecting 'work or school accounts' to see what that looks like, using the correct domain. That new app lets me log in with my work AD account right off the bat, and so I took all of the relevant code from that new test app and put it in my old application so that it routes to that microsoft sign in page when you click the correct page link. Everything seems to be working and hooked up correctly, except after logging in I get this message:
AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '[the ClientId I put in appsettings]'
I copied over the appsettings section as well from the test project for the AzureAd configuration, but of course I need the ClientId for my already existing project, not from the test project. The relevant appsettings section looks like this:
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "XXXX.com",
"TenantId": "XXXXXXXXXXXXXXXXX", //this seems to be the same everywhere and is fine?
"ClientId": "XXXXXXXXXXXXXXXXX", //this is app specific and generated automatically when the app is created?
"CallbackPath": "/signin-oidc"
},
My question is, where can I find that ClientId for my existing application? Every answer to this I look says you have to get it or set it up in Azure, but we don't actually use Azure, instead that ClientId is generated automatically by Visual Studio when I create the application (it still works for logging in on the test app so I guess I don't need azure for this?). Where do I get the ClientId for an existing app? Or, how can I add it to an existing app? Or generate one that will be accepted?
Thanks
EDIT (added from comment below):
thanks for your response. I have logged into azure portal. The test application I made was in there, but not the new application that was first made with local accounts. So, I added the new application, took it's generated applicationid and put it in the appsettings as the client id. I also generated a key for the application inside azure portal, but I am unsure what to do with that key. It appears now though that I am able to successfully authenticate, in that after logging it it gives me the "would you like to stay logged in..." option, but then on redirect it just does Working...indefinitely.so I think the issue now is with redirect.
The reply url I have in azure portal is just
https://localhost:44320/signin-oidc
I just put that in there to imitate the working test application which has the same thing but a different number, (this number matches the local host number that the new app uses in developement in launch settings). In the c# in AccountController I have tried a lot of things including the default
var redirectUrl = Url.Action(nameof(HomeController.Index), "Home");
but the redirect always gets stuck on Working...
Also, strangely, now every link on the site redirects to the azure login, rather than only the one link I initially setup to redirect to the login action on the accountcontroller for azure, which is odd and not the behavior I need. How do I fix that?
thanks
The other answers here are correct. If you were able to successfully publish the app from Visual Studio, a Client ID would have already been generated. Use your Visual Studio account to log into the Azure portal. Then find the app by either searching the name from the resources list or checking under the App Services blade. When you click into the app, you will want to copy the Application ID and paste it into the Client ID section in the web.config. (Client ID and Application ID are synonymous even though they are named differently.)
With regard to the reply URL question, you just need to make sure that the Redirect URI and the reply URLs are matching. Normally you would just put the application homepage URL in both sections, unless you wanted to direct the users somewhere else. (So it would just be https://myapp.azurewebsites.net)
First, new to creating Bots so please be patient.
I created a KB using QnAMaker. Created new Bot in Azure Bot Service. New bot was created using Template for QnA. Followed the steps below per documentation:
In Azure portal, open the newly created Web App Bot resource.
Click on "Application Settings" and in the App Settings list, add QnASubscriptionKey and QnAKnowledgebaseId. The corresponding values can be obtained from the KB Settings page in http://qnamaker.ai.
The QnAMaker-enabled Azure bot service app is now ready to use. To try it out click on "Test in Web Chat" to chat with your QnA bot.
Test in Web Chat does not respond
Also created new App, using Basic template. Made to other updates. Test in We Chat does send a response.
Again, new to the process but have read a great deal of documentation but nothing that speaks to this issue specifically. Any help would be greatly appreciated.
I created a QnAMaker bot this weekend with Bot Service. The documentation is a little confusing at the moment, although Microsoft generally refines it over time until it's quite good. Here's what I did to get this going.
Provisioned a QnAMaker service at qnamaker.ai. I created a knowledge base, saved and retrained, and published. To make sure everything is good on the QnAMaker service, go to the Test tab (https://qnamaker.ai/Edit/Test?kbId=:your-service-id to make sure you can chat with it and it responds as expected.
Created a new Web App bot by going to the portal, clicking "Create a resource", choosing "AI + Cognitive Services", then "Web App Bot".
When entering the Web App Bot settings, I made sure to choose a Basic C# bot, and chose the "Question and Answer".
Once you provision the Web App Bot service, you'll also have a Web App provisioned as well. You'll need to create a web application that will answer requests from the web, hand them to your QnAMaker service, and return the results. Navigate to your Web App Bot service, then choose the Build menu option under Bot Management. Then Download the zip file containing your starter code.
Open the starter code. You'll need to add some keys to your web.config file. Make sure that you have keys for the following, and that they're populated: MicrosoftAppId, MicrosoftAppPassword, QnaSubscriptionKey, QnAKnowledgebaseId, and AzureWebJobsStorage. If memory serves, these values are read within the code, but there's no empty stubs in the web.config that prompts you to enter them. This was a little frustrating.
After updating web.config, publish the web app to your Azure Web App instance associated with your bot.
Now go back to your Web App Bot in the portal. Under Bot Management, go to the Settings page. You're going to need to enter in the Messaging endpoint so that your bot service knows where to send HTTP requests to your web app, which will in turn talk to your QnAMaker service. In this example project, your messaging endpoint should be https://[web app name].azurewebsites.net/api/messages.
NOW you're ready to Test in Web Chat. Everything should link up then.
I had this issue just now. It was caused by having extraneous data at the end of my QNA service key, something like (format=json) which somehow ended up after the key. I suggest you re-copy and paste the knowledgebase id and key into the fields and make sure they are the correct length with no garbage.
Apart from not returning responses it gave no other clue as to what might be wrong.
I am working on Azure App service API apps.
I followed the steps available in the below link, for implementing user authentication concept to the ToDoListAngular project and successfully deployed in azure, but when i test with the ToDoListAngluar project azure url to add the todoitem it shows error on Google Chrome Address bar "This page is trying to load scripts from unauthenticated sources".
https://azure.microsoft.com/en-us/documentation/articles/app-service-api-dotnet-user-principal-auth/#overview
Please tell me how to resolve the above error.
It sounds like one of your API Urls does not have https:// at the beginning.
My best bet is the "toDoListAPIURL" in your front end site's application settings on the portal. There are a ton of API urls in the source code to check if that doesn't do it. Going back through the getting started tutorial should have them all.
I have a Sharepoint 2013 on premise environment for which I am developing an provider hosted app using Visual Studio.
The Visual Studio project has an app project which contains a custom ribbon button that goes to the web project. The web project is hosted on Windows Azure and here I get the error that the context token is null or an empty string.
Getting the token is done using the following code:
var contextTokenString = TokenHelper.GetContextTokenFromRequest(Request);
SharePointContextToken contextToken =
TokenHelper.ReadAndValidateContextToken
(contextTokenString, Request.Url.Authority);
When I see what is passed to the site hosted on Azure I notice that the SPAppToken is null. When using ULS viewer I get the error "The Azure Access Control service is unavailable"
I have already checked if the app is registered (using appregnew.aspx) and that the id is the same for this and in the appManifest.xml and web.config files.
How do I get the context token? Do I need to do something else in Azure in order to make it work?
The link from the comments helped me. I'm posting the answer here so we don't need to rely on a url sticking around.
You get the "EndpointAuthorityDoesNotMatch" message when your app's launch url doesn't match the "app domain" registered for your app's client_id.
For mine this meant that I needed to re-register the app for our test server separately from our develoment server via the _layouts/15/appregnew.aspx page on the O365 site. Here's a link with more info on registering client ids: http://msdn.microsoft.com/en-us/library/jj687469.aspx
Message 'The Azure Access Control service is unavailable' says that SharePoint can’t construct the SPAppToken because it can’t talk to ACS (Azure Access Control) in order to do that. This could be for a variety of reasons (e.g. network connectivity problems).
You can also check this blog: CJG: The Azure Access Control service is unavailable.