Azure

This article describes how to connect EdgeX-API to Azure by auto-provisioning in Delhi EdgeX Foundry's runtime environment in Windows 10.

Content

  • Automatic setup Microsoft Azure and EdgeX

  • Verify EdgeX Message

Automatic setup Microsoft EdgeX

  • Install Microsoft Azure CLI. (If there is not any) Reopen command prompt after the first installation on Windows.

  • Create the Azure IoT hub account. (If there is not any)

  • Generate the device certificate.

  • Create a registration script of EdgeX.(Windows: export_to_azure_delhi.bat Linux: export_to_azure_delhi.sh)

1.In the EdgeX folder, go to tools\azure and modify script with custom Azure configuration.(Windows: create_azure_iothub_edgex_delhi.bat; Linux: create_azure_iothub_edgex_delhi.sh)

2.Run the script (Windows: create_azure_iothub_edgex_delhi.bat; Linux: create_azure_iothub_edgex_delhi.sh)

3.Please follow the instruction to open the URL in the browser, enter code, and sign-in Microsoft with your account to complete the installation

Verify EdgeX Message

1.In the Azure portal, verify that the event hub has received the EdgeX messages. Select Overview > IoT Hub Usage. Refresh the page to update the chart. It might take a few seconds for it to show that the messages have been received.

2.You also can receive events from a JavaScript application that we made.

  • Open any editor, we choose Visual Studio Code here.

  • Open the application by selecting File > Open Directory in the editor.

  • Edit IotHubConnectionString and EventHubConsumerGroup in launch.json You can find the ConnectionString in create_azure_iothub_edgex_delhi.bat complete installed screen

3.In VS Code, press F5 to start debugging.

4.Open a browser to http://localhost:3000. It will display EdgeX device data in a chart.

Last updated