The azure-native:deviceregistry:Asset resource, part of the Pulumi Azure Native provider, defines an industrial asset registration: its connection profile, data collection structure through datasets and events, and identifying metadata. This guide focuses on three capabilities: asset registration with datasets and events, OPC UA data point configuration, and linking to discovered assets.
Assets depend on an asset endpoint profile that defines how to connect to the physical device, and they deploy to an Azure Arc custom location. The examples are intentionally small. Combine them with your own endpoint profiles, custom locations, and asset discovery workflows.
Define an asset with datasets, events, and discovered asset references
Industrial IoT deployments often register physical assets discovered through automated scanning, organizing their telemetry into datasets and events.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const asset = new azure_native.deviceregistry.Asset("asset", {
assetEndpointProfileRef: "myAssetEndpointProfile",
assetName: "my-asset",
datasets: [{
dataPoints: [
{
dataPointConfiguration: "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}",
dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1",
name: "dataPoint1",
observabilityMode: azure_native.deviceregistry.DataPointObservabilityMode.Counter,
},
{
dataPointConfiguration: "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}",
dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2",
name: "dataPoint2",
observabilityMode: azure_native.deviceregistry.DataPointObservabilityMode.None,
},
],
datasetConfiguration: "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
name: "dataset1",
topic: {
path: "/path/dataset1",
retain: azure_native.deviceregistry.TopicRetainType.Keep,
},
}],
defaultDatasetsConfiguration: "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
defaultEventsConfiguration: "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
defaultTopic: {
path: "/path/defaultTopic",
retain: azure_native.deviceregistry.TopicRetainType.Keep,
},
description: "This is a sample Asset",
discoveredAssetRefs: [
"discoveredAsset1",
"discoveredAsset2",
],
displayName: "AssetDisplayName",
documentationUri: "https://www.example.com/manual",
enabled: true,
events: [
{
eventConfiguration: "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}",
eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3",
name: "event1",
observabilityMode: azure_native.deviceregistry.EventObservabilityMode.None,
topic: {
path: "/path/event1",
retain: azure_native.deviceregistry.TopicRetainType.Keep,
},
},
{
eventConfiguration: "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}",
eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4",
name: "event2",
observabilityMode: azure_native.deviceregistry.EventObservabilityMode.Log,
},
],
extendedLocation: {
name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1",
type: "CustomLocation",
},
externalAssetId: "8ZBA6LRHU0A458969",
hardwareRevision: "1.0",
location: "West Europe",
manufacturer: "Contoso",
manufacturerUri: "https://www.contoso.com/manufacturerUri",
model: "ContosoModel",
productCode: "SA34VDG",
resourceGroupName: "myResourceGroup",
serialNumber: "64-103816-519918-8",
softwareRevision: "2.0",
tags: {
site: "building-1",
},
});
import pulumi
import pulumi_azure_native as azure_native
asset = azure_native.deviceregistry.Asset("asset",
asset_endpoint_profile_ref="myAssetEndpointProfile",
asset_name="my-asset",
datasets=[{
"data_points": [
{
"data_point_configuration": "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}",
"data_source": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1",
"name": "dataPoint1",
"observability_mode": azure_native.deviceregistry.DataPointObservabilityMode.COUNTER,
},
{
"data_point_configuration": "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}",
"data_source": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2",
"name": "dataPoint2",
"observability_mode": azure_native.deviceregistry.DataPointObservabilityMode.NONE,
},
],
"dataset_configuration": "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
"name": "dataset1",
"topic": {
"path": "/path/dataset1",
"retain": azure_native.deviceregistry.TopicRetainType.KEEP,
},
}],
default_datasets_configuration="{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
default_events_configuration="{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
default_topic={
"path": "/path/defaultTopic",
"retain": azure_native.deviceregistry.TopicRetainType.KEEP,
},
description="This is a sample Asset",
discovered_asset_refs=[
"discoveredAsset1",
"discoveredAsset2",
],
display_name="AssetDisplayName",
documentation_uri="https://www.example.com/manual",
enabled=True,
events=[
{
"event_configuration": "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}",
"event_notifier": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3",
"name": "event1",
"observability_mode": azure_native.deviceregistry.EventObservabilityMode.NONE,
"topic": {
"path": "/path/event1",
"retain": azure_native.deviceregistry.TopicRetainType.KEEP,
},
},
{
"event_configuration": "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}",
"event_notifier": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4",
"name": "event2",
"observability_mode": azure_native.deviceregistry.EventObservabilityMode.LOG,
},
],
extended_location={
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1",
"type": "CustomLocation",
},
external_asset_id="8ZBA6LRHU0A458969",
hardware_revision="1.0",
location="West Europe",
manufacturer="Contoso",
manufacturer_uri="https://www.contoso.com/manufacturerUri",
model="ContosoModel",
product_code="SA34VDG",
resource_group_name="myResourceGroup",
serial_number="64-103816-519918-8",
software_revision="2.0",
tags={
"site": "building-1",
})
package main
import (
deviceregistry "github.com/pulumi/pulumi-azure-native-sdk/deviceregistry/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := deviceregistry.NewAsset(ctx, "asset", &deviceregistry.AssetArgs{
AssetEndpointProfileRef: pulumi.String("myAssetEndpointProfile"),
AssetName: pulumi.String("my-asset"),
Datasets: deviceregistry.DatasetArray{
&deviceregistry.DatasetArgs{
DataPoints: deviceregistry.DataPointArray{
&deviceregistry.DataPointArgs{
DataPointConfiguration: pulumi.String("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
DataSource: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
Name: pulumi.String("dataPoint1"),
ObservabilityMode: pulumi.String(deviceregistry.DataPointObservabilityModeCounter),
},
&deviceregistry.DataPointArgs{
DataPointConfiguration: pulumi.String("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
DataSource: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
Name: pulumi.String("dataPoint2"),
ObservabilityMode: pulumi.String(deviceregistry.DataPointObservabilityModeNone),
},
},
DatasetConfiguration: pulumi.String("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
Name: pulumi.String("dataset1"),
Topic: &deviceregistry.TopicArgs{
Path: pulumi.String("/path/dataset1"),
Retain: pulumi.String(deviceregistry.TopicRetainTypeKeep),
},
},
},
DefaultDatasetsConfiguration: pulumi.String("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
DefaultEventsConfiguration: pulumi.String("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
DefaultTopic: &deviceregistry.TopicArgs{
Path: pulumi.String("/path/defaultTopic"),
Retain: pulumi.String(deviceregistry.TopicRetainTypeKeep),
},
Description: pulumi.String("This is a sample Asset"),
DiscoveredAssetRefs: pulumi.StringArray{
pulumi.String("discoveredAsset1"),
pulumi.String("discoveredAsset2"),
},
DisplayName: pulumi.String("AssetDisplayName"),
DocumentationUri: pulumi.String("https://www.example.com/manual"),
Enabled: pulumi.Bool(true),
Events: deviceregistry.EventArray{
&deviceregistry.EventArgs{
EventConfiguration: pulumi.String("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
EventNotifier: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
Name: pulumi.String("event1"),
ObservabilityMode: pulumi.String(deviceregistry.EventObservabilityModeNone),
Topic: &deviceregistry.TopicArgs{
Path: pulumi.String("/path/event1"),
Retain: pulumi.String(deviceregistry.TopicRetainTypeKeep),
},
},
&deviceregistry.EventArgs{
EventConfiguration: pulumi.String("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
EventNotifier: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
Name: pulumi.String("event2"),
ObservabilityMode: pulumi.String(deviceregistry.EventObservabilityModeLog),
},
},
ExtendedLocation: &deviceregistry.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
Type: pulumi.String("CustomLocation"),
},
ExternalAssetId: pulumi.String("8ZBA6LRHU0A458969"),
HardwareRevision: pulumi.String("1.0"),
Location: pulumi.String("West Europe"),
Manufacturer: pulumi.String("Contoso"),
ManufacturerUri: pulumi.String("https://www.contoso.com/manufacturerUri"),
Model: pulumi.String("ContosoModel"),
ProductCode: pulumi.String("SA34VDG"),
ResourceGroupName: pulumi.String("myResourceGroup"),
SerialNumber: pulumi.String("64-103816-519918-8"),
SoftwareRevision: pulumi.String("2.0"),
Tags: pulumi.StringMap{
"site": pulumi.String("building-1"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var asset = new AzureNative.DeviceRegistry.Asset("asset", new()
{
AssetEndpointProfileRef = "myAssetEndpointProfile",
AssetName = "my-asset",
Datasets = new[]
{
new AzureNative.DeviceRegistry.Inputs.DatasetArgs
{
DataPoints = new[]
{
new AzureNative.DeviceRegistry.Inputs.DataPointArgs
{
DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}",
DataSource = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1",
Name = "dataPoint1",
ObservabilityMode = AzureNative.DeviceRegistry.DataPointObservabilityMode.Counter,
},
new AzureNative.DeviceRegistry.Inputs.DataPointArgs
{
DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}",
DataSource = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2",
Name = "dataPoint2",
ObservabilityMode = AzureNative.DeviceRegistry.DataPointObservabilityMode.None,
},
},
DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
Name = "dataset1",
Topic = new AzureNative.DeviceRegistry.Inputs.TopicArgs
{
Path = "/path/dataset1",
Retain = AzureNative.DeviceRegistry.TopicRetainType.Keep,
},
},
},
DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
DefaultTopic = new AzureNative.DeviceRegistry.Inputs.TopicArgs
{
Path = "/path/defaultTopic",
Retain = AzureNative.DeviceRegistry.TopicRetainType.Keep,
},
Description = "This is a sample Asset",
DiscoveredAssetRefs = new[]
{
"discoveredAsset1",
"discoveredAsset2",
},
DisplayName = "AssetDisplayName",
DocumentationUri = "https://www.example.com/manual",
Enabled = true,
Events = new[]
{
new AzureNative.DeviceRegistry.Inputs.EventArgs
{
EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}",
EventNotifier = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3",
Name = "event1",
ObservabilityMode = AzureNative.DeviceRegistry.EventObservabilityMode.None,
Topic = new AzureNative.DeviceRegistry.Inputs.TopicArgs
{
Path = "/path/event1",
Retain = AzureNative.DeviceRegistry.TopicRetainType.Keep,
},
},
new AzureNative.DeviceRegistry.Inputs.EventArgs
{
EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}",
EventNotifier = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4",
Name = "event2",
ObservabilityMode = AzureNative.DeviceRegistry.EventObservabilityMode.Log,
},
},
ExtendedLocation = new AzureNative.DeviceRegistry.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1",
Type = "CustomLocation",
},
ExternalAssetId = "8ZBA6LRHU0A458969",
HardwareRevision = "1.0",
Location = "West Europe",
Manufacturer = "Contoso",
ManufacturerUri = "https://www.contoso.com/manufacturerUri",
Model = "ContosoModel",
ProductCode = "SA34VDG",
ResourceGroupName = "myResourceGroup",
SerialNumber = "64-103816-519918-8",
SoftwareRevision = "2.0",
Tags =
{
{ "site", "building-1" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.deviceregistry.Asset;
import com.pulumi.azurenative.deviceregistry.AssetArgs;
import com.pulumi.azurenative.deviceregistry.inputs.DatasetArgs;
import com.pulumi.azurenative.deviceregistry.inputs.TopicArgs;
import com.pulumi.azurenative.deviceregistry.inputs.EventArgs;
import com.pulumi.azurenative.deviceregistry.inputs.ExtendedLocationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var asset = new Asset("asset", AssetArgs.builder()
.assetEndpointProfileRef("myAssetEndpointProfile")
.assetName("my-asset")
.datasets(DatasetArgs.builder()
.dataPoints(
DataPointArgs.builder()
.dataPointConfiguration("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}")
.dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1")
.name("dataPoint1")
.observabilityMode("Counter")
.build(),
DataPointArgs.builder()
.dataPointConfiguration("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}")
.dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2")
.name("dataPoint2")
.observabilityMode("None")
.build())
.datasetConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
.name("dataset1")
.topic(TopicArgs.builder()
.path("/path/dataset1")
.retain("Keep")
.build())
.build())
.defaultDatasetsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
.defaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
.defaultTopic(TopicArgs.builder()
.path("/path/defaultTopic")
.retain("Keep")
.build())
.description("This is a sample Asset")
.discoveredAssetRefs(
"discoveredAsset1",
"discoveredAsset2")
.displayName("AssetDisplayName")
.documentationUri("https://www.example.com/manual")
.enabled(true)
.events(
EventArgs.builder()
.eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}")
.eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3")
.name("event1")
.observabilityMode("None")
.topic(TopicArgs.builder()
.path("/path/event1")
.retain("Keep")
.build())
.build(),
EventArgs.builder()
.eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")
.eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4")
.name("event2")
.observabilityMode("Log")
.build())
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")
.type("CustomLocation")
.build())
.externalAssetId("8ZBA6LRHU0A458969")
.hardwareRevision("1.0")
.location("West Europe")
.manufacturer("Contoso")
.manufacturerUri("https://www.contoso.com/manufacturerUri")
.model("ContosoModel")
.productCode("SA34VDG")
.resourceGroupName("myResourceGroup")
.serialNumber("64-103816-519918-8")
.softwareRevision("2.0")
.tags(Map.of("site", "building-1"))
.build());
}
}
resources:
asset:
type: azure-native:deviceregistry:Asset
properties:
assetEndpointProfileRef: myAssetEndpointProfile
assetName: my-asset
datasets:
- dataPoints:
- dataPointConfiguration: '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}'
dataSource: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1
name: dataPoint1
observabilityMode: Counter
- dataPointConfiguration: '{"publishingInterval":4,"samplingInterval":4,"queueSize":7}'
dataSource: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2
name: dataPoint2
observabilityMode: None
datasetConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}'
name: dataset1
topic:
path: /path/dataset1
retain: Keep
defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}'
defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}'
defaultTopic:
path: /path/defaultTopic
retain: Keep
description: This is a sample Asset
discoveredAssetRefs:
- discoveredAsset1
- discoveredAsset2
displayName: AssetDisplayName
documentationUri: https://www.example.com/manual
enabled: true
events:
- eventConfiguration: '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}'
eventNotifier: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3
name: event1
observabilityMode: None
topic:
path: /path/event1
retain: Keep
- eventConfiguration: '{"publishingInterval":7,"samplingInterval":8,"queueSize":4}'
eventNotifier: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4
name: event2
observabilityMode: Log
extendedLocation:
name: /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1
type: CustomLocation
externalAssetId: 8ZBA6LRHU0A458969
hardwareRevision: '1.0'
location: West Europe
manufacturer: Contoso
manufacturerUri: https://www.contoso.com/manufacturerUri
model: ContosoModel
productCode: SA34VDG
resourceGroupName: myResourceGroup
serialNumber: 64-103816-519918-8
softwareRevision: '2.0'
tags:
site: building-1
The assetEndpointProfileRef points to a connection profile that brokers use to reach the physical device. Datasets group related data points; each dataPoint specifies a dataSource (an OPC UA node identifier like “nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1”) and a dataPointConfiguration JSON string that controls publishing intervals and queue sizes. Events work similarly, using eventNotifier to identify state-change sources. The discoveredAssetRefs array links this asset to entries from automated discovery, establishing traceability between scanned devices and registered assets.
Register an asset without an external identifier
Some assets lack manufacturer-provided identifiers. You can register them using only Azure-managed identity.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const asset = new azure_native.deviceregistry.Asset("asset", {
assetEndpointProfileRef: "myAssetEndpointProfile",
assetName: "my-asset",
datasets: [{
dataPoints: [
{
dataPointConfiguration: "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}",
dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1",
name: "dataPoint1",
observabilityMode: azure_native.deviceregistry.DataPointObservabilityMode.Counter,
},
{
dataPointConfiguration: "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}",
dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2",
name: "dataPoint2",
observabilityMode: azure_native.deviceregistry.DataPointObservabilityMode.None,
},
],
datasetConfiguration: "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
name: "dataset1",
topic: {
path: "/path/dataset1",
retain: azure_native.deviceregistry.TopicRetainType.Keep,
},
}],
defaultDatasetsConfiguration: "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
defaultEventsConfiguration: "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
defaultTopic: {
path: "/path/defaultTopic",
retain: azure_native.deviceregistry.TopicRetainType.Keep,
},
description: "This is a sample Asset",
displayName: "AssetDisplayName",
documentationUri: "https://www.example.com/manual",
enabled: true,
events: [
{
eventConfiguration: "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}",
eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3",
name: "event1",
observabilityMode: azure_native.deviceregistry.EventObservabilityMode.None,
topic: {
path: "/path/event1",
retain: azure_native.deviceregistry.TopicRetainType.Keep,
},
},
{
eventConfiguration: "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}",
eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4",
name: "event2",
observabilityMode: azure_native.deviceregistry.EventObservabilityMode.Log,
},
],
extendedLocation: {
name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1",
type: "CustomLocation",
},
hardwareRevision: "1.0",
location: "West Europe",
manufacturer: "Contoso",
manufacturerUri: "https://www.contoso.com/manufacturerUri",
model: "ContosoModel",
productCode: "SA34VDG",
resourceGroupName: "myResourceGroup",
serialNumber: "64-103816-519918-8",
softwareRevision: "2.0",
tags: {
site: "building-1",
},
});
import pulumi
import pulumi_azure_native as azure_native
asset = azure_native.deviceregistry.Asset("asset",
asset_endpoint_profile_ref="myAssetEndpointProfile",
asset_name="my-asset",
datasets=[{
"data_points": [
{
"data_point_configuration": "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}",
"data_source": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1",
"name": "dataPoint1",
"observability_mode": azure_native.deviceregistry.DataPointObservabilityMode.COUNTER,
},
{
"data_point_configuration": "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}",
"data_source": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2",
"name": "dataPoint2",
"observability_mode": azure_native.deviceregistry.DataPointObservabilityMode.NONE,
},
],
"dataset_configuration": "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
"name": "dataset1",
"topic": {
"path": "/path/dataset1",
"retain": azure_native.deviceregistry.TopicRetainType.KEEP,
},
}],
default_datasets_configuration="{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
default_events_configuration="{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
default_topic={
"path": "/path/defaultTopic",
"retain": azure_native.deviceregistry.TopicRetainType.KEEP,
},
description="This is a sample Asset",
display_name="AssetDisplayName",
documentation_uri="https://www.example.com/manual",
enabled=True,
events=[
{
"event_configuration": "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}",
"event_notifier": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3",
"name": "event1",
"observability_mode": azure_native.deviceregistry.EventObservabilityMode.NONE,
"topic": {
"path": "/path/event1",
"retain": azure_native.deviceregistry.TopicRetainType.KEEP,
},
},
{
"event_configuration": "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}",
"event_notifier": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4",
"name": "event2",
"observability_mode": azure_native.deviceregistry.EventObservabilityMode.LOG,
},
],
extended_location={
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1",
"type": "CustomLocation",
},
hardware_revision="1.0",
location="West Europe",
manufacturer="Contoso",
manufacturer_uri="https://www.contoso.com/manufacturerUri",
model="ContosoModel",
product_code="SA34VDG",
resource_group_name="myResourceGroup",
serial_number="64-103816-519918-8",
software_revision="2.0",
tags={
"site": "building-1",
})
package main
import (
deviceregistry "github.com/pulumi/pulumi-azure-native-sdk/deviceregistry/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := deviceregistry.NewAsset(ctx, "asset", &deviceregistry.AssetArgs{
AssetEndpointProfileRef: pulumi.String("myAssetEndpointProfile"),
AssetName: pulumi.String("my-asset"),
Datasets: deviceregistry.DatasetArray{
&deviceregistry.DatasetArgs{
DataPoints: deviceregistry.DataPointArray{
&deviceregistry.DataPointArgs{
DataPointConfiguration: pulumi.String("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
DataSource: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
Name: pulumi.String("dataPoint1"),
ObservabilityMode: pulumi.String(deviceregistry.DataPointObservabilityModeCounter),
},
&deviceregistry.DataPointArgs{
DataPointConfiguration: pulumi.String("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
DataSource: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
Name: pulumi.String("dataPoint2"),
ObservabilityMode: pulumi.String(deviceregistry.DataPointObservabilityModeNone),
},
},
DatasetConfiguration: pulumi.String("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
Name: pulumi.String("dataset1"),
Topic: &deviceregistry.TopicArgs{
Path: pulumi.String("/path/dataset1"),
Retain: pulumi.String(deviceregistry.TopicRetainTypeKeep),
},
},
},
DefaultDatasetsConfiguration: pulumi.String("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
DefaultEventsConfiguration: pulumi.String("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
DefaultTopic: &deviceregistry.TopicArgs{
Path: pulumi.String("/path/defaultTopic"),
Retain: pulumi.String(deviceregistry.TopicRetainTypeKeep),
},
Description: pulumi.String("This is a sample Asset"),
DisplayName: pulumi.String("AssetDisplayName"),
DocumentationUri: pulumi.String("https://www.example.com/manual"),
Enabled: pulumi.Bool(true),
Events: deviceregistry.EventArray{
&deviceregistry.EventArgs{
EventConfiguration: pulumi.String("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
EventNotifier: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
Name: pulumi.String("event1"),
ObservabilityMode: pulumi.String(deviceregistry.EventObservabilityModeNone),
Topic: &deviceregistry.TopicArgs{
Path: pulumi.String("/path/event1"),
Retain: pulumi.String(deviceregistry.TopicRetainTypeKeep),
},
},
&deviceregistry.EventArgs{
EventConfiguration: pulumi.String("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
EventNotifier: pulumi.String("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
Name: pulumi.String("event2"),
ObservabilityMode: pulumi.String(deviceregistry.EventObservabilityModeLog),
},
},
ExtendedLocation: &deviceregistry.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
Type: pulumi.String("CustomLocation"),
},
HardwareRevision: pulumi.String("1.0"),
Location: pulumi.String("West Europe"),
Manufacturer: pulumi.String("Contoso"),
ManufacturerUri: pulumi.String("https://www.contoso.com/manufacturerUri"),
Model: pulumi.String("ContosoModel"),
ProductCode: pulumi.String("SA34VDG"),
ResourceGroupName: pulumi.String("myResourceGroup"),
SerialNumber: pulumi.String("64-103816-519918-8"),
SoftwareRevision: pulumi.String("2.0"),
Tags: pulumi.StringMap{
"site": pulumi.String("building-1"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var asset = new AzureNative.DeviceRegistry.Asset("asset", new()
{
AssetEndpointProfileRef = "myAssetEndpointProfile",
AssetName = "my-asset",
Datasets = new[]
{
new AzureNative.DeviceRegistry.Inputs.DatasetArgs
{
DataPoints = new[]
{
new AzureNative.DeviceRegistry.Inputs.DataPointArgs
{
DataPointConfiguration = "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}",
DataSource = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1",
Name = "dataPoint1",
ObservabilityMode = AzureNative.DeviceRegistry.DataPointObservabilityMode.Counter,
},
new AzureNative.DeviceRegistry.Inputs.DataPointArgs
{
DataPointConfiguration = "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}",
DataSource = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2",
Name = "dataPoint2",
ObservabilityMode = AzureNative.DeviceRegistry.DataPointObservabilityMode.None,
},
},
DatasetConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
Name = "dataset1",
Topic = new AzureNative.DeviceRegistry.Inputs.TopicArgs
{
Path = "/path/dataset1",
Retain = AzureNative.DeviceRegistry.TopicRetainType.Keep,
},
},
},
DefaultDatasetsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
DefaultEventsConfiguration = "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}",
DefaultTopic = new AzureNative.DeviceRegistry.Inputs.TopicArgs
{
Path = "/path/defaultTopic",
Retain = AzureNative.DeviceRegistry.TopicRetainType.Keep,
},
Description = "This is a sample Asset",
DisplayName = "AssetDisplayName",
DocumentationUri = "https://www.example.com/manual",
Enabled = true,
Events = new[]
{
new AzureNative.DeviceRegistry.Inputs.EventArgs
{
EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}",
EventNotifier = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3",
Name = "event1",
ObservabilityMode = AzureNative.DeviceRegistry.EventObservabilityMode.None,
Topic = new AzureNative.DeviceRegistry.Inputs.TopicArgs
{
Path = "/path/event1",
Retain = AzureNative.DeviceRegistry.TopicRetainType.Keep,
},
},
new AzureNative.DeviceRegistry.Inputs.EventArgs
{
EventConfiguration = "{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}",
EventNotifier = "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4",
Name = "event2",
ObservabilityMode = AzureNative.DeviceRegistry.EventObservabilityMode.Log,
},
},
ExtendedLocation = new AzureNative.DeviceRegistry.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1",
Type = "CustomLocation",
},
HardwareRevision = "1.0",
Location = "West Europe",
Manufacturer = "Contoso",
ManufacturerUri = "https://www.contoso.com/manufacturerUri",
Model = "ContosoModel",
ProductCode = "SA34VDG",
ResourceGroupName = "myResourceGroup",
SerialNumber = "64-103816-519918-8",
SoftwareRevision = "2.0",
Tags =
{
{ "site", "building-1" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.deviceregistry.Asset;
import com.pulumi.azurenative.deviceregistry.AssetArgs;
import com.pulumi.azurenative.deviceregistry.inputs.DatasetArgs;
import com.pulumi.azurenative.deviceregistry.inputs.TopicArgs;
import com.pulumi.azurenative.deviceregistry.inputs.EventArgs;
import com.pulumi.azurenative.deviceregistry.inputs.ExtendedLocationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var asset = new Asset("asset", AssetArgs.builder()
.assetEndpointProfileRef("myAssetEndpointProfile")
.assetName("my-asset")
.datasets(DatasetArgs.builder()
.dataPoints(
DataPointArgs.builder()
.dataPointConfiguration("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}")
.dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1")
.name("dataPoint1")
.observabilityMode("Counter")
.build(),
DataPointArgs.builder()
.dataPointConfiguration("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}")
.dataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2")
.name("dataPoint2")
.observabilityMode("None")
.build())
.datasetConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
.name("dataset1")
.topic(TopicArgs.builder()
.path("/path/dataset1")
.retain("Keep")
.build())
.build())
.defaultDatasetsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
.defaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}")
.defaultTopic(TopicArgs.builder()
.path("/path/defaultTopic")
.retain("Keep")
.build())
.description("This is a sample Asset")
.displayName("AssetDisplayName")
.documentationUri("https://www.example.com/manual")
.enabled(true)
.events(
EventArgs.builder()
.eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}")
.eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3")
.name("event1")
.observabilityMode("None")
.topic(TopicArgs.builder()
.path("/path/event1")
.retain("Keep")
.build())
.build(),
EventArgs.builder()
.eventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")
.eventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4")
.name("event2")
.observabilityMode("Log")
.build())
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")
.type("CustomLocation")
.build())
.hardwareRevision("1.0")
.location("West Europe")
.manufacturer("Contoso")
.manufacturerUri("https://www.contoso.com/manufacturerUri")
.model("ContosoModel")
.productCode("SA34VDG")
.resourceGroupName("myResourceGroup")
.serialNumber("64-103816-519918-8")
.softwareRevision("2.0")
.tags(Map.of("site", "building-1"))
.build());
}
}
resources:
asset:
type: azure-native:deviceregistry:Asset
properties:
assetEndpointProfileRef: myAssetEndpointProfile
assetName: my-asset
datasets:
- dataPoints:
- dataPointConfiguration: '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}'
dataSource: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1
name: dataPoint1
observabilityMode: Counter
- dataPointConfiguration: '{"publishingInterval":4,"samplingInterval":4,"queueSize":7}'
dataSource: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2
name: dataPoint2
observabilityMode: None
datasetConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}'
name: dataset1
topic:
path: /path/dataset1
retain: Keep
defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}'
defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}'
defaultTopic:
path: /path/defaultTopic
retain: Keep
description: This is a sample Asset
displayName: AssetDisplayName
documentationUri: https://www.example.com/manual
enabled: true
events:
- eventConfiguration: '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}'
eventNotifier: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3
name: event1
observabilityMode: None
topic:
path: /path/event1
retain: Keep
- eventConfiguration: '{"publishingInterval":7,"samplingInterval":8,"queueSize":4}'
eventNotifier: nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4
name: event2
observabilityMode: Log
extendedLocation:
name: /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1
type: CustomLocation
hardwareRevision: '1.0'
location: West Europe
manufacturer: Contoso
manufacturerUri: https://www.contoso.com/manufacturerUri
model: ContosoModel
productCode: SA34VDG
resourceGroupName: myResourceGroup
serialNumber: 64-103816-519918-8
softwareRevision: '2.0'
tags:
site: building-1
This configuration omits externalAssetId and discoveredAssetRefs, relying on Azure’s uuid and name properties for identity. The structure remains the same: datasets define telemetry collection, events capture state changes, and the extendedLocation places the asset in an Arc-enabled environment. Without an external ID, you track the asset purely through Azure’s resource naming.
Beyond these examples
These snippets focus on specific asset-level features: asset registration with datasets and events, OPC UA data point configuration, and discovered asset linking. They’re intentionally minimal rather than full industrial IoT deployments.
The examples rely on pre-existing infrastructure such as asset endpoint profiles for connectivity, Azure Arc custom locations for deployment, and discovered assets for linking scenarios. They focus on configuring the asset rather than provisioning the surrounding infrastructure.
To keep things focused, common asset patterns are omitted, including:
- Attribute customization beyond defaults
- Topic retention policies (defaultTopic.retain variations)
- Observability mode tuning (Counter, Log, None, Gauge)
- Per-dataset and per-event configuration overrides
These omissions are intentional: the goal is to illustrate how each asset feature is wired, not provide drop-in industrial IoT modules. See the Asset resource reference for all available configuration options.
Let's configure Azure Device Registry Assets
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Resource Configuration
assetEndpointProfileRef, extendedLocation, location, discoveredAssetRefs, externalAssetId, assetName, and resourceGroupName. Plan these values carefully, as changes require recreating the resource.extendedLocation is a required, immutable object that specifies the custom location for the asset. Examples show it with type: "CustomLocation" and a full resource path to a custom location.enabled property to true or false to control the asset’s enabled/disabled status.Data Points & Datasets
dataPoints array. Each data point requires dataSource (OPC UA node like nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1), name, and optionally dataPointConfiguration (JSON string with publishingInterval, samplingInterval, queueSize) and observabilityMode.defaultDatasetsConfiguration as a JSON string (e.g., {"publishingInterval":10,"samplingInterval":15,"queueSize":20}) to apply defaults to all datasets. Individual datasets can override these with their own datasetConfiguration.topic object with path and retain (e.g., Keep) properties. You can also set a defaultTopic that applies to all datasets and events.Events & Observability
Counter and None modes. Events support None and Log modes.events array. Each event requires eventNotifier (OPC UA node), name, and optionally eventConfiguration (JSON string), observabilityMode, and topic. Use defaultEventsConfiguration for defaults that apply to all events.Asset Identity & Discovery
discoveredAssetRefs references assets from the discovery flow (immutable array of discovered asset names), while externalAssetId is a customer-provided identifier (immutable string). Use one or the other based on whether the asset comes from discovery or manual creation.displayName is optional. One example shows asset creation without it, using only assetName.pulumi package add azure-native deviceregistry [ApiVersion].Using a different cloud?
Explore integration guides for other cloud providers: