Question answering in Azure Cognitive Service For Language provides cloud-based Natural Language Processing (NLP) that allows you to create a natural conversational layer over your data. And it replaced Azure QnA Maker service since 1st Oct, 2022.
With Question Answering, developers can quickly create a bot in Azure by following this guide . However some developers noticed that this bot cannot be used as Skill Bot, for example, after taking below steps skill bot still return 401 errors to the root bot,
{
"$schema": "https://schemas.botframework.com/schemas/skills/v2.2/skill-manifest.json",
"$id": "<newqna01-bot>",
"name": "<newqna01-bot>",
"version": "2022-01-14T08:54:40.2310775Z",
"description": "newqnabot01 manifest",
"publisherName": "<newqna01-bot>",
"endpoints": [
{
"name": "newqnabot01 PROD",
"protocol": "BotFrameworkV4",
"description": "PROD",
"endpointUrl": "https://<newqna01-bot>.azurewebsites.net/api/messages",
"msAppId": "aa6fabxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
]
}
4. Add the skill bot to the root bot by importing manifest
5. Add trigger to skill bot in the root bot (refer to: Connect to a remote skill with Bot Framework Composer )
6. Add root bot app id to allowedCallers field in appsettings.json under the skill bot project
7. Test skill bot trigger locally in root bot, hits the 401 error
The reason of this problem is the created bot from Language service uses a root bot pattern, which doesn’t include the authentication and error handling requirement for a typical skill bot.
To solve it, need to refer this article Implement a skill - Bot Service , and take below steps. In this article, I name the language service created bot as newqna01-bot, which will be our remote skill bot. Before starting, make sure we created a simple skill manifest for the skill bot, and import it to the root bot in Bot Composer as above.
Modify the skill bot project
======================
{
"DefaultAnswer": "",
"DefaultWelcomeMessage": "",
"MicrosoftAppType": "",
"MicrosoftAppId": "aa6fab21-xxxxxxxxxxx",
"MicrosoftAppPassword": "IZw8Q~xxxxxxxxxxxxx",
"MicrosoftAppTenantId": "72f988bf-xxxxxxxxxxx",
"AllowedCallers": [ "*" ],
"LanguageEndpointHostName": https://<newqna01-xxxxxxxxx>.cognitiveservices.azure.com/,
"ProjectName": "xxxxxxxxxxxxx",
"LanguageEndpointKey" : "dda4cdxxxxxxxxxxx"
}
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
Modify the Bot Composer Project Setting
=========================
"skillHostEndpoint": https://ca99-2404-f801-9000-18-6fec-00-d9.ap.ngrok.io/api/skills,
"skills": {
"allowedCallers": [
"aa6fab21-xxxxxxxxx"
]
"newqnabot01": {
"endpointUrl": https://localhost:3987/api/messages,
"msAppId": "aa6fab21-xxxxxxxxxxxxxx"
}
"newqnabot01": {
"endpointUrl": https://newqna01-bot.azurewebsites.net/api/messages,
"msAppId": "aa6fab21-xxxxxxxxxxx"
}
Note: In the bot composer, “skillHostEndpoint” will be autoset to the real azure root bot web app link on azure side during publishing. Means the local skillHostEndpoint config is still the ngrok setting, while the same time azure side skillHostEndpoint is azure root bot app link.
Happy Bot Framework Development!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.