This sample is a React template for Azure Cognitive Search. It leverages Azure Functions as the backend to communicate with Azure Cognitive Search and QnA Maker.
To run the sample locally, follow the steps below.
- Node.js and Git
- Visual Studio and Function tools for Visual Studio
- Visual Studio Code
-
Clone (or Fork and Clone) this repository
-
Open the Azure Function project
CustomSkillForDataIngestion\CustomSkillForDataIngestion.sln
in Visual Studio -
Add a
local.settings.json
file to the project
The local.settings.json
file holds all of the keys that the application needs and should include the following json:
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName={StorageAcountName};AccountKey={StorageAccountKey};",
"StorageAccountName": "",
"StorageAccountKey": "",
"SearchServiceApiKey": "",
"SearchServiceName": "",
"QnAMakerEndpoint": "",
},
"Host": {
"CORS": "*"
}
}
- Run the Azure functon project in visual studio
-
Install front-end dependencies...
npm install
-
Run the front-end project in the browser (automatically opens a browser window).
npm start
The react project will pull the URL for the Azure functions from the .env
file. If you'd like to run the front-end locally with the deployed Azure Functions, update the credentials in the .env
file.