Streaming to Azure IoT

Set up streaming to Azure IoT

Creating a Cloud Connector from ThingSpace directly to an Azure IoT Central Application

Prerequisites:

  • A Verizon BillingAccount with CAS devices previously onboarded into it
  • Ability to create the access (user token) and the session (VZ M2M token) to execute the ThingSpace API
  • API reference documentation: https://thingspace.verizon.com/resources/documentation/cloudconnector/API_Reference/ 
  • Perform the Query Subscription and Query Target API calls to make sure that there are no existing subscriptions and/or targets associated with the Verizon BillingAccountId
  • Delete any previously created subscription on the Verizon BillingAccount
  • Delete any previously created targets on the Verizon BillingAccount

 

NOTE: The documentation available at the link above does not contain the API calls required to create a ‘Target’ to stream to IoT Central. Creating a ‘Target’ to stream to IoT Central is covered below.

  • Azure IoT Central Application to which the ThingSpace Cloud Connector will stream including the following from that IoT Central Application:
    • HTTPS URL of the IoT Central Application streaming endpoint (retrieve this MS Azure URL)
    • Shared Access Signature of the IoT Central Application (retrieve this MS Azure SharedAccessSignature)

 

Note: Every Azure IOT central APP has a Shared Access Signature. Navigate to Administration -> API tokens -> Generate token -> select admin role -> Generate. Copy the token and save it.

Create a target to define the Endpoint and a Subscription

Create a target resource to define where to send device data. 

A REST Azure IoT target requires these values:

  • addressscheme must be “streamazureiot”.

  • address is your Azure IoT Central application ready to receive streamed device data.

  • authorization is the Shared Secret API token from your Azure IoT central application.

     

Create a subscription using the targetid from the “Create a Target” response:

  • billingaccountid is your ThingSpace billing account
  • streamkind must be ts.event to receive all device data
  • targetid must be the UUID for the target, which was in the response when the target was created.
  • name: to be used to query for resources later.

 

The cloud connector from the ThingSpace (Verizon BillingAccountId) to the IoT Central Application has now been configured

The cloud connector populates the device templates that were specified by the target creation request in the IoT Central Application. Subsequently, data from CAS devices that are in the Verizon BillingAccount will start streaming telemetry data into the IoT Central application. 

Note: it may take some time for the cloud connector to get fully setup and start streaming data into the IoT Central Application. Also the sleep mode of the CAS device will determine how often the device wakes up and sends data into the IoT Central app