Deploying IoT Dispatcher in the Cloud with Microsoft Azure

If you dont have an account for azure portal, you ca make it from here.

Initial setup

At this step we will deploy two services in Microsoft Azure: Web App service and Mysql Database.

Once you have an account and logged in go to azure portal

Deploy Web App service

From marketplace search for “Web App”. Select first entry, as picture bellow:

first1

After you select first entry, go to Create and complete the form:

first2

Now you have to wait a while to end up the deploy. Once ended, from same portal go to All Resources -> " Web app created " -> Settings -> Set deployment credentials and set the username and password for FTP login. e.g.:

first3

Go back to All Resources -> "Web app created" and  copy the FTP/Deployment username and FTP hostname.

first4

Connect to FTP Host using File Explorer from Windows or any other FTP Client. e.g. filezilla. You should see something like that:

first5

Once you see this, Web App is successful deployed.

Deploy Mysql Database
From marketplace you can search for “Mysql”. The service we need is MySQL Databse from ClearDB Publisher, as picture bellow:

second1

Complete the form with Databse Name , select a group in Resource group and accept Legal Terms. Make sure you select Mercury(Free Plan) as Pricing Tier!

second2

Now you have to wait a while to end up the deploy. Once deployed, from All resources -> "Database Deployed previously" -> Properties, save the following information:

  • DATABSE NAME
  • HOSTNAME
  • USERNAME
  • PASSWORD

We will need it for IOT dispatcher configuration file (config.php).

Configuring the IOT dispatcher

  1. Clone the repository from here.
  2. Edit config.php with information saved from database. ( DATABASE NAME, HOSTNAME, USERNAME,  PASSWORD)
  3. [Optional] Edit serverUploadKeyand ServerSignature
  4. Connect to FTP (see final step from Deploy web App service)
  5. Go to site/wwwroot
  6. Copy all 4 files from git (config.php, download.php, mydb.sql, upload.php) to wwwroot directory.

Once you done that, your directory should look like that: 
final

 

Now IOT Dispatcher is up and ready to use. You can access it from "Web App URL"/download.php or "Web App URL"/upload.php. e.g. : “http://example1webapp.azurewebsites.net/download.php” or “http://example1webapp.azurewebsites.net/upload.php”