Skip to content

Instantly share code, notes, and snippets.

@maxnorth
Last active August 9, 2019 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxnorth/e832ff33780e2ddbe01cd8ad17510e5f to your computer and use it in GitHub Desktop.
Save maxnorth/e832ff33780e2ddbe01cd8ad17510e5f to your computer and use it in GitHub Desktop.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourcesNamePrefix": {
"type": "string"
},
"resourcesLocation": {
"type": "string",
"allowedValues": [
"Australia East",
"Canada Central",
"Central India",
"Central US",
"East Asia",
"East US",
"East US 2",
"France Central",
"Japan East",
"Korea Central",
"North Central US",
"North Europe",
"South Africa North",
"South Central US",
"Southeast Asia",
"UK South",
"West Central US",
"West Europe",
"West US",
"West US 2"
]
}
},
"variables": {
"searchServiceName": "[concat(parameters('resourcesNamePrefix'), '-search')]",
"appServiceName": "[concat(parameters('resourcesNamePrefix'), '-app-service')]",
"webAppName": "[concat(parameters('resourcesNamePrefix'), '-app')]",
"qnaMakerAccount": "[concat(parameters('resourcesNamePrefix'), '-qna-account')]"
},
"resources": [
{
"name": "[variables('searchServiceName')]",
"type": "Microsoft.Search/searchServices",
"apiVersion": "2015-08-19",
"location": "[parameters('resourcesLocation')]",
"tags": {},
"identity": null,
"properties": {
"replicaCount": "1",
"partitionCount": "1",
"hostingMode": "default"
},
"sku": {
"name": "basic"
}
},
{
"type": "Microsoft.Web/serverfarms",
"kind": "app",
"name": "[variables('appServiceName')]",
"apiVersion": "2018-02-01",
"location": "[parameters('resourcesLocation')]",
"sku": {
"name": "D1",
"tier": "Shared",
"size": "D1",
"family": "D",
"capacity": 0
},
"properties": {},
"dependsOn": []
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-02-01",
"name": "[variables('webAppName')]",
"location": "[parameters('resourcesLocation')]",
"kind": "app",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServiceName'))]"
],
"properties": {
"name": "[variables('webAppName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServiceName'))]",
"siteConfig": {
"cors": {
"allowedOrigins": [
"*"
]
},
"appSettings": [
{
"name": "AzureSearchName",
"value": "[variables('searchServiceName')]"
},
{
"name": "AzureSearchAdminKey",
"value": "[listAdminKeys(variables('searchServiceName'), '2015-02-28').primaryKey]"
},
{
"name": "PrimaryEndpointKey",
"value": "[concat(variables('webAppName'), '-PrimaryEndpointKey')]"
},
{
"name": "SecondaryEndpointKey",
"value": "[concat(variables('webAppName'), '-SecondaryEndpointKey')]"
},
{
"name": "DefaultAnswer",
"value": "No good match found in KB."
},
{
"name": "QNAMAKER_EXTENSION_VERSION",
"value": "latest"
}
]
}
}
},
{
"name": "[variables('qnaMakerAccount')]",
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2017-04-18",
"location": "West US",
"sku": {
"name": "F0"
},
"kind": "QnAMaker",
"properties": {
"apiProperties": {
"qnaRuntimeEndpoint": "[concat('https://', variables('webAppName'), '.azurewebsites.net')]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServiceName'))]",
"[resourceId('Microsoft.Web/sites', variables('webAppName'))]",
"[resourceId('Microsoft.Search/searchServices', variables('searchServiceName'))]"
]
}
],
"outputs": {
"QnAMakerRestApiEndpoint": {
"value": "[reference(variables('qnaMakerAccount')).endpoint]",
"type": "string"
},
"QnAMakerRestApiSubscriptionKey": {
"value": "[listKeys(variables('qnaMakerAccount'), '2017-04-18').key1]",
"type": "string"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment