Skip to content

Commit e827251

Browse files
committed
Docs scrub
1 parent 1af16ef commit e827251

File tree

6 files changed

+41
-67
lines changed

6 files changed

+41
-67
lines changed

articles/iot-operations/connect-to-cloud/overview-dataflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: patricka
66
ms.service: azure-iot-operations
77
ms.subservice: azure-data-flows
88
ms.topic: conceptual
9-
ms.date: 10/22/2024
9+
ms.date: 11/11/2024
1010

1111
#CustomerIntent: As an operator, I want to understand how I can use dataflows to connect data sources.
1212
---
@@ -62,7 +62,7 @@ By using dataflows, you can efficiently manage your data paths. You can ensure t
6262

6363
Schema registry, a feature provided by Azure Device Registry, is a synchronized repository in the cloud and at the edge. The schema registry stores the definitions of messages coming from edge assets, and then exposes an API to access those schemas at the edge. Southbound connectors like the OPC UA connector can create message schemas and add them to the schema registry or customers can upload schemas to the operations experience web UI.
6464

65-
Dataflows uses messages schemas at both the source and destination points. For sources, message schemas can work as filters to identify the specific messages that you want to capture for a dataflow. For destinations, message schemas help to transform the message into the format expected by the destination endpoint.
65+
Dataflows uses messages schemas to transform the message into the format expected by the destination endpoint.
6666

6767
For more information, see [Understand message schemas](./concept-schema-registry.md).
6868

articles/iot-operations/manage-mqtt-broker/howto-broker-mqtt-client-options.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: patricka
66
ms.topic: how-to
77
ms.service: azure-iot-operations
88
ms.subservice: azure-mqtt-broker
9-
ms.date: 11/04/2024
9+
ms.date: 11/11/2024
1010

1111
#CustomerIntent: As an operator, I want to configure MQTT broker so that I can control MQTT client interactions.
1212
---
@@ -62,22 +62,27 @@ The subscriber queue limit has two settings:
6262

6363
- **Strategy**: The strategy to use when the queue is full. The two strategies are:
6464

65-
<!-- TODO: check for accuracy -->
66-
- **None**: Messages aren't dropped [unless they expire](#message-expiry), and the queue can grow indefinitely. This is the default behavior.
65+
- **None**: Messages aren't dropped [unless the session expires](#session-expiry), and the queue can grow indefinitely. This is the default behavior.
6766

6867
- **DropOldest**: The oldest message in the queue is dropped.
6968

7069
The limit only applies to the subscriber's outgoing queue, which holds messages that haven't been assigned packet IDs because the in-flight queue is full. This limit doesn't apply to the in-flight queue.
7170

72-
Since the limit is applied per [backend chain](./howto-configure-availability-scale.md#backend-chain), the broker can't guarantee the total number of outgoing messages for a subscriber across the entire cluster. For example, setting the length to 10,000 doesn't mean the subscriber will receive at most 10,000 messages. Instead, it could receive up to `10,000 * number of chains * number of backend workers` messages.
71+
Since the limit is applied per [backend partition](./howto-configure-availability-scale.md#backend-chain), the broker can't guarantee the total number of outgoing messages for a subscriber across the entire cluster. For example, setting the length to 10,000 doesn't mean the subscriber will receive at most 10,000 messages. Instead, it could receive up to `10,000 * number of partitions * number of backend workers` messages.
7372

7473
### Slow subscribers
7574

7675
A slow subscriber is one that can't keep up with the incoming message rate. This can occur if the subscriber processes messages slowly, is disconnected, or is offline. The subscriber queue limit helps prevent a slow subscriber from consuming too much memory.
7776

7877
### Message expiry
7978

80-
The subscriber queue limit works with the `maxSessionExpirySeconds` setting to ensure messages aren't kept in the queue indefinitely. If a message stays in the queue longer than the maximum expiry time, it's dropped. This helps prevent slow subscribers from using too much memory.
79+
The `maxMessageExpirySeconds` setting controls how long a message can stay in the queue before it expires. If a message stays in the queue longer than the maximum expiry time, it is marked as expired. However, expired messages are only discarded when they reach the beginning of the queue. This passive expiry mechanism helps manage memory usage by ensuring that old messages are eventually removed.
80+
81+
### Session expiry
82+
83+
The `maxSessionExpirySeconds` setting works with the subscriber queue limit to ensure that messages aren't kept in the queue indefinitely. If a session expires, all messages in the queue for that session are dropped. This helps prevent slow subscribers from using too much memory by eventually clearing the entire queue.
84+
85+
Both message expiry and session expiry are important for managing slow subscribers and ensuring efficient memory usage.
8186

8287
## Next steps
8388

articles/iot-operations/manage-mqtt-broker/howto-configure-authentication.md

Lines changed: 21 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.subservice: azure-mqtt-broker
88
ms.topic: how-to
99
ms.custom:
1010
- ignite-2023
11-
ms.date: 11/02/2024
11+
ms.date: 11/11/2024
1212

1313
#CustomerIntent: As an operator, I want to configure authentication so that I have secure MQTT broker communications.
1414
---
@@ -330,7 +330,7 @@ To learn more about each of the authentication options, see the next sections fo
330330

331331
For more information about enabling secure settings by configuring an Azure Key Vault and enabling workload identities, see [Enable secure settings in Azure IoT Operations deployment](../deploy-iot-ops/howto-enable-secure-settings.md).
332332

333-
### X.509
333+
## X.509
334334

335335
A trusted root CA certificate is required to validate the client certificate. Client certificates must be rooted in this CA for MQTT broker to authenticate them. Both EC and RSA keys are supported, but all certificates in the chain must use the same key algorithm. If you're importing your own CA certificates, ensure that the client certificate uses the same key algorithm as the CAs. To import a root certificate that can be used to validate client certificates, import the certificate PEM as *ConfigMap* under the key `client_ca.pem`. For example:
336336

@@ -363,7 +363,7 @@ BinaryData
363363

364364
Once the trusted client root CA certificate and the certificate-to-attribute mapping are imported, enable X.509 client authentication by adding it as one of the authentication methods as part of a *BrokerAuthentication* resource linked to a TLS-enabled listener.
365365

366-
#### Certificate attributes for authorization
366+
### Certificate attributes for authorization
367367

368368
X.509 attributes can be specified in the *BrokerAuthentication* resource, and they're used to authorize clients based on their certificate properties. The attributes are defined in the `authorizationAttributes` field.
369369

@@ -476,13 +476,13 @@ The matching for attributes always starts from the leaf client certificate and t
476476

477477
Authorization rules can be applied to clients using X.509 certificates with these attributes. To learn more, see [Authorize clients that use X.509 authentication](./howto-configure-authorization.md).
478478

479-
#### Connect mosquitto client to MQTT broker with X.509 client certificate
479+
### Connect mosquitto client to MQTT broker with X.509 client certificate
480480

481481
A client like mosquitto needs three files to be able to connect to MQTT broker with TLS and X.509 client authentication. For example:
482482

483483
```bash
484484
mosquitto_pub -q 1 -t hello -d -V mqttv5 -m world -i thermostat \
485-
-h "<IOT_MQ_EXTERNAL_IP>" \
485+
-h "<BROKER_HOST>" \
486486
--cert thermostat_cert.pem \
487487
--key thermostat_key.pem \
488488
--cafile chain.pem
@@ -496,7 +496,7 @@ In the example:
496496
- When mosquitto client connects to MQTT broker over TLS, it validates the server certificate. It searches for root certificates in the database to create a trusted chain to the server certificate. Because of this, the server root certificate needs to be copied into this file.
497497
- When the MQTT broker requests a client certificate from mosquitto client, it also requires a valid certificate chain to send to the server. The `--cert` parameter tells mosquitto which certificate to send, but it's not enough. MQTT broker can't verify this certificate alone because it also needs the intermediate certificate. Mosquitto uses the database file to build the necessary certificate chain. To support this, the `cafile` must contain both the intermediate and root certificates.
498498

499-
#### Understand MQTT broker X.509 client authentication flow
499+
### Understand MQTT broker X.509 client authentication flow
500500

501501
![Diagram of the X.509 client authentication flow.](./media/howto-configure-authentication/x509-client-auth-flow.svg)
502502

@@ -514,7 +514,7 @@ The following are the steps for client authentication flow:
514514
1. Authentication service returns decision to frontend broker.
515515
1. The frontend broker knows the client attributes and if it's allowed to connect. If so, then the MQTT connection is completed and the client can continue to send and receive MQTT packets determined by its authorization rules.
516516

517-
### Kubernetes Service Account Tokens
517+
## Kubernetes Service Account Tokens
518518

519519
Kubernetes Service Account Tokens (SATs) are JSON Web Tokens associated with Kubernetes Service Accounts. Clients present SATs to the MQTT broker to authenticate themselves.
520520

@@ -528,19 +528,19 @@ Launched in Kubernetes 1.13, and becoming the default format in 1.21, bound toke
528528

529529
The broker verifies tokens using the [Kubernetes Token Review API](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-review-v1/). Enable Kubernetes `TokenRequestProjection` feature to specify `audiences` (default since 1.21). If this feature isn't enabled, SATs can't be used.
530530

531-
#### Create a service account
531+
### Create a service account
532532

533533
To create SATs, first create a service account. The following command creates a service account called `mqtt-client`.
534534

535535
```bash
536536
kubectl create serviceaccount mqtt-client -n azure-iot-operations
537537
```
538538

539-
#### Add attributes for authorization
539+
### Add attributes for authorization
540540

541541
Clients authentication via SAT can optionally have their SATs annotated with attributes to be used with custom authorization policies. To learn more, see [Authorize clients that use Kubernetes Service Account Tokens](./howto-configure-authentication.md).
542542

543-
#### Enable Service Account Token (SAT) authentication
543+
### Enable Service Account Token (SAT) authentication
544544

545545
Modify the `authenticationMethods` setting in a *BrokerAuthentication* resource to specify `ServiceAccountToken` as a valid authentication method. The `audiences` specifies the list of valid audiences for tokens. Choose unique values that identify the MQTT broker service. You must specify at least one audience, and all SATs must match one of the specified audiences.
546546

@@ -620,67 +620,33 @@ Apply your changes with `kubectl apply`. It might take a few minutes for the cha
620620

621621
---
622622

623-
#### Test SAT authentication
623+
### Test SAT authentication
624624

625-
SAT authentication must be used from a client in the same cluster as MQTT broker. Only enhanced authentication fields are permitted. Set authentication method to `K8S-SAT` and authentication data to the token.
625+
SAT authentication must be used from a client in the same cluster as MQTT broker. Only MQTTv5 enhanced authentication fields are permitted. Set authentication method to `K8S-SAT` and authentication data to the token.
626626

627-
The following command specifies a pod that has the mosquitto client and mounts the SAT created in the previous steps into the pod.
628-
629-
```yaml
630-
apiVersion: v1
631-
kind: Pod
632-
metadata:
633-
name: mqtt-client
634-
namespace: azure-iot-operations
635-
spec:
636-
serviceAccountName: mqtt-client
637-
containers:
638-
- image: efrecon/mqtt-client
639-
name: mqtt-client
640-
command: ["sleep", "infinity"]
641-
volumeMounts:
642-
- name: mqtt-client-token
643-
mountPath: /var/run/secrets/tokens
644-
volumes:
645-
- name: mqtt-client-token
646-
projected:
647-
sources:
648-
- serviceAccountToken:
649-
path: mqtt-client-token
650-
audience: my-audience
651-
expirationSeconds: 86400
652-
```
653-
654-
Here, the `serviceAccountName` field in the pod configuration must match the service account associated with the token being used. Also, The `serviceAccountToken.audience` field in the pod configuration must be one of the `audiences` configured in the *BrokerAuthentication* resource.
655-
656-
Once the pod is created, start a shell in the pod:
627+
For example using mosquitto (some fields omitted for brevity):
657628

658629
```bash
659-
kubectl exec --stdin --tty mqtt-client -n azure-iot-operations -- sh
630+
mosquitto_pub ... -D CONNECT authentication-method 'K8S-SAT' -D CONNECT authentication-data <TOKEN>
660631
```
661632

662-
Inside the pod's shell, run the following command to publish a message to the broker:
633+
Here, `<TOKEN>` is the service account token. To get the token, run:
663634

664635
```bash
665-
mosquitto_pub --host aio-broker --port 18883 --message "hello" --topic "world" --debug --cafile /var/run/certs/ca.crt -D CONNECT authentication-method 'K8S-SAT' -D CONNECT authentication-data $(cat /var/run/secrets/tokens/broker-sat)
636+
kubectl create token <SERVICE_ACCOUNT> -n azure-iot-operations --audience <AUDIENCE>
666637
```
667638

668-
The output should look similar to the following:
639+
Here, `<SERVICE_ACCOUNT>` is the name of the service account you create, and `<AUDIENCE>` is one of the audiences configured in the *BrokerAuthentication* resource.
669640

670-
```Output
671-
Client (null) sending CONNECT
672-
Client (null) received CONNACK (0)
673-
Client (null) sending PUBLISH (d0, q0, r0, m1, 'world', ... (5 bytes))
674-
Client (null) sending DISCONNECT
675-
```
641+
For an example on how to configure a Kubernetes pod to use SAT authentication, see [Connect to the default listener inside the cluster](./howto-test-connection.md#connect-to-the-default-listener-inside-the-cluster).
676642

677-
The mosquitto client uses the service account token mounted at `/var/run/secrets/tokens/broker-sat` to authenticate with the broker. The token is valid for 24 hours. The client also uses the default root CA cert mounted at `/var/run/certs/ca.crt` to verify the broker's TLS certificate chain.
643+
In the pod configuration, the `serviceAccountName` field in must match the service account associated with the token being used, and the `serviceAccountToken.audience` field must be one of the `audiences` configured in the *BrokerAuthentication* resource.
678644

679-
#### Refresh service account tokens
645+
### Refresh service account tokens
680646

681647
Service account tokens are valid for a limited time and configured with `expirationSeconds`. However, Kubernetes [automatically refreshes the token before it expires](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/). The token is refreshed in the background, and the client doesn't need to do anything other than to fetch it again.
682648

683-
For example, if the client is a pod that uses the token mounted as a volume, like in the [test SAT authentication](#test-sat-authentication) example, then the latest token is available at the same path `/var/run/secrets/tokens/mqtt-client-token`. When making a new connection, the client can fetch the latest token and use it to authenticate. The client should also have a mechanism to handle MQTT unauthorized errors by fetching the latest token and retrying the connection.
649+
For example, if the client is a pod that uses the token mounted as a volume, like in the [test SAT authentication](#test-sat-authentication) example, then the latest token is available at the same path `/var/run/secrets/tokens/broker-sat`. When making a new connection, the client can fetch the latest token and use it to authenticate. The client should also have a mechanism to handle MQTT unauthorized errors by fetching the latest token and retrying the connection.
684650

685651
## Custom authentication
686652

articles/iot-operations/manage-mqtt-broker/howto-encrypt-internal-traffic.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Ensuring the security of internal communications within your infrastructure is i
2020
> [!IMPORTANT]
2121
> This setting requires modifying the Broker resource and can only be configured at initial deployment time using the Azure CLI or Azure Portal. A new deployment is required if Broker configuration changes are needed. To learn more, see [Customize default Broker](./overview-broker.md#customize-default-broker).
2222
23-
The **encrypt internal traffic** feature is used to encrypt the internal traffic between the MQTT broker frontend and backend pods. To use this feature, cert-manager, which is installed by default when using the Azure IoT Operations, is required.
23+
The **encrypt internal traffic** feature is used to encrypt the internal traffic between the MQTT broker frontend and backend pods. It's enabled by default when you deploy Azure IoT Operations.
2424

2525
The benefits include:
2626

@@ -36,9 +36,10 @@ The benefits include:
3636

3737
- **Secure data in the message buffer on disk**: All data in the [message buffer on disk](./howto-disk-backed-message-buffer.md) is encrypted.
3838

39-
By default, encrypting internal traffic enabled. To mitigate security threats, we recommend that you keep the encryption enabled. However, disabling the encryption can improve the performance of the MQTT broker, which can be useful in IoT deployments with high throughput requirements.
39+
To disable encryption, modify the `advanced.encryptInternalTraffic` setting in the Broker resource. This can only be done using the `--broker-config-file` flag during the deployment of Azure IoT Operations with the `az iot ops create` command.
4040

41-
To disable the encryption, change the `advanced.encryptInternalTraffic` setting in the Broker resource. Currently, disabling encryption is only supported using the `--broker-config-file` flag when you deploy the Azure IoT Operations using the `az iot ops create` command.
41+
> [!CAUTION]
42+
> Disabling encryption can enhance the performance of the MQTT broker, which may be beneficial in high-throughput IoT deployments. However, to safeguard against security threats like man-in-the-middle attacks, we strongly recommended to keep this setting enabled. Only disable encryption in controlled, non-production environments for testing purposes.
4243
4344
```json
4445
{

articles/iot-operations/manage-mqtt-broker/howto-test-connection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ kubectl exec --stdin --tty mqtt-client --namespace azure-iot-operations -- sh
9797

9898
Inside the pod's shell, run the following command to publish a message to the broker:
9999

100-
```console
100+
```bash
101101
mosquitto_pub --host aio-broker --port 18883 --message "hello" --topic "world" --debug --cafile /var/run/certs/ca.crt -D CONNECT authentication-method 'K8S-SAT' -D CONNECT authentication-data $(cat /var/run/secrets/tokens/broker-sat)
102102
```
103103

@@ -122,7 +122,7 @@ The mosquitto client uses the service account token mounted at `/var/run/secrets
122122

123123
To subscribe to the topic, run the following command:
124124

125-
```console
125+
```bash
126126
mosquitto_sub --host aio-broker --port 18883 --topic "world" --debug --cafile /var/run/certs/ca.crt -D CONNECT authentication-method 'K8S-SAT' -D CONNECT authentication-data $(cat /var/run/secrets/tokens/broker-sat)
127127
```
128128

articles/iot-operations/troubleshoot/known-issues.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,7 @@ kubectl delete pod aio-opc-opc.tcp-1-f95d76c54-w9v9c -n azure-iot-operations
9494

9595
- X.509 authentication for custom Kafka endpoints isn't supported yet.
9696
97+
- Deserializing and validating messages using a schema is not supported yet. Specifying `schemaRef` in the source configuration only allows the operations experience UX to display the list of data points, but the data points are not validated against the schema.
98+
9799
<!-- TODO: double check -->
98100
- Creating a X.509 secret in the operations experience portal results in a secret with incorrectly encoded data. To work around this issue, create the [multi-line secrets through Azure Key Vault](/azure/key-vault/secrets/multiline-secrets), then select it from the list of secrets in the operations experience portal.

0 commit comments

Comments
 (0)