Edit

Share via


Configure the connector for REST/HTTP (preview)

In Azure IoT Operations, the connector for REST/HTTP (preview) enables access to data from REST endpoints exposed by HTTP services.

An asset in Azure IoT Operations is a logical entity that you create to represent a physical asset or device. An Azure IoT Operations asset can have custom properties, data points, streams, and events that describe its behavior and characteristics. An asset is associated with one or more devices. Azure IoT Operations stores asset definitions in the Azure Device Registry.

A device in Azure IoT Operations is a logical entity that defines the connections to physical assets or devices. Without a device, data can't flow from a physical device or asset to the MQTT broker. When you configure a device and asset, a connection is established to the physical asset or device and data point values, events, and streams arrive in Azure IoT Operations instance. A device has one or more inbound endpoints. Azure IoT Operations stores device definitions in the Azure Device Registry.

This article explains how to use the connector for REST/HTTP to perform tasks such as:

  • Define the devices that connect HTTP sources to your Azure IoT Operations instance.
  • Add assets, and define the data points to enable the data flow from the HTTP source to the MQTT broker or broker state store.

Prerequisites

To configure devices and assets, you need a running preview instance of Azure IoT Operations.

To sign in to the operations experience web UI, you need a Microsoft Entra ID account with at least contributor permissions for the resource group that contains your Kubernetes - Azure Arc instance. You can't sign in with a Microsoft account (MSA). To create a suitable Microsoft Entra ID account in your Azure tenant:

  1. Sign in to the Azure portal with the same tenant and user name that you used to deploy Azure IoT Operations.
  2. In the Azure portal, go to the Microsoft Entra ID section, select Users > +New user > Create new user. Create a new user and make a note of the password, you need it to sign in later.
  3. In the Azure portal, go to the resource group that contains your Kubernetes - Azure Arc instance. On the Access control (IAM) page, select +Add > Add role assignment.
  4. On the Add role assignment page, select Privileged administrator roles. Then select Contributor and then select Next.
  5. On the Members page, add your new user to the role.
  6. Select Review and assign to complete setting up the new user.

You can now use the new user account to sign in to the operations experience web UI.

Your IT administrator must have configured the connector for REST/HTTP template for your Azure IoT Operations instance in the Azure portal.

You need any credentials required to access the HTTP source. If the HTTP source requires authentication, you need to create a Kubernetes secret that contains the username and password for the HTTP source.

Deploy the connector for REST/HTTP

When you deploy the preview version of Azure IoT Operations, the deployment includes the three preview connectors. You can verify that you have a preview instance of Azure IoT Operations by checking in the Azure portal that preview features are enabled for your instance:

Screenshot of Azure portal that shows that preview features are enabled.

Before you can use the preview connectors (ONVIF, media, and REST/HTTP) in the operations experience web UI, an administrator must add connector template instances to your Azure IoT Operations instance.

All three preview connectors can publish captured data to the MQTT broker.

To add a connector template instance to your Azure IoT Operations instance:

  1. In the Azure portal, go to your Azure IoT Operations instance, select Connector templates, and then select Add connector template instances:

    Screenshot of Azure portal that shows how to add a connector template instance.

  2. On the first page of the Add an Akri connector template wizard, select the type of connector template you want to add, such as ONVIF, Media, or HTTP REST. Then select Metadata.

    Screenshot of Azure portal that shows how to select the connector template instance type.

  3. On the Metadata page, accept the defaults, and then select Device inbound endpoint type.

  4. On the Device inbound endpoint type page, accept the defaults, and then select Diagnostics configurations.

  5. On the Diagnostics configurations page, accept the defaults, and then select Runtime configuration.

  6. On the Runtime configuration page, accept the defaults, and then select Review:

  7. On the Review page, review the details of the connector template instance, and then select Create to create the connector template instance.

An OT user can now use the operations experience web UI to create a device with a preview connector endpoint.


Create a device

To configure the connector for REST/HTTP, first create a device that defines the connection to the HTTP source. The device includes the URL of the HTTP source and any credentials you need to access the HTTP source:

  1. In the operations experience web UI, select Devices in the left navigation pane. Then select Create new.

  2. Enter a name for your device, such as http-connector. To add the endpoint for the connector for REST/HTTP, select New on the Microsoft.Http tile.

  3. Add the details of the endpoint for the connector for REST/HTTP including any authentication credentials:

    Screenshot that shows how to add a connector for REST/HTTP endpoint.

    Select Apply to save the endpoint.

  4. On the Device details page, select Next to continue.

  5. On the Add custom property page, you can add any other properties you want to associate with the device. For example, you might add a property to indicate the manufacturer of the camera. Then select Next to continue

  6. On the Summary page, review the details of the device and select Create to create the asset.

  7. After the device is created, you can view it in the Devices list:

    Screenshot that shows the list of devices.

Create a namespace asset

To define a namespace asset that publishes data points from the HTTP endpoint, follow these steps:

  1. In the operations experience web UI, select Assets in the left navigation pane. Then select Create namespace asset.

  2. Select the inbound endpoint for the connector for REST/HTTP that you created in the previous section.

  3. Enter a name for your asset, such as my-http-source.

  4. Add any custom properties you want to associate with the asset. For example, you might add a property to indicate the manufacturer of the camera. Select Next to continue.

  5. On the Data points page, select Add data point to add a data point for the asset. For example:

    Screenshot that shows how to add a data point for HTTP source.

    Add details for each data point to publish to the MQTT broker.

  6. To configure the destination for the data, select Manage default dataset. Choose either MQTT broker or Broker state store as the destination. If you choose MQTT broker, you can enter the name of the topic to publish to. If you choose Broker state store, you can enter the key of the entry in the state store to use.

    Screenshot that shows how to configure the dataset for HTTP source.

    Select Next to continue.

  7. On the Review page, review the details of the asset and select Create to create the asset. After a few minutes, the asset is listed on the Assets page:

    Screenshot that shows the list of assets.