I have created one action bot (which can create ticket, tell me the description of the ticket). I have published that bot in azure. After that I have created one FAQ bot using QnA Maker, Knowledge Base and LUIS. Now I have published this FAQ bot as a Skill. Now I want to merge this to bot. For that I have added the FAQ bot skill to the Action Bot. And in Skill Configuration I have given the parent bot (Action Bot) url as "skill host endpoint url". Ex: "https://api-demobotresource.azurewebsites.net" this is my Action Bot url , and "https://FAQ-Demo.azurewebsites.net/api/messages" this is my Skill endpoint url. So I have given skill host endpoint url as "https://api-demobotresource.azurewebsites.net/api/skills". After publishing the merged bot in azure when I try to check it in web-chat, the Skill bot is not working properly. It is throwing 401 error.
I have taken the help of this article https://microsoft.github.io/botframework-solutions/help/known-issues/ . Still I am facing the same issue.
Please help. Thanks in Advance.
The listed Error: 401 is getting triggered due to Authentication Failure and this can be due to the following 2 reasons:
Invalid Microsoft App ID & Password
Incorrect “https” settings
As part of the solution, we need to enable the “https” settings along with inserting correct Microsoft App ID & Passwords.
If the above solution is already tried but ends in the same error, then we can try Deleting all the existing files every time we are updating or modifying our BOT Code. These steps would help in redeploying the Web APIs.
Related
The last few days, I checked dozens of samples, docs, blog posts, youtube videos (courses, that I couldn't fine) and I can say I'm still confused and I still without a Teams bot.
Every example I've checked is different in approach, and now I'm pretty sure there are many others like me.
Frequently problems: required input/parameters like service Url, conversation Id, etc. 1. You can't find a explanation for them. 2. You can't find a place where it's explained how to get them.
What I want to achieve
I want a bot on Teams, with a API, with 2 parameters: user email, message. The bot has to send the message to the specified user. That's it.
I'm looking how to:
Create/Setup the Application
Create the actual Bot
Install the application to Teams
I used to create a Teams conversation bot. Hope my experience will help you.
First, download sample provided by microsoft. I uses c# to create this bot, so I copy the '57.teams-conversation-bot' folder and opened it with vs studio. In this sample, I need to modify the configuration in appsettings.json. I need to enter the appid and apppassword.
So the next step is creating an Azure ad application in Azure portal. But if you never create Bot Framework registration resource before, you can create the azure ad application when you create a Bot Framework.By the way, You can leave 'Messaging endpoint' empty now. Please note, when you creating Azure ad application, you can choose to set this application as a multitenant app if your account creating the app is in a different tenant with your teams account.
Now I have a bot framework and an Azure ad app, I can modify appsettings.json, enter the appId and app password. I can get appId in app overview page and get app password when creating client secrets in Certificates & secrets tag.
Now, I need to debug my sample with web chat in the azure portal(Enter the bot framework created just now, you can see Tag 'Test in web chat' in the left panel). So I need to use ngrok to make the bot visit my code in local environment. Running the sample by pressing F5 in vs studio. Opening ngrok.exe and running the command ngrok http -host-header=rewrite 3978. Then I can get a https url, copy that and paste in the 'Messaging endpoint'. Don't forget to add '/api/messages'.
Now sending 'hello' to the bot and you will get default result. When you get the picture below, it means you have made a correct configuration.
Next step is to add this bot to Teams client. First, I add the Teams Channel in the bot I created in the azure portal.
Then I need to modify the manifest file. Replacing the "YOUR-MICROSOFT-APP-ID" with appId creating just now. And creating manifest.zip file which contains the three file in folder TeamsAppManifest.
Next step is uploading the zip file to Teams client. Click the 'Apps' in the lower-left corner and click the 'Upload the custom app' in the bottom of the left panel, then click add. Ok, now I get a team conversation bot.
There -are- a ton of approaches, partly because Teams development is still relatively new, partly because the Bot Framework (the set of tools for buildings Bots in the Microsoft world, both for Teams and otherwise) has also undergone some major changes. That's aside from the various language options (dotnet, node, python, etc.).
What's looking to be a good place to get started though, is the new Teams Toolkit, a plugin for Visual Studio and Visual Studio Code, for building a new Teams project (Tab, Bot, etc.). Have a look here for a link. It's very new though, so some rough edges, but it's aiming to be very comprehensive to get up and running quickly (does a lot of Azure registrations behind the scenes, for example). Check out the latest monthly Teams Developer call, from earlier this week, for a visual run-through: https://www.youtube.com/playlist?list=PLWZJrkeLOrbbTKzV1sQOFAXd_s0BHJDiL (this week's call isn't up yet, but it should be very soon).
I am working on creating bot for Microsoft teams in C#. I have a sample code (basic echo bot) that works fine in emulator. I created an app in teams app studio and entered my API end points in Bot section. I download the package and upload it as custom package in teams.
Now, when I add this app and try communicate with Bot, I get unauthorize error in API (using ngrok). I guess what’s going on here is that I don’t have the access token i.e. when someone install it, teams should give you access token, right?
What I don’t know is how teams will give me the access token and where in the process that access token will be used?
So basically, when someone clicks on “Add” button in teams app store, how the access token are passed.
#update
Note:-I have done the app registration as well.
So i did bot channel registration in Azure and added my ngrok end points. I copied the "MicrosoftAppId" and "MicrosoftAppPassword" in appsettings file. It is working fine in emulator as well as "test on web chat" in Azure bot management portal. I also connected it to Teams channel from portal itself. when i navigate to teams from the channel link, my bot is working as expected.
After that i opened app studio and entered all the details. In Bot section, i selected existing bot id and entered my MicrosoftAppId from azure and it worked.
what I still don't understand is, when someone install the app, teams should be sending some information to my end point, right?
Without access to your code it is hard/impossible to determine the cause of your issue.
I suggest instead you take a fresh start by using one of the Teams bot examples that are shared :
57.teams-conversation-bot
if you do require authentication in your bot:
Authentication flow for bots - Teams | Microsoft Docs
46.teams-auth
52.teams-messaging-extensions-search-auth-config
pleanty other teams examples as well in that repo:
50.teams-messaging-extensions-search
51.teams-messaging-extensions-action
53.teams-messaging-extensions-action-preview
54.teams-task-module
55.teams-link-unfurling
56.teams-file-upload
57.teams-conversation-bot
58.teams-start-new-thread-in-channel
I am using a Microsoft Graph api code to authenticate and get details of user.
I am trying to build and run below project.
console csharp connect msgraph project
After building and running the project , it redirects to a browser and ask to login using my account and when i select my email account ,it shows the error (AADSTS500113 No reply address is registered for the application) in attached screenshot.
Please Help.
Go to apps.dev.microsoft.com
Click the "Edit Application Manifest" button.
Add https://yourdomain.com/callback to the replyUrls element.
For Azure AD
If this does not fix your problem you might have to look at Azure AD. I am not sure which solution you're looking for since your question was a bit decryptive formulated.
I downloaded the QnAmaker sample from here and trying to make it working from bot emulator.
I gave the correct Microsoft App Id and App Password. I even tried with a newly regenerated password. But getting the same error.
Did anyone face this issue? What should I try next to get this resolved?
My app settings
My ngrok settings
I removed ngrok settings from emulator settings.Removed MsApp Id and Ms App Password and then started emulator and the bot is responding. But I need to connect to my QnaMaker on azure and get response based on my knowledge base.
I tried via Web chat from azure portal and it did not responded.
Here is the error message I found in Application insights
Failed to acquire token for client credentials. (AADSTS700016:
Application with identifier 'fXXXXXXXXXXXXXXXXXXXXX2' was not found in
the directory 'botframework.com'. This can happen if the application
has not been installed by the administrator of the tenant or consented
to by any user in the tenant. You may have sent your authentication
request to the wrong tenant. Trace ID:
9XXXXX-46a3-4XX-b8XXX7-c1XXXXX00
"This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant"
How can I ensure that I am sending the request to correct tenant ? Where can I verify this?
Try removing the values for MicrosoftAppId and MicrosoftAppPassword from your appsettings.json file then run the bot and attempt to connect it via the emulator again.
When you connect to a bot in the emulator, AND the appsettings.json (always) or .bot file (only for the development endpoint) has values set for the MicrosoftAppId and MicrosoftAppPassword then you will need to enter these details into the provided fields on the connection screen, see my image below:
If your values in your appsettings.json for MicrosoftAppId and MicrosoftAppPassword are empty i.e. "" then you will not have to enter them at the connection screen and your bot will still work when you are debugging locally, even though your live bot has these set. The exception is when you're using ngrok to debug a production channel using your local code, then you will have to provide the MicrosoftAppId and MicrosoftAppPassword when connecting even though they may not be set locally.
If you want to see the response inside emulator then remove the app id and password from app settings.json file(it has worked for me) and add QnA kb keys in the app settings file. And if you want to test on web chat then add app id and password in the app settings file with QnA kb keys and publish it. Once your bot is published you will be able to test on web chat and change the messaging endpoint to your published url.
By the way if you are using v4 botframework, you will not require ngrok.
I think I might know what caused this - where did you get the Application ID and Application Password from? They need to be from a newly created "Bot" app in the Azure portal. If you don't have the right app+key combo, you can happily communicate with your bot through the emulator, for instance, but it won't be able to connect to other services (e.g. QnAMaker, MS Teams).
In the Azure portal, the "Web App Bot" template will create a Bot app AND a web hosting application in Azure, but there's also an option to create a "Bot Channels Registation" if you're using an existing sample application you've downloaded and are running on your local machine.
This "Bot Channels" option is basically just a placeholder of sorts in Azure, where all the key registration in Azure for the bot is done, but you can host the bot itself anywhere you like (for instance on your local machine, in which case you provide the ngrok address as the endpoint, something like: https://250a1f39.ngrok.io/api/messages (make sure you have the "/api/messages" on there).
On the Settings screen for the bot in the Azure portal, where you capture/update the endpoint, is the "Microsoft App Id" you need. There's also a link to "manage", which should take you to where you can get the password, but the link is currently broken (I think MS is working on fixing it), so to get the password you need a few more steps:
Go to the main Azure home page / main resources listing (small menu icon on top left in Azure)
Go to Azure Active Directory (yes, even in your own personal Azure subscription you would do this - there's still an Azure AD provisioned behind the scenes)
Go to "App Registrations" on the left menu
Go to "Applications from personal account" near the top of the page (NOT on the main top menu, a bit down)
In there you will find your new bot - open it up
Go to "Certificates and secrets"
Click the button to create a "New client secret"
Choose an expiry option and optionally give it a description.
Click Add and once it's added - that's the app password you need
Since the existing instagram APIs are deprecated, I am switching to the graph api.
Below is what i want to achieve and what the issue is.
Requirement.
I would like to track the number of likes and comments on instagram posts in which my business account is mentioned using #. I have setup the faccebook and instagram accounts along with the webhook. The webhook is going to send me the "mediaid" in which i my business account is tagged.
Since the app is in the development mode i am not receiving the webhooks if i mention the business account in any of the post, but i am able to send the test webhook from the developer account console. So i assume once the app is in LIVE mode it will start sending the webhooks to my server.
Once the "mediaid" is received i would like to make a call to another api https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media
in order to get the number of likes and comments.
I am facing an issue on the 2nd part. Whenever i call the api mentioned in the 2nd part i am getting the error
This api call works fine when i pass the mediaid that my instagram business account owns. But as soon as i pass the mediaid of the post which mentioned my business i am getting the above error.
I just wanted to check if this is also a limitation of my facebook app being in a development mode ? Please suggest a solution to achieve this scenario.
I tried the same what you did but with a live facebook app. From the webhook, I got an event when any other user mentioned my instagram business handle in caption and am able to fetch the mentioned media details using the mentioned media API https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media.
As you didn't share the webhook event payload, I am just assuming you are using the correct user id while making the API call. The JSON path of the user id in event payload is entry[0].id