Edit

Share via


Configure the connector for OPC UA

OPC UA servers are software applications that communicate with assets. OPC UA servers expose OPC UA data points that represent data points. OPC UA data points provide real-time or historical data about the status, performance, quality, or condition of assets.

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 describes how to use the operations experience web UI and the Azure CLI to:

  • Define the devices that connect OPC UA servers to your Azure IoT Operations instance.
  • Add assets, and define their data points and events to enable data flow from OPC UA servers to the MQTT broker.

These assets, data points, and events map inbound data from OPC UA servers to friendly names that you can use in the MQTT broker and data flows.

The connector can use anonymous or username password user authentication when it connects to an OPC UA server.

Note

This user authentication is separate from the certificate-based application authentication that's used to establish a secure channel between the connector for OPC UA and the OPC UA server. To learn more, see Understand the OPC UA certificates infrastructure.

Prerequisites

To configure devices and assets, you need an 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). For more information, see Troubleshoot access to the operations experience web UI.

Your IT administrator must configure the OPC UA connector template for your Azure IoT Operations instance in the Azure portal.

An OPC UA server that you can reach from your Azure IoT Operations cluster. If you don't have an OPC UA server, use the OPC PLC simulator from the Azure IoT Operations samples repository.

Configure a certificate trust list for the connector

To manage the trusted certificates list the connector uses to secure connections to external endpoints, see Manage certificates for external communications.

Create a device

An Azure IoT Operations deployment can include a sample OPC PLC simulator. To create a device that uses the OPC PLC simulator:

  1. Select devices and then Create device:

    Screenshot that shows the devices page in the operations experience.

    Tip

    Use the filter box to search for devices.

  2. On the Basics page, enter a device name and select New on the Microsoft.OpcUa tile to add an endpoint for the device:

    Screenshot that shows how to create a device in the operations experience.

  3. Enter your endpoint information. For example, to use the OPC PLC simulator, enter the following values:

    Field Value
    Name opc-ua-connector-0
    Connector for OPC UA URL opc.tcp://opcplc-000000:50000
    User authentication Anonymous
  4. Select Next. On the Additional Info page enter any custom properties for the device.

  5. Select Next to review your device details. Then select Create.

This configuration deploys a new device resource called opc-ua-connector-bicep to the cluster with an inbound endpoint called opc-ua-connector-0.

When the OPC PLC simulator is running, data flows from the simulator, to the connector for OPC UA, and then to the MQTT broker.

Configure a device to use a username and password

The previous example uses the Anonymous authentication mode. This mode doesn't require a username or password.

To use the UsernamePassword authentication mode, complete the following steps:

Follow the steps in Manage secrets for your Azure IoT Operations deployment to add secrets for username and password in Azure Key Vault, project them into Kubernetes cluster, and reference them from your device configuration.

Other security options

When you create the inbound endpoint, you can also select:

Option Type Description
Auto accept untrusted server certificate Yes/No Automatically accept untrusted server certificates
Security policy Dropdown Security policy used to establish secure channel with the OPC UA server
Security mode Dropdown Security mode used to communicate within secure channel with the OPC UA server

Add an asset, dataset, and data points

To add an asset in the operations experience, follow these steps:

  1. Select the Assets tab. Before you create any assets, you see the following screen:

    Screenshot that shows an empty Assets tab in the operations experience.

    Tip

    Use the filter box to search for assets.

  2. Select Create asset.

  3. On the asset details screen, enter the following asset information:

    • Inbound endpoint. Select your device inbound endpoint from the list.
    • Asset name
    • Description
  4. Configure the set of custom properties that you want to associate with the asset. You can accept the default list of properties or add your own. The following properties are available by default:

    • Manufacturer
    • Manufacturer URI
    • Model
    • Product code
    • Hardware version
    • Software version
    • Serial number
    • Documentation URI

    Screenshot that shows how to add asset details in the operations experience.

  5. Select Next to go to the Datasets page.

Add a dataset to an asset

A dataset defines where the connector sends the data it collects from a collection of data points. An OPC UA asset can have multiple datasets. To create a dataset:

  1. Select Create dataset.

  2. Enter the details for the dataset such as its name and destination. For OPC UA assets, the destination is an MQTT topic. For example:

    Screenshot that shows how to create a dataset in the operations experience.

    Use the Start instance field to specify the starting node for resolving relative browse paths for data points in the dataset. For more information, see Resolve nodes dynamically using browse paths.

  3. Select Create and next to create the dataset.

Tip

Use the Manage default settings option to configure default dataset settings such as publishing interval, sampling interval, and queue size.

Add individual data points to a dataset

Important

The data point name _ErrorMessage is reserved and shouldn't be used.

Now you can define the data points associated with the dataset. To add OPC UA data points:

  1. Select Add data point.

  2. Enter your data point details:

    • Data source. This value is the node ID from the OPC UA server.
    • Data point name (Optional). This value is the friendly name that you want to use for the data point. If you don't specify a data point name, the node ID is used as the data point name.
    • Sampling interval (milliseconds). You can override the default value for this data point.
    • Queue size. You can override the default value for this data point.

    Screenshot that shows adding data points in the operations experience.

    The following table shows some example data point values that you can use with the built-in OPC PLC simulator:

    Data source Data point name
    ns=3;s=FastUInt10 Temperature
    ns=3;s=FastUInt100 Humidity

    Note

    If you're using relative browse paths to resolve dynamic nodes, the Data source field contains a relative browse path. For more information, see Resolve nodes dynamically using browse paths.

  3. On the data points page, select Next to go to the Add events page.

Add events and event groups

Add an event group to an asset

An event group defines where the connector sends the data it receives from a collection of events. An OPC UA asset can have multiple event groups. To create an event group:

  1. Select Create event group.

  2. Enter a name for the event group and any other required details:

    Screenshot that shows how to create an event group in the operations experience.

  3. Select Create and next to create the event group and go to the List of events for alerts page.

Add events to an event group

Now you can define the events associated with the event group. To add OPC UA events:

  1. Select Add event.

  2. Enter your event details:

    • Data source. This value is the event notifier from the OPC UA server.
    • Event name (Optional). This value is the friendly name that you want to use for the event. If you don't specify an event name, the event notifier is used as the event name.
    • Topic. The MQTT topic that you want the event to be published to.
    • Sampling interval (milliseconds). You can override the default value for this data point.
    • Queue size. You can override the default value for this data point.
    • Start instance. This value is the starting node for resolving relative browse paths for this event. This field is required if you use relative browse paths in the Data source field. For more information, see Resolve nodes dynamically using browse paths.
    • Event filter. An optional configuration that defines the event filter for this event. For more information, see the Event filters section.

    Screenshot that shows adding events in the operations experience.

  3. Select Manage default settings to configure default event settings for the asset. These settings apply to all the OPC UA events that belong to the asset. You can override these settings for each event that you add. Default event settings include:

    • Publishing interval (milliseconds): The rate at which OPC UA server should publish data.
    • Queue size: The depth of the queue to hold the sampling data before publishing it.

Event filters

Define event filters to customize the information included in event notifications from the server. By default, the server sends a selection of standard fields in event notifications. The server determines the exact selection for each event type. For example:

{
    "EventId":"OkaXYhfr20yUoj1QBbzcIg==",
    "EventType":"i=2130",
    "SourceNode":"i=2253",
    "SourceName":"WestTank",
    "Time":"2025-10-10T15:09:13.3946878Z",
    "ReceiveTime":"2025-10-10T15:09:13.3946881Z",
    "Message":"Raising Events",
    "Severity":500
}

Use an event filter to:

  • Include extra fields in event notifications.
  • Exclude fields from event notifications.
  • Modify field names in event notifications.

The following screenshot shows an example event filter:

A screenshot that shows how to configure an event filter for an OPC UA asset.

The complete event filter shown previously defines four output fields:

Browse path Type definition ID Field ID
EventId ns=0;i=2041 myEventId
EventType ns=0;i=2041 blank
SourceName blank mySourceName
Severity blank blank

The three properties for a filter row are:

  • Browse path. Required value that identifies the source field to include in the forwarded event notification.
  • Type definition ID. Optional value that specifies the OPC UA type definition of the source field.
  • Field ID. Optional value that specifies the name to use for the field in the forwarded event notification. If you don't specify a field ID, the original field name is used.

The resulting message forwarded by the connector now looks like the following example:

{
    "myEventId":"OkaXYhfr20yUoj1QBbzcIg==",
    "EventType":"i=2130",
    "mySourceName":"WestTank",
    "Severity":500
}

Review your changes

Review your asset and OPC UA data point and event details. Make any adjustments you need:

A screenshot that shows how to review your asset, data points, and events in the operations experience.

Add management groups and actions

A management group is a logical grouping of actions that you can invoke against an OPC UA asset, such as writing a value to a tag or calling a method. Actions must belong to a management group.

To create a management group and define actions for it, see Control OPC UA servers. That article explains the different types of actions (simple writes, complex writes, and method calls) and the MQTT topics you use to invoke them.

Update an asset

Find and select the asset you created previously. Use the Asset details, data points, and Events tabs to make any changes:

A screenshot that shows how to update an existing asset in the operations experience.

On the view data points tab for a dataset, you can add data points, update existing data points, or remove data points.

To update a data point, select an existing data point and update the data point information. Then select Update:

A screenshot that shows how to update an existing data point in the operations experience.

To remove data points, select one or more data points and then select Remove data points:

A screenshot that shows how to delete a data point in the operations experience.

You can also add, update, and delete events and properties in the same way.

When you're finished making changes, select Save to save your changes.

Delete an asset

To delete an asset, select the asset you want to delete. On the Asset details page, select Delete. Confirm your changes to delete the asset:

A screenshot that shows how to delete an asset from the operations experience.