Skip to content

Commit 7d72dc7

Browse files
authored
AIO 2507: Update quickstart bicep (#137)
## Purpose Update the quickstart bicep file to use devices instead of asset endpoints ## Does this introduce a breaking change? <!-- Mark one with an "x". --> ``` [ ] Yes [x] No ``` ## Pull Request Type What kind of change does this Pull Request introduce? <!-- Please check the one that applies to this PR using "x". --> ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [x] Documentation content changes [ ] Other... Please describe: ```
1 parent becc548 commit 7d72dc7

File tree

1 file changed

+40
-19
lines changed

1 file changed

+40
-19
lines changed

samples/quickstarts/quickstart.bicep

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ param clusterName string
88
param customLocationName string
99
param aioExtensionName string
1010
param aioInstanceName string
11+
param aioNamespaceName string
1112
param resourceSuffix string = substring(uniqueString(subscription().id, resourceGroup().id, clusterName), 0, 10)
1213
param eventHubName string = 'aio-eh-${resourceSuffix}'
1314
param defaultDataflowEndpointName string = 'default'
@@ -44,49 +45,71 @@ resource defaultDataflowProfile 'Microsoft.IoTOperations/instances/dataflowProfi
4445
parent: aioInstance
4546
}
4647

48+
resource namespace 'Microsoft.DeviceRegistry/namespaces@2025-07-01-preview' existing = {
49+
name: aioNamespaceName
50+
}
51+
4752
/*****************************************************************************/
4853
/* Asset */
4954
/*****************************************************************************/
5055

5156
var assetName = 'oven'
57+
var opcUaEndpointName = 'opc-ua-connector-0'
5258

53-
resource assetEndpoint 'Microsoft.DeviceRegistry/assetEndpointProfiles@2024-11-01' = {
54-
name: 'opc-ua-connector-0'
59+
resource device 'Microsoft.DeviceRegistry/namespaces/devices@2025-07-01-preview' = {
60+
name: 'opc-ua-connector'
61+
parent: namespace
5562
location: resourceGroup().location
5663
extendedLocation: {
5764
type: 'CustomLocation'
5865
name: customLocation.id
5966
}
6067
properties: {
61-
targetAddress: 'opc.tcp://opcplc-000000:50000'
62-
endpointProfileType: 'Microsoft.OpcUa'
63-
authentication: {
64-
method: 'Anonymous'
68+
endpoints: {
69+
outbound: {
70+
assigned: {}
71+
}
72+
inbound: {
73+
opcUaEndpointName: {
74+
endpointType: 'Microsoft.OpcUa'
75+
address: 'opc.tcp://opcplc-000000:50000'
76+
version: '1.0'
77+
authentication: {
78+
method: 'Anonymous'
79+
}
80+
}
81+
}
6582
}
6683
}
6784
}
6885

69-
resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
86+
resource asset 'Microsoft.DeviceRegistry/namespaces/assets@2025-07-01-preview' = {
7087
name: assetName
88+
parent: namespace
7189
location: resourceGroup().location
7290
extendedLocation: {
7391
type: 'CustomLocation'
7492
name: customLocation.id
7593
}
7694
properties: {
7795
displayName: assetName
78-
assetEndpointProfileRef: assetEndpoint.name
96+
deviceRef: {
97+
deviceName: device.name
98+
endpointName: opcUaEndpointName
99+
}
79100
description: 'Multi-function large oven for baked goods.'
80101

81102
enabled: true
82-
manufacturer: 'Contoso'
83-
manufacturerUri: 'http://www.contoso.com/ovens'
84-
model: 'Oven-003'
85-
productCode: '12345C'
86-
hardwareRevision: '2.3'
87-
softwareRevision: '14.1'
88-
serialNumber: '12345'
89-
documentationUri: 'http://docs.contoso.com/ovens'
103+
attributes: {
104+
manufacturer: 'Contoso'
105+
manufacturerUri: 'http://www.contoso.com/ovens'
106+
model: 'Oven-003'
107+
productCode: '12345C'
108+
hardwareRevision: '2.3'
109+
softwareRevision: '14.1'
110+
serialNumber: '12345'
111+
documentationUri: 'http://docs.contoso.com/ovens'
112+
}
90113

91114
datasets: [
92115
{
@@ -96,25 +119,23 @@ resource asset 'Microsoft.DeviceRegistry/assets@2024-11-01' = {
96119
name: 'Temperature'
97120
dataSource: 'ns=3;s=SpikeData'
98121
dataPointConfiguration: '{"samplingInterval":500,"queueSize":1}'
99-
observabilityMode: 'None'
100122
}
101123
{
102124
name: 'EnergyUse'
103125
dataSource: 'ns=3;s=FastUInt10'
104126
dataPointConfiguration: '{"samplingInterval":500,"queueSize":1}'
105-
observabilityMode: 'None'
106127
}
107128
{
108129
name: 'Weight'
109130
dataSource: 'ns=3;s=FastUInt9'
110131
dataPointConfiguration: '{"samplingInterval":500,"queueSize":1}'
111-
observabilityMode: 'None'
112132
}
113133
]
114134
}
115135
]
116136

117137
defaultDatasetsConfiguration: '{"publishingInterval":1000,"samplingInterval":500,"queueSize":1}'
138+
defaultEventsConfiguration: '{"publishingInterval":1000,"samplingInterval":500,"queueSize":1}'
118139
}
119140
}
120141

0 commit comments

Comments
 (0)