I am trying to switch from using the LUIS Authoring Key to using a Subscription Key for both my Assistant and my Skill. I created a Subscription Key and assigned it to the LUIS app. What do I need to modify in a Virtual Assistant bot to get it to use the new the new key/endpoint?
I changed the prediction endpoint key to use a Subscription Key so I don't hit HTTP 403 and HTTP 429 errors and now I need to understand what I need to change in both the Assistant and Skill projects to use this new endpoint.
You can update the cognitivemodels.json file to use the subscription key assigned. You need to modify the cognitivemodels.json file in both the Virtual Assistant and Skill (or each skill). Then just re-publish your bot.
Related
I have developed a chatbot for IT Support team in our company, running on MS Teams using Bot Framework Composer. I have integrated it with Azure logic apps to send emails to IT Support team.
I want to know how to;
Get user's email address in MS Teams (We can get user's name using ${turn.activity.from.name} telemetry track event)
Set a timeout period
Send a Image to using HTTP request in JSON format (Then users can upload the screenshot of their issue)
Yes, you can get the user's email address in MS teams by making fetching the roster or user profile or make use of get single member detail from this documentation.
Not sure if you want to restart a conversation or track the last time a message was received from a user, but you can refer to Expire a conversation documentation to get started with.
MS Teams makes use of webhooks to integrate with external apps and makes use of Standard HTTP message exchange feature where responses appear in the same chain as the original request message and can include any bot framework message content, for example, rich text, images, cards, and emojis.
I have created a Microsoft Teams bot that can create/update conversations and receives all kinds of events to an endpoint (user joined team, ...). All I see in the events is a tenant id. For teams, i get an id and sometimes a name which is great.
to create/update conversations I use this flow:
Get a token from https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token
POST to a channel: ${serviceUrl}v3/conversations/${conversationId}/activities
My question is, how can I get the name of a tenant? I can not find any API to do so?
Use case: A user sends me a support email. I have no way to check my database and find the correct entries because all I know is the tenant id.
I have looked into the Graph API but I'm not sure if my bot is actually able to make those calls (I get all kinds of strange permissions errors such as Authorization_IdentityNotFound The identity of the calling application could not be established.).
I want to make the calls to the API myself. I don't want to use any Microsoft SDK/Lib/...
It looks like I have to:
In Azure Portal -> App registrations -> API permissions add the Microsoft Graph application permission Organization.Read.All
For each tenant, ask the Microsoft Teams admin to visit: https://login.microsoftonline.com/${tenantId}/adminconsent
Get a graph token for the tenant via https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token (scope: graph.microsoft.com/.default)
Call the graph api https://graph.microsoft.com/v1.0/organization
I want to know there's some way I can set up an email alert on the LUIS port if any users are changing established intent and utterances.
I need this feature because many users are able to access/edit my LUIS app using the company's single-sign-on, so I want to set up an alert on the portal if any user add/edit intent is in the current app, then I will get an email alert.
Please suggest ways that I can do this.
Nicholas is correct. Your users should NOT have access to your app.
There is nothing in the LUIS app on LUIS.ai that will send an email or notification any time the app is changed, because the only people who should have access to it are the developers.
You need to request from your admin to ensure you and any devs on your bot are the only contributers to your LUIS app.
https://learn.microsoft.com/en-us/azure/cognitive-services/luis/luis-concept-keys
We provisioned bot services using "msbot clone services ..." command. As part of this command a *.dispatch file is created with all the correct details.
The dispatch aggregates QnAMaker knowledge base and a LUIS app. We have verified the .dispatch file and also the .bot file to ensure correct keys are being used. The only change if any is we are not using starter_key in LUIS, rather we have generated a new key and this new key reflects in .dispatch and .bot file (when decrypted).
We have encrypted the .bot file correctly and tried following commands, and both fail with same error:
dispatch refresh --bot mybot.bot --secret
dispatch refresh --dispatch dispatch-file.dispatch
Error
Exporting LUIS application...
ERROR
One or more errors occurred. (The remote server returned an error: (401) Access Denied.)
Request url: https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/<LUIS-APP-ID>/versions/0.1/export
Response: { "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." }
There are two different keys being used to use Dispatch CLI tool. Authoring key and subscription key. Authoring key is the key from luis.ai portal and needed to export the LUIS sources for Dispatch and to upload the newly created Dispatch app to luis portal. Subscription key is optional and is used for hitting luis endpoint/prediction API. If subscription key (created from Azure portal for LUIS Cognitive Service) is put in place of authoring key, Dispatch CLI won't be able to create and upload/refresh Dispatch app into luis. This is the expected behavior at the moment.
Having the exact same issue. With the starter key everything worked fine.
Edit: seems like an issue with Microsoft API.
You can use the starter key to update the dispatch model even though the query limit is reached.
My workaround was:
replace the subscriptionkey with the original starter key (authoringkey in luis)
run dispatch refresh
switch the keys again to allow for queries
I am facing following issue when i try to update application on Luis using following request:
https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/app-id-here
header:
Ocp-Apim-Subscription-Key:paid-subscription key
body:
{
"name": "Name of luis app",
"description": "string"
}
I am getting following error:
{
"statusCode": 401,
"message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}
I am using paid subscription from Azure portal with westus region. Still facing this issue.
However, This key works when I try to get top scoring intent using following request:
https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/luis-app-id?subscription-key=subscription-key-azure&timezoneOffset=-360&q=hi
This is really weird as sunscription key works for GET request but not for PUT or POST request.
Any suggestions?
PS: I am using paid subscription key.
The (subscription) keys created with a Cognitive Service LUIS resource in Azure Portal, even when added to with Assign resource in luis.ai, can only be used for runtime queries on a defined app.
The authoring endpoints on LUIS Programmatic APIs v2.0 - to create and manage apps and their elements - can only be used with the Authoring Key available in the luis.ai portal.
More information can be found in Authoring and query prediction endpoint keys in LUIS
It looks like you have two issues you are working thru here.
First, the API you are trying to post to should read "https://[location].api.cognitive.microsoft.com/luis/api/v2.0/apps/{appId}/publish". From the looks of it, you are missing the 'publish' at the end of your API call.
Second, the paid subscription key needs to be added to your LUIS app. Can you confirm it has been added? If not, follow these steps to do so:
Click Manage => Keys and Endpoints.
Next, click 'Assign resource'.
A window will pop up allowing you to select the tenant, subscription, and the key to use.
Click OK.
Click 'Publish' to make the newly generated endpoint accessible.
Make sure you add subscription primary key value in my request and also make sure you have associated your API with the product which you used the Primary key