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
log.LogInformation($"Object put in database. Key is {key} and value is {data[i].ToString()}");
@@ -194,18 +194,43 @@ Before you start, make sure you've completed the following steps:
194
194
```
195
195
196
196
6. Start the Stream Analytics job.
197
+
7. On the **Monitor** page for your Azure function, you see that the function is invoked.
198
+
199
+
:::image type="content" source="./media/stream-analytics-with-azure-functions/function-invocations.png" alt-text="Screenshot showing the Minitor page for Azure Functions with function invocations.":::
200
+
1. On the **Azure Cache for Redis** page your cache, select **Metrics** on the left menu, add **Cache Write** metric, and set the duration to **last hour**. You see the chart similar to the following image.
201
+
202
+
:::image type="content" source="./media/stream-analytics-with-azure-functions/redis-cache-write-metric.png" alt-text="Screenshot showing the Metrics page for your Azure Cache for Redis.":::
197
203
198
204
## Check Azure Cache for Redis for results
199
205
200
-
1. Browse to the Azure portal, and find your Azure Cache for Redis. Select **Console**.
206
+
### Get the key from Azure Functions logs
207
+
First, get the key for a record inserted into Azure Cache for Redis. In the code, the key is calculated in the Azure function as shown in the following code snippet:
208
+
209
+
```csharp
210
+
stringkey=data[i].Time+" - "+data[i].CallingNum1;
201
211
202
-
2. Use [Azure Cache for Redis commands](https://redis.io/commands) to verify that your data is in Azure Cache for Redis. (The command takes the format Get {key}.) For example:
212
+
db.StringSet(key, data[i].ToString());
213
+
log.LogInformation($"Object put in database. Key is {key} and value is {data[i].ToString()}");
214
+
```
215
+
1. Browse to the Azure portal, and find your Azure Functions app.
216
+
1. Select **Functions** on the left menu.
217
+
1. Select **HTTPTrigger1** from the list of functions.
218
+
1. Select **Monitor** on the left menu.
219
+
1. Switch to the **Logs** tab.
220
+
1. Note down a key from the informational message as shown in the following screenshot. You use this key to find the value in Azure Cache for Redis.
221
+
222
+
:::image type="content" source="./media/stream-analytics-with-azure-functions/key-azure-functions-log.png" alt-text="Screenshot showing the Monitor Logs page for the Azure function. ":::
223
+
224
+
### Use the key to find the record in Azure Cache for Redis
225
+
226
+
1. Browse to the Azure portal, and find your Azure Cache for Redis. Select **Console**.
227
+
2. Use [Azure Cache for Redis commands](https://redis.io/commands) to verify that your data is in Azure Cache for Redis. (The command takes the format Get {key}.) Use the key you copied from the Monitor logs for the Azure function (in the previous section).
203
228
204
-
**Get "12/19/2017 21:32:24 - 123414732"**
229
+
**Get "KEY-FROM-THE-PREVIOUS-SECTION"**
205
230
206
231
This command should print the value for the specified key:
207
232
208
-

233
+
:::image type="content" source="./media/stream-analytics-with-azure-functions/redis-console.png" alt-text="Screenshot showing the Redit Cache console showing the output of the Get command.":::
0 commit comments