You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-operations/develop-edge-apps/quickstart-get-started-sdks.md
+71-19Lines changed: 71 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,22 +266,6 @@ After Azure IoT Operations is deployed, you need to configure it for development
266
266
1. Create the trust bundle ConfigMap for the Broker to authentication x509 clients
267
267
1. Configure a `BrokerListener` and `BrokerAuthentication` resources for SAT and x509 auth
268
268
269
-
## Shell configuration
270
-
271
-
The samples within [Azure IoT Operations SDKs github repository](https://github.com/Azure/iot-operations-sdks) read configuration from environment variables. We have provided an `.env` file in the repository root that exports the variables used by the samples to connect to the MQTT Broker. Edit the `.env` file to set the values foryour environment, or use the default values providedin the file:
272
-
273
-
1. Navigate to the repository root directory:
274
-
275
-
```bash
276
-
cd<REPOSITORY ROOT>
277
-
```
278
-
279
-
1. Load the environment variables into your shell:
280
-
281
-
```bash
282
-
source .env
283
-
```
284
-
285
269
<!-- TODO: Check why this only works with VSCode Dev Containers when I do: kubectl port-forward -n azure-iot-operations service/aio-broker-external 8883:8883 -->
286
270
## Testing the installation
287
271
@@ -311,11 +295,79 @@ To test the setup is working correctly, use `mosquitto_pub` to connect to the MQ
This sample demonstrates a simple communication between a client and a server using [telemetry](https://github.com/Azure/iot-operations-sdks/blob/main/doc/reference/telemetry.md) and [remote procedure call (RPC)](https://github.com/Azure/iot-operations-sdks/blob/main/doc/reference/rpc-protocol.md). The server tracks the value of a counter and accepts RPC requests from the client to either read or increment that counter.
301
+
302
+
1. Install the [.NET 9.0 SDK](https://dotnet.microsoft.com/download/dotnet/9.0)
303
+
304
+
1. The samples within [Azure IoT Operations SDKs github repository](https://github.com/Azure/iot-operations-sdks) read configuration from environment variables. We have provided an `.env` file in the repository root that exports the variables used by the samples to connect to the MQTT Broker. Edit the `.env` file to set the values foryour environment, or use the default values providedin the file.
305
+
306
+
1. Navigate to the `CounterServer` sample directory:
source`git rev-parse --show-toplevel`/.env;export AIO_MQTT_CLIENT_ID=counter-client;export COUNTER_SERVER_ID=counter-server; dotnet run
340
+
```
341
+
342
+
1. You should see the client and server communicating, with the client sending requests to read and increment the counter value. This is an example of the output you might see:
343
+
344
+
```output
345
+
info: CounterClient.CounterClient[0]
346
+
Telemetry received from counter-server: CounterValue=1
347
+
info: CounterClient.CounterClient[0]
348
+
Telemetry received from counter-server: CounterValue=2
349
+
info: CounterClient.CounterClient[0]
350
+
Telemetry received from counter-server: CounterValue=3
351
+
...
352
+
```
353
+
354
+
<!-- ## Shell configuration
355
+
356
+
The samples within [Azure IoT Operations SDKs github repository](https://github.com/Azure/iot-operations-sdks) read configuration from environment variables. We have provided an `.env` file in the repository root that exports the variables used by the samples to connect to the MQTT Broker. Edit the `.env` file to set the values foryour environment, or use the default values providedin the file:
357
+
358
+
1. Navigate to the repository root directory:
315
359
316
-
This sample demonstrates connecting to MQTT broker using the MQTT session client, and sending and receiving telemetry.
360
+
```bash
361
+
cd<REPOSITORY ROOT>
362
+
```
363
+
364
+
1. Load the environment variables into your shell:
0 commit comments