The Connect The Dots implementation requires a number of Azure resources and services that need to be created prior to adding devices to the infrastructure, as various configuration parameters for the devices will be depend upon the specific Azure resources created. While these resources can be created manually, in this project we have provided a script that automates this process, described below. It assumes you have all the necessary software and subscriptions and that you cloned or downloaded the ConnectTheDots.io project on your machine.
Make sure you have all software installed and necessary subscriptions as indicated in the Readme.md file for the project. To repeat them here, you need
- Microsoft Azure subscription (free trial subscription is sufficient)
- Visual Studio 2013 – Community Edition
###Create Event Hubs###
-
Open the ConnectTheDots\Azure\AzurePrep\AzurePrep.sln solution in Visual Studio and build the project from the BUILD menu (Select Release, not Debug).
-
Run the application (hitting F5 in Visual Studio or double clicking on the connectthedots\Azure\AzurePrep\AzurePrep\bin\Release\azureprep.exe file)
-
Login to Azure and if you have several subscriptions, select the one you want to deploy your services on from the choice provided in the next prompt.
-
Enter the namespace prefix you would like for your Service Bus namespace for the Event Hubs
-
Choose the location of the datacenter you would like the Service Bus Service to run on
-
Note the device connection strings displayed by the tool, as you will need them to provision the devices later. The AzurePrep utility creates a file with this output on your desktop for easy retrieval.
Service Bus management connection string (i.e. for use in Service Bus Explorer): Endpoint=sb://ctdtest1-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=zzzzzzz Device AMQP address strings (for Raspberry Pi/devices): amqps://D1:[email protected] amqps://D2:[email protected] amqps://D3:[email protected] amqps://D4:[email protected]
The AzurePrep.exe command created two Event Hubs, EHDevices and EHAlerts or a single EHDevices one depending on your choice during the execution. It also created four endpoints for AMQP connections from your remote devices such as Raspberry Pi devices. If you deleted or can't find the file AzurePrep created on your desktop, you can retrieve the endpoint strings by
- launching http://manage.windowsazure.com
- selecting Service Bus in the left nav menu
- picking your Namespace
- select Event Hubs from the top menu
- select ehdevices
- select Connection Information tab at the bottom
Finally, and depending on your choice during the execution the tool created the Azure Stream Analytics jobs that will compute average and trigger alerts on your data.
###Create Website config info###
- Run the application ConnecttheDots\Azure\AzurePrep\CreateWebConfig\bin\Release\CreateWebConfig.exe
- Login using your Azure subscription credentials
- Select the namespace prefix and location you chose when creating the Event Hubs
- The application has now created a web.config file and put it on your desktop. You need to copy that file over the existing web.config file in the ConnectTheDotsWebSite folder of the Website project before you publish your site.