首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法用ARM模板完全自动化基于QnAMaker的Azure Bot?

有没有办法用ARM模板完全自动化基于QnAMaker的Azure Bot?
EN

Stack Overflow用户
提问于 2020-12-14 06:11:52
回答 1查看 480关注 0票数 2

我正在寻找一个解决方案,在这个解决方案中,我应该能够在ARM模板的帮助下完全创建和配置Azure Bot (它应该包括创建资源、KB & Web )

  • 我有ARM模板,可以在门户上创建/自动化所需的认知服务、应用服务、应用程序洞察力和搜索服务
  • 创建的服务是正确配置的,所有的应用程序设置都是动态的,有正确的引用。
  • 下一步应该允许在同一执行过程中通过某些自动脚本(最好是PowerShell)创建知识库,尽管有脚本可以创建KB,但我不确定如何获得最新创建的OCP APIM密钥,并使用它创建知识库。

我的问题是:

我们能不能完全自动化

  1. 资源创造
  2. 知识库创造
  3. 创建Web应用程序Bot

在单个自动化脚本中,由于它们是相互依赖的(KB on Services,Web on KB),我几乎找不到相关的文章来实现这一点。

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-14 13:06:16

使用通过QnAMaker部署的手臂服务创建一个KB。我们准备好的ARM模板是可用的这里https://github.com/Azure/azure-quickstart-templates。在端点键下面插入qna服务的app配置中。

代码语言:javascript
复制
{
            "type": "Microsoft.Web/sites",
            "apiVersion": "2016-08-01",
            "name": "[variables('qnaMakerWebName')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "enabled": true,
                "httpsOnly": true,
                "siteConfig": {
                    "cors": {
                        "allowedOrigins": []                                                   
                    }
                },
                "name": "[toLower(variables('qnaMakerWebName'))]",
                "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('serverFarmName'))]",
                "hostingEnvironment": ""
            },
            "tags": {
                "isqnamaker": "true",
                "solution": "[parameters('resourceSolutionTag')]",
                "[concat('hidden-related:', resourceId('Microsoft.Web/serverfarms', variables('serverFarmName')))]": "empty"
            },
            "dependsOn": [
                "[resourceId('Microsoft.Web/serverfarms', variables('serverFarmName'))]",
                "[resourceId('microsoft.insights/components', variables('appInsightsName'))]",
                "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
            ],
            "resources": [
                {
                    "apiVersion": "2015-08-01",
                    "name": "appsettings",
                    "type": "config",
                    "dependsOn": [
                        "[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebName'))]",
                        "[resourceId('Microsoft.Search/searchServices/', variables('azureSearchName'))]",
                        "[resourceId('microsoft.insights/components', variables('appInsightsName'))]"
                    ],
                    "properties": {
                        "AzureSearchName": "[variables('azureSearchName')]",
                        "AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', variables('azureSearchName')), '2015-08-19').primaryKey]",
                        "UserAppInsightsKey": "[reference(resourceId('microsoft.insights/components/', variables('appInsightsName')), '2015-05-01').InstrumentationKey]",
                        "UserAppInsightsName": "[variables('appInsightsName')]",
                        "UserAppInsightsAppId": "[reference(resourceId('microsoft.insights/components/', variables('appInsightsName')), '2015-05-01').AppId]",
                        "PrimaryEndpointKey": "[concat(variables('qnaMakerWebName'), '-PrimaryEndpointKey')]",
                        "SecondaryEndpointKey": "[concat(variables('qnaMakerWebName'), '-SecondaryEndpointKey')]",
                        "DefaultAnswer": "No good match found in KB.",
                        "QNAMAKER_EXTENSION_VERSION": "latest"
                    }
                },
                {
                    "apiVersion": "2018-02-01",
                    "type": "config",
                    "name": "logs",
                    "dependsOn": [
                        "[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebName'))]"
                    ],
                    "properties": {
                        "applicationLogs": {
                            "fileSystem": {
                                "level": "Warning",
                                "retentionInDays": 7
                            },
                            "azureBlobStorage": {
                                "level": "Verbose",
                                "sasUrl": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob, parameters('storageAccountContainerQnaAppLog'), '?', listAccountSas(variables('storageAccountName'), '2018-02-01', variables('listAccountSasRequestContent')).accountSasToken)]",
                                "retentionInDays": 7
                            }
                        },
                        "httpLogs": {
                            "fileSystem": {
                                "retentionInMb": 35,
                                "retentionInDays": 7,
                                "enabled": false
                            },
                            "azureBlobStorage": {
                                "enabled": true,
                                "sasUrl": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))).primaryEndpoints.blob, parameters('storageAccountContainerQnaWebLog'), '?', listAccountSas(variables('storageAccountName'), '2018-02-01', variables('listAccountSasRequestContent')).accountSasToken)]",
                                "retentionInDays": 7
                            }
                        },
                        "detailedErrorMessages": {
                            "enabled": true
                        }
                    }
                }
            ]
        }

Bot 虚拟助理是一个解决方案加速器,它将公共功能、服务和Bot最佳实践集成到一个易于部署的包中,然后可以根据客户的需要进行定制。虚拟助理构建在behavior之上,部署在开发人员的Azure订阅Azure Bot服务中,保存由助手生成的所有数据(询问问题、用户行为等)。完全在客户的控制之下。

虚拟助理的主要构成部分包括:

带有代码、对话框和语言生成资产的Visual项目

ARM & PowerShell中可定制的部署脚本

依赖服务的自动配置和配置(LUIS、QnA、存储、计算等)

适用于已知场景的可插拔技能,如Microsoft数据资产的会话使用

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65284413

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档