Azure问题回答机器人 - 如何添加身份验证?
我创建了一个基本的Azure“自定义问题回答” bot( https://learn.microsoft.com/en-us/azure/cognitive-services/language-service/question-service/question-swering/question-swering/quickstart/sdk?pivots?pivots=studio )。我通过语言工作室创建了机器人: 通过语言工作室创建bot
我想添加身份验证,以便只有拥有我的用户是我的一部分Azure AD能够与机器人交互。我已经尝试遵循以下列出的教程:
- https://learn.microsoft.com/en-us/azure/bot-service/bot-service/bot-builder-authentication?view= azure-bot-service -4.0& tabs =单胎%2CAADV2%2ccsharp
- https://learn.microsoft.com/en-us/icrosoftteams/plateams/platform/bots/how-to-to/how-to/authentication/authentication/add-authentication一下- 样本
我无法遵循这些教程,因为它们认为该机器人是从以下任何一个代码库中构建的:
-
https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/46.teams -auth
-
我通过语言工作室部署的机器人看起来是从以下框架中构建的:
如何将身份验证添加到我通过Azure Language Studio (认知服务)部署的自定义问题的身份验证?目前,任何人都会与我的机器人互动。
谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了添加身份验证,需要使用Python编程安装库支持。
添加上面的库以开始身份验证过程。
与客户端进行身份验证
从Azure认知服务中获取API密钥。
要实例化询问Answerclient
以获取进一步的参考,请检查下面的链接:
https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell
To add authentication, there is a need to install a library supportive with Python Programming.
Add the above library to start authentication process.
Authenticate with Client
Get an API key from Azure Cognitive Services.
To Instantiate QuestioningAnswerClient
For further reference, Check the below link:
https://pypi.org/project/azure-ai-language-questionanswering/
https://learn.microsoft.com/en-us/azure/cognitive-services/authentication?tabs=powershell
由于这些都是样本,因此它们都是为了简单起见而设计的。您需要做的实际上是直接的(在概念上,如果不是总是在实践中)。您应该查看AUTH样本的代码和文档,并将身份验证部分与CQA Bot集成。另外,您可以将CQA部分与Auth Bot集成。无论您从哪个基础开始,目标都是相同的。结合两个。
Since these are all samples, they're all designed to do one thing for simplicity's sake. What you need to do is actually straightforward (in concept, if not always in practice). You should look at the code and docs of the auth samples and integrate the authentication sections with your CQA bot. Alternatively, you could integrate the CQA sections with an auth bot. Regardless of which base you start with, the goal is the same. Combine the two.