Azure / Azure/azure-cli

Error after creating QnA with azure cli

Open
#15,733 1 comment 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## Describe the bug

When deploying a new QNA maker service via az cli, using an ARM template, however I am unable to perform any actions - either via the qnamaker.ai portal or programatically via the rest api.

the template is as follows
`
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clientName": {
"type": "string"
},
"qnaSkuName": {
"type": "string",
"defaultValue": "F0",
"allowedValues": ["F0", "S0"]
},
"searchServiceSkuName": {
"type": "string",
"defaultValue": "free"
},
"searchHostingMode": {
"type": "string",
"defaultValue": "Default"
},
"appServiceSkuName": {
"type": "string",
"defaultValue": "P1v2",
"allowedValues": [
"F1",
"S0",
"D1",
"B1",
"B2",
"B3",
"S1",
"S2",
"S3",
"P1",
"P2",
"P3",
"P4",
"P1v2"
],
"metadata": {
"description": "Describes plan's pricing tier and instance size. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
}
},
"appServiceSkuCapacity": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"metadata": {
"description": "Describes plan's instance count"
}
}
},
"variables": {
"webAppQnaName" : "[concat(parameters('clientName'), '-qna-webapp')]",
"appServicePlanName": "[concat(parameters('clientName'), '-qna-asp')]",
"azureSearchName": "[concat(parameters('clientName'), '-cognitivesearch')]",
"appInsightsName": "[concat(parameters('clientName'), '-qna-ai')]"
},
"resources": [
{
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2017-04-18",
"name": "[concat(parameters('clientName'), '-qnamaker')]",
"location": "westus",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppQnaName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('azureSearchName'))]",
"[resourceId('microsoft.insights/components/', variables('appInsightsName'))]"
],
"sku": {
"name": "[parameters('qnaSkuName')]"
},
"kind": "QnAMaker",
"properties": {
"apiProperties": {
"qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', variables('webAppQnaName'))).hostNames[0])]"
},
"customSubDomainName": "[parameters('clientName')]"
}
},
{
"type": "Microsoft.Search/searchServices",
"apiVersion": "2015-08-19",
"name": "[variables('azureSearchName')]",
"location": "[resourceGroup().location]",
"tags": {},
"sku": {
"name": "[parameters('searchServiceSkuName')]"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"hostingMode": "[parameters('searchHostingMode')]"
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2016-08-01",
"name": "[variables('webAppQnaName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
],
"tags": {
"displayName":"qna"
},
"properties": {
"enabled": true,
"siteConfig": {
"cors": {
"allowedOrigins": [
"*"
]
}
},
"name": "[variables('webAppQnaName')]",
"serverFarmId": "[concat('/subscriptions/', subscription().SubscriptionId,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]",
"hostingEnvironment": ""
},
"resources": [
{
"type": "microsoft.insights/components",
"apiVersion": "2015-05-01",
"name": "[variables('appInsightsName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', variables('webAppQnaName'))]"
],
"tags": {
"[concat('hidden-link:', resourceId('Microsoft.Web/sites/', variables('webAppQnaName')))]": "Resource"
},
"kind": "web",
"properties": {
"ApplicationId": "[variables('webAppQnaName')]"
}
},
{
"type": "config",
"apiVersion": "2015-08-01",
"name": "appsettings",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppQnaName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('azureSearchName'))]"
],
"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('webAppQnaName'), '-PrimaryEndpointKey')]",
"SecondaryEndpointKey": "[concat(variables('webAppQnaName'), '-SecondaryEndpointKey')]",
"DefaultAnswer": "No good match found in KB.",
"QNAMAKER_EXTENSION_VERSION": "latest"
}
}
]
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2016-09-01",
"name": "[variables('appServicePlanName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "[parameters('appServiceSkuName')]",
"capacity": "[parameters('appServiceSkuCapacity')]"
},
"properties": {
"reserved": true
},
"tags": {
"displayName": "HostingPlan"
}
}
],
"outputs": {
"qnaRuntimeEndpoint": {
"type": "string",
"value": "[concat('https://',reference(resourceId('Microsoft.Web/sites',variables('webAppQnaName'))).hostNames[0])]"
}
}
}
`

The process finish successfully and when I try to connect to the QnaMaker.ai or the api I get this error

> GET https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/endpointkeys HTTP/1.1
Host: westus.api.cognitive.microsoft.com
Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••

> x-envoy-upstream-service-time: 101
apim-request-id: 3c59d954-9c57-4a7d-b554-f70dea616c3d
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Fri, 30 Oct 2020 12:22:21 GMT
Content-Length: 185
Content-Type: application/json; charset=utf-8
{
"error": {
"code": "EndpointKeysError",
"message": "No Endpoint keys found. If this is a new service, please wait a minimum of 10 minutes for the runtime to be ready."
}
}

## To Reproduce:

The command is
- `az deployment group create --resource-group {} --template-file {} --debug`

with the resource group name and the json file.

Then I try to access the qna maker with the API and get the above error.

## Expected Behavior

After the creation of all the resources, I should be able to interact with the qnamaker.ai or with the qna API.

## Environment Summary
```
Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.14.0

```
## Additional Context

Thanks in avance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.