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:
After you select first entry, go to Create and complete the form:
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.:
Go back to All Resources -> "Web app created"
and copy the FTP/Deployment username
and FTP hostname
.
Connect to FTP Host
using File Explorer from Windows or any other FTP Client. e.g. filezilla. You should see something like that:
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:
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!
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
- Clone the repository from here.
- Edit
config.php
with information saved from database. (DATABASE NAME, HOSTNAME, USERNAME, PASSWORD
) - [Optional] Edit
serverUploadKey
andServerSignature
- Connect to FTP (see final step from Deploy web App service)
- Go to
site/wwwroot
- Copy all 4 files from git (
config.php, download.php, mydb.sql, upload.php
) towwwroot
directory.
Once you done that, your directory should look like that:
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”