This folder contains the code necessary to setup an Azure Function for pumping WAD data from Event Hubs to Elastic Search.
- Sign in to the Azure management portal.
- Click "New" on the left side menu and on the Marketplace blade, select "Web + Mobile".
- On the "Web + Mobile" blade, search for Function App.
- Click "Create" on the Function App blade.
- Fill in the required fields and click "Create".
- Wait until the deployment is completed, open the Function App just created.
- On the Function App blade, click "New Function". Choose the "EventHubTrigger - C#" template.
- Name the function and fill in the Event Hub connection string. Note: when pasting the Event Hubs connection string, please do not include the EntityPath parameter or you'll get an error message after the Function App is created. More information on Get started with Event Hubs.
- On the Function app blade, click "Function app Settings", then click "Go to App Service Settings".
- On the Settings blade, click General - Application settings, and add the following settings: es_uri, es_username, es_password, es_index_name_prefix (optional).
- Paste the code from run.csx into the Code section on the Function app blade and click Save.
- In a new browser window, navigate to <function name>.scm.azurewebsites.net (in this case, the function name is eh2es-demo).
- In the Kudu UI, select Debug console -> CMD; and navigate to home\site\wwwroot\demofunction.
- Drag and drop the project.json file into the file list.
- The demo function should be up and running.
es_uri
Sets the target Elastic Search endpoint.
es_username
Sets the username for accessing the ES endpoint.
es_password
Sets the password for accessing the ES endpoint.
es_index_name_prefix
Optional Sets the ES index name prefix. The index name will be generated based on current date, in the follow format <prefix>-YYYY.MM.DD; for example demoname-2016.05.19.
run.csx
This is the C# script file containing the Azure Function code.
project.json
Containing the NuGet package references required by the Azure Function code.