Skip to content

Commit eb5aae7

Browse files
committed
acrolinx edits
Signed-off-by: Ryan Winter <[email protected]>
1 parent 26c4ddf commit eb5aae7

File tree

4 files changed

+32
-35
lines changed

4 files changed

+32
-35
lines changed

articles/iot-operations/create-edge-apps/howto-deploy-dapr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Azure IoT Operations supports two of these building blocks, powered by [MQTT bro
2020
- Publish and subscribe
2121
- State management
2222

23-
To use the Dapr pluggable components, define the component spec for each of the APIs and then [register this to the cluster](https://docs.dapr.io/operations/components/pluggable-components-registration/). The Dapr components listen to a Unix domain socket placed on the shared volume. The Dapr runtime connects with each socket and discovers all services from a given building block API that the component implements.
23+
To use the Dapr pluggable components, define the component spec for each of the APIs and then [register with the cluster](https://docs.dapr.io/operations/components/pluggable-components-registration/). The Dapr components listen to a Unix domain socket placed on the shared volume. The Dapr runtime connects with each socket and discovers all services from a given building block API that the component implements.
2424

2525
## Install Dapr runtime
2626

@@ -47,7 +47,7 @@ To create the yaml file, use the following component definitions:
4747
> | `metadata:name` | The component name is important and is how a Dapr application references the component. |
4848
> | `metadata:annotations:dapr.io/component-container` | Component annotations used by Dapr sidecar injector, defining the image location, volume mounts and logging configuration |
4949
> | `spec:type` | [The type of the component](https://docs.dapr.io/operations/components/pluggable-components-registration/#define-the-component), which needs to be declared exactly as shown |
50-
> | `spec:metadata:keyPrefix` | Defines the key prefix used when communicating to the statestore backend. See the [Dapr documentation](https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-share-state) for more information |
50+
> | `spec:metadata:keyPrefix` | Defines the key prefix used when communicating to the statestore backend. See more information, see [Dapr documentation](https://docs.dapr.io/developing-applications/building-blocks/state-management/howto-share-state) for more information |
5151
> | `spec:metadata:hostname` | The MQTT broker hostname. Default is `aio-mq-dmqtt-frontend` |
5252
> | `spec:metadata:tcpPort` | The MQTT broker port number. Default is `8883` |
5353
> | `spec:metadata:useTls` | Define if TLS is used by the MQTT broker. Default is `true` |
@@ -167,4 +167,4 @@ To configure authorization policies to MQTT broker, first you create a [BrokerAu
167167

168168
## Next steps
169169

170-
Now that you have deployed the Dapr components, you can [Use Dapr to develop distributed applications](howto-develop-dapr-apps.md).
170+
Now that the Dapr components are deployed to the cluster, you can [Use Dapr to develop distributed applications](howto-develop-dapr-apps.md).

articles/iot-operations/create-edge-apps/howto-develop-dapr-apps.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The first step is to write an application that uses a Dapr SDK to publish/subscr
3636

3737
After you finish writing the Dapr application, build the container:
3838

39-
1. To package the application into a container, run the following command:
39+
1. Package the application into a container with the following command:
4040

4141
```bash
4242
docker build . -t my-dapr-app
@@ -50,9 +50,9 @@ After you finish writing the Dapr application, build the container:
5050

5151
## Deploy a Dapr application
5252

53-
The following [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) definition contains volumes for SAT authentication and TLS certificate chain, as well as utilizing Dapr sidecar injection to automatically add the pluggable components to the Pod.
53+
The following [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) definition contains volumes for SAT authentication and TLS certificate chain, and utilizes Dapr sidecar injection to automatically add the pluggable components to the Pod.
5454

55-
The following definition components will typically require customization to your specific application:
55+
The following definition components might require customization to your specific application:
5656

5757
> | Component | Description |
5858
> |-|-|
@@ -126,7 +126,7 @@ The following definition components will typically require customization to your
126126
kubectl get pods -w
127127
```
128128

129-
The pod should report 3 containers running after a short interval, as shown in the following example output:
129+
The pod should report three containers running after a short interval, as shown in the following example output:
130130

131131
```output
132132
NAME READY STATUS RESTARTS AGE
@@ -136,7 +136,7 @@ The following definition components will typically require customization to your
136136

137137
## Troubleshooting
138138

139-
If the application doesn't start or you see the containers in `CrashLoopBackoff`, the logs for the `daprd` container often contains useful information.
139+
If the application doesn't start or you see the containers in `CrashLoopBackoff` state, the log for the `daprd` container often contains useful information.
140140
141141
Run the following command to view the logs for the daprd component:
142142

articles/iot-operations/create-edge-apps/howto-develop-mqttnet-apps.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,49 @@ ms.date: 07/02/2024
1616

1717
[!INCLUDE [public-preview-note](../includes/public-preview-note.md)]
1818

19-
[MQTTnet](https://dotnet.github.io/MQTTnet/) is an open-source, high performance .NET library for MQTT based communication. This article uses a Kubernetes service account token and MQTTnet to connect to MQTT broker. You should use service account tokens to connect to in-cluster clients.
19+
[MQTTnet](https://dotnet.github.io/MQTTnet/) is an open-source, high performance .NET library for MQTT based communication. This article uses a Kubernetes service account token and MQTTnet to connect to MQTT broker. You should use service account tokens to connect in-cluster applications.
2020

2121
## Sample code
2222

2323
The [sample code](https://github.com/Azure-Samples/explore-iot-operations/tree/main/samples/mqtt-client-dotnet/Program.cs) performs the following steps:
2424

25-
1. Creates an MQTT client using the `MQTTFactory` class:
25+
1. Creates an MQTT client using the `MqttFactory` class:
2626

2727
```csharp
2828
var mqttFactory = new MqttFactory();
2929
var mqttClient = mqttFactory.CreateMqttClient();
3030
```
3131

32-
1. The following Kubernetes pod specification mounts the service account token to the specified path on the container file system. The mounted token is used as the password with well-known username `K8S-SAT`:
32+
1. The [Kubernetes pod specification](#pod-specification) mounts the service account on the container file system. The contents of the file are read:
33+
##3. The mounted token is used as the password with well-known username `K8S-SAT`:
3334

3435
```csharp
35-
string token_path = "/var/run/secrets/tokens/mqtt-client-token";
36+
static string token_path = "/var/run/secrets/tokens/mqtt-client-token";
3637
...
3738

38-
static async Task<int> MainAsync()
39-
{
40-
...
41-
42-
// Read SAT Token
43-
var satToken = File.ReadAllText(token_path);
39+
// Read SAT Token
40+
var satToken = File.ReadAllText(token_path);
4441
```
4542

46-
1. All options for the MQTT client are bundled in the class named `MqttClientOptions`. It's possible to fill options manually in code via the properties but you should use the `MqttClientOptionsBuilder` as advised in the [client](https://github.com/dotnet/MQTTnet/wiki/Client) documentation. The following code shows how to use the builder with the following options:
43+
1. The MQTT client options are configured using the `MqttClientOptions` class. Using the `MqttClientOptionsBuilder` as advised in the [client](https://github.com/dotnet/MQTTnet/wiki/Client) documentation is the advised way of setting the options:
4744
4845
```csharp
49-
# Create TCP based options using the builder amd connect to broker
46+
// Create TCP based options using the builder amd connect to broker
5047
var mqttClientOptions = new MqttClientOptionsBuilder()
5148
.WithTcpServer(broker, 1883)
52-
.WithProtocolVersion(MqttProtocolVersion.V500)
53-
.WithClientId("sampleid")
54-
.WithCredentials("K8S-SAT", satToken)
49+
.WithProtocolVersion(MqttProtocolVersion.V311)
50+
.WithClientId("mqtt-client-dotnet")
51+
.WithCredentials("K8S-SAT", satToken);
5552
.Build();
5653
```
5754

58-
1. After setting up the MQTT client options, a connection can be established. The following code shows how to connect with a server. You can replace the *CancellationToken.None* with a valid *CancellationToken*, if needed.
55+
5. After setting up the MQTT client options, a connection can be established. The following code shows how to connect with a server. You can replace the *CancellationToken.None* with a valid *CancellationToken*, if needed.
5956

6057
```csharp
6158
var response = await mqttClient.ConnectAsync(mqttClientOptions, CancellationToken.None);
6259
```
6360

64-
1. MQTT messages can be created using the properties directly or via using `MqttApplicationMessageBuilder`. This class has some useful overloads that allow dealing with different payload formats. The API of the builder is a fluent API. The following code shows how to compose an application message and publish them to a topic called *sampletopic*:
61+
6. MQTT messages can be created using the properties directly or via using `MqttApplicationMessageBuilder`. This class has some useful overloads that allow dealing with different payload formats. The API of the builder is a fluent API. The following code shows how to compose an application message and publish them to an article called *sampletopic*:
6562

6663
```csharp
6764
var applicationMessage = new MqttApplicationMessageBuilder()
@@ -126,5 +123,5 @@ To run the sample, follow the instructions in its [README](https://github.com/Az
126123

127124
## Related content
128125

129-
- [MQTT broker overview](../manage-mqtt-broker/overview-iot-mq.md)
130-
- [Develop with MQTT broker](edge-apps-overview.md)
126+
- [Publish and subscribe MQTT messages using MQTT broker](../manage-mqtt-broker/overview-iot-mq.md)
127+
- [Develop highly available distributed applications](edge-apps-overview.md)

articles/iot-operations/create-edge-apps/tutorial-event-driven-with-dapr.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ In this walkthrough, you deploy a Dapr application to the cluster. The Dapr appl
1919
The Dapr application performs the following steps:
2020

2121
1. Subscribes to the `sensor/data` topic for sensor data.
22-
1. When data is receiving on the topic, it's forwarded to the MQTT broker state store.
23-
1. Every **10 seconds**, it fetches the data from the state store and calculates the *min*, *max*, *mean*, *median*, and *75th percentile* values on any sensor data timestamped in the last **30 seconds**.
24-
1. Data older than **30 seconds** is expired from the state store.
25-
1. The result is published to the `sensor/window_data` topic in JSON format.
22+
1. When data is receiving on the topic, it's published to the MQTT broker state store.
23+
2. Every **10 seconds**, it fetches the data from the state store and calculates the *min*, *max*, *mean*, *median*, and *75th percentile* values on any sensor data timestamped in the last **30 seconds**.
24+
3. Data older than **30 seconds** is expired from the state store.
25+
4. The result is published to the `sensor/window_data` topic in JSON format.
2626

2727
> [!NOTE]
2828
> This tutorial [disables Dapr CloudEvents](https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-raw/) which enables it to publish and subscribe using raw MQTT.
@@ -120,7 +120,7 @@ To start, create a yaml file that uses the following definitions:
120120

121121
Simulate test data by deploying a Kubernetes workload. It simulates a sensor by sending sample temperature, vibration, and pressure readings periodically to the MQTT broker using an MQTT client on the `sensor/data` topic.
122122

123-
1. Deploy the simulator from the Explore IoT Operations repository:
123+
1. Deploy the simulator from the *Explore IoT Operations* repository:
124124

125125
```bash
126126
kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/main/tutorials/mq-event-driven-dapr/simulate-data.yaml
@@ -205,7 +205,7 @@ To verify the MQTT bridge is working, deploy an MQTT client to the cluster.
205205

206206
## Verify the Dapr application output
207207

208-
1. Open a shell to the mosquitto client pod:
208+
1. Open a shell to the Mosquitto client pod:
209209

210210
```bash
211211
kubectl exec --stdin --tty mqtt-client -n azure-iot-operations -- sh
@@ -252,7 +252,7 @@ To verify the MQTT bridge is working, deploy an MQTT client to the cluster.
252252

253253
## Optional - Create the Dapr application
254254

255-
The above tutorial uses a prebuilt container of the Dapr application. If you would like to modify and build the code yourself, follow these steps:
255+
ThIs tutorial uses a prebuilt container of the Dapr application. If you would like to modify and build the code yourself, follow these steps:
256256

257257
### Prerequisites
258258

@@ -290,7 +290,7 @@ The above tutorial uses a prebuilt container of the Dapr application. If you wou
290290

291291
## Troubleshooting
292292

293-
If the application doesn't start or you see the containers in `CrashLoopBackoff`, the logs for the `daprd` container often contains useful information.
293+
If the application doesn't start or you see the containers in `CrashLoopBackoff`, the `daprd` container log often contains useful information.
294294

295295
Run the following command to view the logs for the daprd component:
296296

0 commit comments

Comments
 (0)