Skip to content

Commit 781f2b7

Browse files
authored
Merge pull request #114523 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to master to sync with https://github.com/Microsoft/azure-docs (branch master)
2 parents cd4d87d + ef910f2 commit 781f2b7

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

articles/iot-hub/iot-hub-ip-filtering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: Azure IoT Hub IP connection filters | Microsoft Docs
33
description: How to use IP filtering to block connections from specific IP addresses for to your Azure IoT hub. You can block connections from individual or ranges of IP addresses.
44
author: robinsh
@@ -61,7 +61,7 @@ To edit an existing rule, select the data you want to change, make the change, t
6161
> Rejecting IP addresses can prevent other Azure Services (such as Azure Stream Analytics, Azure Virtual Machines, or the Device Explorer in the portal) from interacting with the IoT hub.
6262
6363
> [!WARNING]
64-
> If you use Azure Stream Analytics (ASA) to read messages from an IoT hub with IP filtering enabled, use the Event Hub-compatible name and endpoint of your IoT Hub in the ASA connection string.
64+
> If you use Azure Stream Analytics (ASA) to read messages from an IoT hub with IP filtering enabled, use the event hub-compatible name and endpoint of your IoT hub to manually add an [Event Hubs stream input](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-define-inputs#stream-data-from-event-hubs) in the ASA.
6565
6666
## Delete an IP filter rule
6767

articles/stream-analytics/stream-analytics-edge-csharp-udf-methods.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,43 @@ Expand the **User-Defined Code Configuration** section, and fill out the configu
136136
|Custom Code Assembly Source|Existing assembly packages from the cloud|
137137
|Custom Code Assembly Source|UserCustomCode.zip|
138138

139+
## User logging
140+
The logging mechanism allows you to capture custom information while a job is running. You can use log data to debug or assess the correctness of the custom code in real time.
141+
142+
The `StreamingContext` class lets you publish diagnostic information using the `StreamingDiagnostics.WriteError` function. The code below shows the interface exposed by Azure Stream Analytics.
143+
144+
```csharp
145+
public abstract class StreamingContext
146+
{
147+
public abstract StreamingDiagnostics Diagnostics { get; }
148+
}
149+
150+
public abstract class StreamingDiagnostics
151+
{
152+
public abstract void WriteError(string briefMessage, string detailedMessage);
153+
}
154+
```
155+
156+
`StreamingContext` is passed as an input parameter to the UDF method and can be used within the UDF to publish custom log information. In the example below, `MyUdfMethod` defines a **data** input, which is provided by the query, and a **context** input as the `StreamingContext`, provided by the runtime engine.
157+
158+
```csharp
159+
public static long MyUdfMethod(long data, StreamingContext context)
160+
{
161+
// write log
162+
context.Diagnostics.WriteError("User Log", "This is a log message");
163+
164+
return data;
165+
}
166+
```
167+
168+
The `StreamingContext` value doesn't need to be passed in by the SQL query. Azure Stream Analytics provides a context object automatically if an input parameter is present. The use of the `MyUdfMethod` does not change, as shown in the following query:
169+
170+
```sql
171+
SELECT udf.MyUdfMethod(input.value) as udfValue FROM input
172+
```
173+
174+
You can access log messages through the [diagnostic logs](data-errors.md).
175+
139176
## Limitations
140177
The UDF preview currently has the following limitations:
141178

0 commit comments

Comments
 (0)