2. Deploying Azure Resources - great-lakes/lean-iot GitHub Wiki
Deploying Azure Resources
Prerequisites
The following are required to complete this lab:
- An MXChip IoT DevKit
- A computer
- An available WiFi connection or mobile hotspot. Note that the WiFi connection can (and should) be secure, but it must be ungated (i.e. no intermediate login page is required. Gated WiFi is common in public venues and hotels).
Exercises
This lab includes the following exercises:
- Exercise 1: Provision an Azure IoT Hub
- Exercise 2: Provision an Azure Storage Account
- Exercise 3: Provision an Azure Function
Estimated time to complete this lab: 15 minutes.
Exercise 1: Provision an Azure IoT Hub
Azure IoT Hubs enable IoT devices to connect securely to the cloud and transmit messages (events) that can be sent to other sources such as mobile apps, websites and etc.
In this exercise, you will provision an Azure IoT Hub for your MXChip to transmit events to.
-
Open the Azure Portal in your browser. If asked to log in, do so using your Microsoft account.
-
Click + New, followed by Internet of Things and IoT Hub.
Provisioning a new IoT Hub
-
Enter 'Flysim' and then your initals for IoT Hub in the Name field. IoT Hub names must be unique across Azure, so make sure a green check mark appears next to it. Also make sure S1 - Standard is selected as the pricing tier. Select New under Resource group and enter the resource-group name "FlySim" (i.e. flysimgac). Select East US as the Location (important!). Accept the default values everywhere else, and then click Create.
You selected East US as the location because in Lab 3, the instructor will create Azure resources in that same region for the IoT Hub to connect to. Azure resources can be connected across regions, but keeping everything within the same data center reduces cost and minimizes latency.
Configuring an IoT Hub
-
Click Resource groups in the ribbon on the left side of the portal, and then click FlySim to open the resource group.
Opening the resource group
-
Wait until "Deploying" changes to "Succeeded," indicating that the IoT Hub has been provisioned. You can click the Refresh button at the top of the blade to refresh the deployment status.
Exercise 2: Provision an Azure storage account
Before you deploy an Azure Function, you need to create a repository for the Function's code, logs, and history. In this exercise, you will create an Azure storage account for that purpose.
-
Return to the Azure Portal. Click + New, followed by Storage and Storage account.
Creating a new storage account
-
Enter 'Flysim' and then your initals for the storage account and make sure a green check mark appears next to it. Select Use existing under Resource group and select the "FlySim" resource group you created in exercise 1. Choose East US as the Location, and then click the Create button, and everything else as default.
Creating a new storage account
Now that the storage account has been created, it's time to create an Azure Function to transform accelerometer data that will reach the IoT Hub you created in Exercise 1
Exercise 3: Provision an Azure Function
Before you deploy an Azure Function, you need to create a repository for the Function's code, logs, and history. In this exercise, you will create an Azure storage account for that purpose.
-
Return to the Azure Portal. Click + New, followed by Compute and Function App.
Creating a new azure function
-
Enter 'Flysim' and then your initals for the azure function and make sure a green check mark appears next to it. Select Use existing under Resource group and select the "FlySim" resource group you created in exercise 1. Choose East US as the Location. Select Use existing under Storage and select the "FlySim(YOUR_INITIALS)" storage account you made in exercise 2. and then click the Create button.
configure new azure function
Summary
In this lab, you created an Azure IoT Hub, Azure Storage Account and Azure Function. Next we will deploy code to your Azure function and to your MXChip!
Next Steps: Writing your Azure Function
Now that your resources are created, Let's add some code to your Azure Function!