Skip to content

Commit 5eae484

Browse files
authored
Merge pull request #103298 from VidyaKukke/vkukke-updates
Changed from AzFunc Subscriber to Custom Subscriber
2 parents 1465136 + c0fe17e commit 5eae484

File tree

5 files changed

+89
-132
lines changed

5 files changed

+89
-132
lines changed

articles/event-grid/edge/monitor-topics-subscriptions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Configure the module to emit metrics by setting the `metrics__reporterType` envi
3535
}
3636
```
3737

38-
Metrics will be available at `5888/metrics` of the module for http and `4438/metrics` for https. For example, `http://<modulename>:4438/metrics?api-version=2019-01-01-preview` for http. At this point, a metrics module can poll the endpoint to collect metrics as in this [example architecture](https://github.com/veyalla/ehm).
38+
Metrics will be available at `5888/metrics` of the module for http and `4438/metrics` for https. For example, `http://<modulename>:5888/metrics?api-version=2019-01-01-preview` for http. At this point, a metrics module can poll the endpoint to collect metrics as in this [example architecture](https://github.com/veyalla/ehm).
3939

4040
## Available metrics
4141

@@ -57,10 +57,10 @@ Both topics and event subscriptions emit metrics to give you insights into event
5757

5858
| Metric | Description |
5959
| ------ | ----------- |
60-
| deliverySuccessCounts | Number of events successfully delivered to the configured endpoint
61-
| deliveryFailureCounts | Number of event delivery attempts failed to the configured endpoint
62-
| deliverySuccessLatencyMs | Latency of events successfully delivered in milliseconds
63-
| deliveryFailureLatencyMs | Latency of events delivery failures in milliseconds
64-
| systemDelayForFirstAttemptMs | System delay of events before first delivery attempt in milliseconds
65-
| deliveryAttemptsCount | Number of event delivery attempts - success and failure
66-
| expiredCounts | Number of events unable to be delivered
60+
| DeliverySuccessCounts | Number of events successfully delivered to the configured endpoint
61+
| DeliveryFailureCounts | Number of events that failed to be delivered to the configured endpoint
62+
| DeliverySuccessLatencyMs | Latency of events successfully delivered in milliseconds
63+
| DeliveryFailureLatencyMs | Latency of events delivery failures in milliseconds
64+
| SystemDelayForFirstAttemptMs | System delay of events before first delivery attempt in milliseconds
65+
| DeliveryAttemptsCount | Number of event delivery attempts - success and failure
66+
| ExpiredCounts | Number of events that expired and were not delivered to the configured endpoint

articles/event-grid/edge/persist-state-linux.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ For example, the following configuration will result in the creation of the volu
4444
```json
4545
{
4646
"Env": [
47-
"inbound:serverAuth:tlsPolicy=strict",
48-
"inbound:serverAuth:serverCert:source=IoTEdge",
49-
"inbound:clientAuth:sasKeys:enabled=false",
50-
"inbound:clientAuth:clientCert:enabled=true",
51-
"inbound:clientAuth:clientCert:source=IoTEdge",
52-
"inbound:clientAuth:clientCert:allowUnknownCA=true",
53-
"outbound:clientAuth:clientCert:enabled=true",
54-
"outbound:clientAuth:clientCert:source=IoTEdge",
55-
"outbound:webhook:httpsOnly=true",
56-
"outbound:webhook:skipServerCertValidation=false",
57-
"outbound:webhook:allowUnknownCA=true"
47+
"inbound__serverAuth__tlsPolicy=strict",
48+
"inbound__serverAuth__serverCert__source=IoTEdge",
49+
"inbound__clientAuth__sasKeys__enabled=false",
50+
"inbound__clientAuth__clientCert__enabled=true",
51+
"inbound__clientAuth__clientCert__source=IoTEdge",
52+
"inbound__clientAuth__clientCert__allowUnknownCA=true",
53+
"outbound__clientAuth__clientCert__enabled=true",
54+
"outbound__clientAuth__clientCert__source=IoTEdge",
55+
"outbound__webhook__httpsOnly=true",
56+
"outbound__webhook__skipServerCertValidation=false",
57+
"outbound__webhook__allowUnknownCA=true"
5858
],
5959
"HostConfig": {
6060
"Binds": [
@@ -111,7 +111,8 @@ Instead of a docker volume, you also have the option to mount a host folder.
111111
{
112112
"HostConfig": {
113113
"Binds": [
114-
"<your-directory-name-here>:/app/metadataDb"
114+
"<your-directory-name-here>:/app/metadataDb",
115+
"<your-directory-name-here>:/app/eventsDb",
115116
]
116117
}
117118
}
@@ -122,17 +123,17 @@ Instead of a docker volume, you also have the option to mount a host folder.
122123
```json
123124
{
124125
"Env": [
125-
"inbound:serverAuth:tlsPolicy=strict",
126-
"inbound:serverAuth:serverCert:source=IoTEdge",
127-
"inbound:clientAuth:sasKeys:enabled=false",
128-
"inbound:clientAuth:clientCert:enabled=true",
129-
"inbound:clientAuth:clientCert:source=IoTEdge",
130-
"inbound:clientAuth:clientCert:allowUnknownCA=true",
131-
"outbound:clientAuth:clientCert:enabled=true",
132-
"outbound:clientAuth:clientCert:source=IoTEdge",
133-
"outbound:webhook:httpsOnly=true",
134-
"outbound:webhook:skipServerCertValidation=false",
135-
"outbound:webhook:allowUnknownCA=true"
126+
"inbound__serverAuth__tlsPolicy=strict",
127+
"inbound__serverAuth__serverCert__source=IoTEdge",
128+
"inbound__clientAuth__sasKeys__enabled=false",
129+
"inbound__clientAuth__clientCert__enabled=true",
130+
"inbound__clientAuth__clientCert__source=IoTEdge",
131+
"inbound__clientAuth__clientCert__allowUnknownCA=true",
132+
"outbound__clientAuth__clientCert__enabled=true",
133+
"outbound__clientAuth__clientCert__source=IoTEdge",
134+
"outbound__webhook__httpsOnly=true",
135+
"outbound__webhook__skipServerCertValidation=false",
136+
"outbound__webhook__allowUnknownCA=true"
136137
],
137138
"HostConfig": {
138139
"Binds": [
@@ -151,7 +152,7 @@ Instead of a docker volume, you also have the option to mount a host folder.
151152
```
152153

153154
>[!IMPORTANT]
154-
>Do not change the second part of the bind value. It points to a specific location within the module. For the Event Grid module on linux, it has to be **/app/metadata**.
155+
>Do not change the second part of the bind value. It points to a specific location within the module. For the Event Grid module on linux, it has to be **/app/metadataDb** and **/app/eventsDb**
155156

156157

157158
## Persist events
@@ -162,7 +163,7 @@ Important things to note about persisting events:
162163

163164
* Persisting events is enabled on a per Event Subscription basis and is opt-in once a volume or directory has been mounted.
164165
* Event persistence is configured on an Event Subscription at creation time and cannot be modified once the Event Subscription is created. To toggle event persistence, you must delete and re-create the Event Subscription.
165-
* Persisting events is almost always slower than in memory operations, however the speed difference is highly dependent on the characteristics of the drive. The tradeoff between speed and reliability is inherent to all messaging systems but generally only becomes a noticible at large scale.
166+
* Persisting events is almost always slower than in memory operations, however the speed difference is highly dependent on the characteristics of the drive. The tradeoff between speed and reliability is inherent to all messaging systems but generally only becomes a noticeable at large scale.
166167

167168
To enable event persistence on an Event Subscription, set `persistencePolicy` to `true`:
168169

@@ -180,4 +181,4 @@ To enable event persistence on an Event Subscription, set `persistencePolicy` to
180181
}
181182
}
182183
}
183-
```
184+
```

articles/event-grid/edge/persist-state-windows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ Instead of mounting a volume, you can create a directory on the host system and
207207
```
208208
## Persist events
209209

210-
To enable event persistence, you must first enable metadata persistence either via volume mount or host directory mount using the above sections.
210+
To enable event persistence, you must first enable events persistence either via volume mount or host directory mount using the above sections.
211211

212212
Important things to note about persisting events:
213213

214214
* Persisting events is enabled on a per Event Subscription basis and is opt-in once a volume or directory has been mounted.
215215
* Event persistence is configured on an Event Subscription at creation time and cannot be modified once the Event Subscription is created. To toggle event persistence, you must delete and re-create the Event Subscription.
216-
* Persisting events is almost always slower than in memory operations, however the speed difference is highly dependent on the characteristics of the drive. The tradeoff between speed and reliability is inherent to all messaging systems but only becomes a noticible at large scale.
216+
* Persisting events is almost always slower than in memory operations, however the speed difference is highly dependent on the characteristics of the drive. The tradeoff between speed and reliability is inherent to all messaging systems but only becomes a noticeable at large scale.
217217

218218
To enable event persistence on an Event Subscription, set `persistencePolicy` to `true`:
219219

articles/event-grid/edge/pub-sub-events-webhook-local.md

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ A deployment manifest is a JSON document that describes which modules to deploy,
5959
```json
6060
{
6161
"Env": [
62-
"inbound__clientAuth__clientCert__enabled=false",
63-
"outbound__webhook__httpsOnly=false"
62+
"inbound__clientAuth__clientCert__enabled=false"
6463
],
6564
"HostConfig": {
6665
"PortBindings": {
@@ -74,21 +73,17 @@ A deployment manifest is a JSON document that describes which modules to deploy,
7473
}
7574
```
7675
1. Click **Save**
77-
1. Continue to the next section to add the Azure Functions module before deploying them together.
76+
1. Continue to the next section to add the Azure Event Grid Subscriber module before deploying them together.
7877

7978
>[!IMPORTANT]
80-
> In this tutorial, you will deploy the Event Grid module with client authentication disabled and allow HTTP subscribers. For production workloads, we recommend that you enable the client authentication and allow only HTTPs subscribers. For more information on how to configure Event Grid module securely, see [Security and authentication](security-authentication.md).
79+
> In this tutorial, you will deploy the Event Grid module with client authentication disabled. For production workloads, we recommend that you enable the client authentication. For more information on how to configure Event Grid module securely, see [Security and authentication](security-authentication.md).
8180
>
8281
> If you are using an Azure VM as an edge device, add an inbound port rule to allow inbound traffic on the port 4438. For instructions on adding the rule, see [How to open ports to a VM](../../virtual-machines/windows/nsg-quickstart-portal.md).
8382

8483

85-
## Deploy Azure Function IoT Edge module
86-
87-
This section shows you how to deploy the Azure Functions IoT module, which would act as an Event Grid subscriber to which events can be delivered.
88-
89-
>[!IMPORTANT]
90-
>In this section, you will deploy a sample Azure Function-based subscribing module. It can of course be any custom IoT Module that can listen for HTTP POST requests.
84+
## Deploy Event Grid Subscriber IoT Edge module
9185

86+
This section shows you how to deploy another IoT module which would act as an event handler to which events can be delivered.
9287

9388
### Add modules
9489

@@ -97,23 +92,8 @@ This section shows you how to deploy the Azure Functions IoT module, which would
9792
1. Provide the name, image, and container create options of the container:
9893

9994
* **Name**: subscriber
100-
* **Image URI**: `mcr.microsoft.com/azure-event-grid/iotedge-samplesubscriber-azfunc:latest`
101-
* **Container Create Options**:
102-
103-
```json
104-
{
105-
"HostConfig": {
106-
"PortBindings": {
107-
"80/tcp": [
108-
{
109-
"HostPort": "8080"
110-
}
111-
]
112-
}
113-
}
114-
}
115-
```
116-
95+
* **Image URI**: `mcr.microsoft.com/azure-event-grid/iotedge-samplesubscriber:latest`
96+
* **Container Create Options**: None
11797
1. Click **Save**
11898
1. Click **Next** to continue to the routes section
11999

@@ -186,15 +166,15 @@ Subscribers can register for events published to a topic. To receive any event,
186166
"destination": {
187167
"endpointType": "WebHook",
188168
"properties": {
189-
"endpointUrl": "http://subscriber:80/api/subscriber"
169+
"endpointUrl": "https://subscriber:4430"
190170
}
191171
}
192172
}
193173
}
194174
```
195175

196176
>[!NOTE]
197-
> The **endpointType** property specifies that the subscriber is a **Webhook**. The **endpointUrl** specifies the URL at which the subscriber is listening for events. This URL corresponds to the Azure Function sample you deployed earlier.
177+
> The **endpointType** property specifies that the subscriber is a **Webhook**. The **endpointUrl** specifies the URL at which the subscriber is listening for events. This URL corresponds to the Azure Subscriber sample you deployed earlier.
198178
2. Run the following command to create a subscription for the topic. Confirm that you see the HTTP status code is `200 OK`.
199179

200180
```sh
@@ -218,7 +198,7 @@ Subscribers can register for events published to a topic. To receive any event,
218198
"destination": {
219199
"endpointType": "WebHook",
220200
"properties": {
221-
"endpointUrl": "http://subscriber:80/api/subscriber"
201+
"endpointUrl": "https://subscriber:4430"
222202
}
223203
}
224204
}
@@ -270,7 +250,7 @@ Subscribers can register for events published to a topic. To receive any event,
270250
Sample output:
271251

272252
```sh
273-
Received event data [
253+
Received Event:
274254
{
275255
"id": "eventId-func-0",
276256
"topic": "sampleTopic1",
@@ -284,7 +264,6 @@ Subscribers can register for events published to a topic. To receive any event,
284264
"model": "Monster"
285265
}
286266
}
287-
]
288267
```
289268

290269
## Cleanup resources

0 commit comments

Comments
 (0)