Skip to content

Commit 298baf2

Browse files
Merge pull request #303779 from dominicbetts/aio-device-topic
AIO: Add MQTT topic details
2 parents d58dd59 + da09abd commit 298baf2

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

articles/iot-operations/discover-manage-assets/howto-configure-opc-ua.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,14 @@ Now you can define the tags associated with the asset. To add OPC UA tags:
173173
| ns=3;s=FastUInt10 | Temperature |
174174
| ns=3;s=FastUInt100 | Humidity |
175175
176-
1. Select **Manage default settings** to configure default settings for messages from the asset. These settings apply to all the OPC UA tags that belong to the asset. You can override these settings for each tag that you add. Default settings include:
176+
1. To configure default settings for messages from the asset, select **Manage default settings**. These settings apply to all the OPC UA tags that belong to the asset. You can override these settings for each tag that you add. Default settings include:
177177
178178
- **Sampling interval (milliseconds)**: The sampling interval indicates the fastest rate at which the OPC UA server should sample its underlying source for data changes.
179179
- **Publishing interval (milliseconds)**: The rate at which OPC UA server should publish data.
180180
- **Queue size**: The depth of the queue to hold the sampling data before publishing it.
181181
182+
1. To configure the MQTT topic to publish the tag data to, select **Manage default dataset**. Enter an MQTT topic name such as `azure-iot-operations/data/thermostat`, then select **Update**.
183+
182184
1. On the **Tags** page, select **Next** to go to the **Add events** page.
183185
184186
# [Azure CLI](#tab/cli)
@@ -187,16 +189,16 @@ Use the following commands to add a "thermostat" namespace asset to your device
187189
188190
```azurecli
189191
# Create the asset
190-
az iot ops ns asset opcua create --name thermostat --instance {your instance name} -g {your resource group name} --device opc-ua-connector --endpoint-name opc-ua-connector-0 --description 'A simulated thermostat asset'
192+
az iot ops ns asset opcua create --name thermostat --instance {your instance name} -g {your resource group name} --device opc-ua-connector --endpoint opc-ua-connector-0 --description 'A simulated thermostat asset'
191193
192194
# Add the dataset
193-
az iot ops ns asset opcua dataset add --asset thermostat --instance {your instance name} -g {your resource group name} --name default --data-source "ns=3;s=FastUInt10"
195+
az iot ops ns asset opcua dataset add --asset thermostat --instance {your instance name} -g {your resource group name} --name default --data-source "ns=3;s=FastUInt10" --dest topic="azure-iot-operations/data/thermostat" retain=Keep qos=Qos1 ttl=3600
194196
195197
# Add the datapoints
196198
az iot ops ns asset opcua dataset point add --asset thermostat --instance {your instance name} -g {your resource group name} --dataset default --name temperature --data-source "ns=3;s=FastUInt10"
197199
az iot ops ns asset opcua dataset point add --asset thermostat --instance {your instance name} -g {your resource group name} --dataset default --name humidity --data-source "ns=3;s=FastUInt100"
198200
199-
# Show the datapoints
201+
# Show the dataset and datapoints
200202
az iot ops ns asset opcua dataset show --asset thermostat -n default -g {your resource group name} --instance {your instance name}
201203
```
202204

articles/iot-operations/end-to-end-tutorials/tutorial-add-assets.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ To create an asset, select **Create namespace asset**. Then enter the following
198198
| Inbound endpoint | `opc-ua-connector-0` |
199199
| Asset name | `thermostat` |
200200
| Description | `A simulated thermostat asset` |
201-
| Default MQTT topic | `azure-iot-operations/data/thermostat` |
202201

203202
Remove the existing **Custom properties** and add the following custom properties. Be careful to use the exact property names, as the Power BI template in a later tutorial queries for them:
204203

@@ -216,18 +215,20 @@ Select **Next** to go to the **Add tags** page.
216215

217216
### Create OPC UA tags
218217

219-
Add an OPC UA tag on the **Add tags** page. To add a tag, select **Add tag**. Enter the tag details shown in the following table:
218+
Add an OPC UA tag on the **Tags** page. To add a tag, select **Add tag**. Enter the tag details shown in the following table:
220219

221-
| Node ID | Tag name |
220+
| Data source | Tag name |
222221
| ------------------ | ----------- |
223222
| ns=3;s=SpikeData | temperature |
224223

225-
The node ID here is specific to the OPC UA simulator. The node generates random values within a specified range and also has intermittent spikes.
224+
The data source value here is a specific OPC UA simulator node. The node generates random values within a specified range and also has intermittent spikes.
226225

227226
You can select **Manage default settings** to change the default sampling interval and queue size for each tag.
228227

229228
:::image type="content" source="media/tutorial-add-assets/add-tag.png" lightbox="media/tutorial-add-assets/add-tag.png" alt-text="Screenshot of Azure IoT Operations add tag page.":::
230229

230+
To configure the MQTT topic to publish the tag data to, select **Manage default dataset**. Enter `azure-iot-operations/data/thermostat` as the MQTT topic, then select **Update**. This topic is used by the data flow in the next tutorial to send messages to the cloud.
231+
231232
Select **Next** to go to the **Add events** page and then **Next** to go to the **Review** page.
232233

233234
### Review
@@ -236,10 +237,10 @@ Review your asset and tag details and make any adjustments you need before you s
236237

237238
:::image type="content" source="media/tutorial-add-assets/review-asset.png" lightbox="media/tutorial-add-assets/review-asset.png" alt-text="Screenshot of Azure IoT Operations create asset review page.":::
238239

239-
This configuration deploys a new asset called `thermostat` to the cluster. You can view your assets in your resource group in the Azure portal. You can also use `kubectl` to view the assets locally in your cluster:
240+
This configuration deploys a new asset called `thermostat` to the cluster. You can also use `kubectl` to view the assets locally in your cluster:
240241

241242
```console
242-
kubectl get assets -n azure-iot-operations
243+
kubectl get assets.namespace -n azure-iot-operations
243244
```
244245

245246
## View resources in the Azure portal
@@ -256,7 +257,7 @@ The portal enables you to view the asset details. Select **JSON View** for more
256257

257258
[!INCLUDE [deploy-mqttui](../includes/deploy-mqttui.md)]
258259

259-
To verify that the thermostat asset you added is publishing data, view the messages in the `azure-iot-operations/data` topic:
260+
To verify that the thermostat asset you added is publishing data, view the messages in the `azure-iot-operations/data/thermostat` topic:
260261

261262
```output
262263
Client $server-generated/0000aaaa-11bb-cccc-dd22-eeeeee333333 received PUBLISH (d0, q0, r0, m0, 'azure-iot-operations/data/thermostat', ... (92 bytes))

0 commit comments

Comments
 (0)