Can I assign same LUIS subscription key to multiple Luis apps? - azure-language-understanding

Can I assign same LUIS subscription key (generated from azure portal) to more than one LUIS application (On Luis.ai portal). I tried doing that and getting following error when I use the luis application in my bot:
"This application cannot be accessed with the current subscription"
Technically the luis.ai portal allowed me to assign the same key to multiple Luis apps.

Yes, assuming they are in the same region.
The authoring key in LUIS.ai is not the same thing as the endpoint LUIS subscription key in portal.azure.com. The authoring key allows you to author any LUIS app and the endpoint key allows you to query any LUIS endpoint. This doc should help understand keys learn.microsoft.com/en-us/azure/cognitive-services/luis/

Related

How to add a Prediction Resource to LUIS app programmatically

I am using C# SDK to create the LUIS apps with required Intents, Utterances and Entities, and then training and Publishing the apps using an Authoring key created in Azure portal. After this, I use the REST Prediction endpoint for Intent matching, and till now I used the free Starter Prediction Key. After a month since the Starter key gets expired, I created a Cognitive service in Azure to be used as the Prediction resource. Now, how to add this new Prediction resource(Cognitive service) to my LUIS apps via SDK or REST? I am able to do so from LUIS Portal though, but don't want manual intervention.
Once you create the prediction endpoint resource, the resource should be only used for endpoint prediction queries and not for authoring changes to the app. If you want to add the prediction resource to your app by not going through the portal and automate the assignment of the resource to a LUIS app for purposes like CI/CD pipeline, then you can follow the steps below:
Get an Azure Resource Manager token from this website. This token does expire so use it immediately. The request returns an Azure Resource Manager token.
Use the token to request the LUIS runtime resources across subscriptions, from the Get LUIS azure accounts API, which your user account has access to.
This POST API requires the following settings:
This API returns an array of JSON objects of your LUIS subscriptions including subscription ID, resource group, and resource name, returned as account name. Find the one item in the array that is the LUIS resource to assign to the LUIS app.
Assign the token to the LUIS resource with the Assign a LUIS azure accounts to an application API.
This POST API requires the following settings:
When this API is successful, it returns a 201 - created status.
Hope this helps.
Thanks, accepted. The only issue being, since I am doing every thing using SDK, it takes a lot of API calls to get things done. I mean to solve this, first I am generating a Token and then calling this API. A simple add default "Prediction Resource" for all apps on LUIS portal would have helped a lot. Anyways, thanks for this answer. – user3868541 Feb 3 at 9:45
Agreed that an Add default Prediction Resource would have made everything much better. I'm still not sure how to do this programmatically. I'm trying to do it in my service using the SDK

LUIS deployed through SharePoint - How to get user data?

We have deployed LUIS V4 in our Azure Platform, and made it available to our employee through SharePoint. It is currently open and does not need log in to be used.
We would like to capture information about who the person interacting with the bot is; is there any way that information related to the user can be retrieved? (employees to use the bot must be authenticated to Azure as it is within a SharePoint, but the bot doesn't require authentication as mentioned)
Thank you!
If you are just using LUIS, then no, it does not do any user specific tasks. It only translates an utterance (phrase) into specific actions (intents and entities), also does not store any state.
So all authorisations and user customisations need to be done outside of LUIS, with plain code. If you are using Azure/Microsoft Bot, you can hook up a channel to LUIS and use the id to identify user (skype id, phone number, microsoft teams id...)
A bit of info for connecting Azure Bot with SharePoint.

Why do LUIS app lose endpoint key if I use it in several apps?

I have several LUIS apps, 6 normal and 5 dispatch. I assign the same endpoint key from a cognitive service en Azure to all of them. But it seems that there are always two that end up losing the resource somehow.
Couldn't find any documentation about a limit on how many LUIS apps can use the same endpoint at the same time.
You can assign the same subscription key/endpoint key to multiple LUIS apps assuming they are in the same region. Also, the authoring key in LUIS.ai is not the same as the endpoint LUIS subscription key in portal.azure.com. The authoring key allows you to author any LUIS app and the endpoint key allows you to query any LUIS endpoint. The endpoint key allows a quota of endpoint hits based on the usage plan you specified when creating the key. This gives you a detail on the key limits for different subscriptions.

ocp-ipm subscription key for QnA Maker

I am working with QnA Maker and i do not have idea how to get ocp-apim subscription key. I trying with endpoint key that that we get after publishing but it doesn't work.
Can anyone help me how to get ocp-apim subscription key for the QnA maker?
Go ahead and navigate to your QnAMaker Cognitive Services resource in the Azure portal, and then click on the keys blade.

Can't change language in botframework

I created a bot in botframework (microsoft Azure) connect to a LUIS App. It worked all very well. But in english. The connection between the Bot and LUIS App has been done automatically.
Now I want it to work in German. So I created a new App in luis with de-de culture. Created my german intents. Published it.
I followed the instructions from LUISChatBot. I could retrieve LUIS AppID and Authorizing Key as well as the endpoint of the German LUIS App to add it to my Azure chat bot. And the bot continues to understand only the intents in english!
So I guess the connection doesn't work how it is explained in the instructions above. Even worse : even if I put nothing ( = I remove the ID and Key and let it empty) in LuisAPIkey or LuisAPIId represented in the image of the Azure Chatbot settings, the bot continues to understand the english intents !?!
How can I make it work? I looked in the code of the bot, but I don't find the key appearing there (which makes sense). The only think I found, was in BasicLuisDialog.cs :
public BasicLuisDialog() : base(new LuisService(new LuisModelAttribute(
ConfigurationManager.AppSettings["LuisAppId"],
ConfigurationManager.AppSettings["LuisAPIKey"],
domain: ConfigurationManager.AppSettings["LuisAPIHostName"])))
{
}
Thank you for your time
Half-Answer : I could change the language by changing the region in Azure (west EU) and then also use eu.luis.ai.
But I still don't know why the chatbot continued working when I removed the key and endpoint of LUIS in Azure.
you can use
var english = new Option();
english.Locale = "en-US";
Reference: GitHub
or
In BotSDK v4.0, you can use System.Globalization.CultureInfo("en-US"); to translate your existing language to the language you needed.

Resources