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/event-grid/custom-event-to-function.md
+22-19Lines changed: 22 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ ms.devlang: azurecli
18
18
1. Sign in to the [Azure portal](https://portal.azure.com).
19
19
1. On the left navigational menu, select **All services**.
20
20
1. Select **Compute** in the list of **Categories**.
21
-
1. Hover (not select) the mouse over **Function App**, and select **Create**.
21
+
1. Hover (not select) the mouse over **Function App**, and select **+**.
22
22
23
23
:::image type="content" source="./media/custom-event-to-function/create-function-app-link.png" lightbox="./media/custom-event-to-function/create-function-app-link.png" alt-text="Screenshot showing the select of Create link for a Function App.":::
24
24
1. On the **Basics** page of the **Create Function App** wizard, follow these steps:
@@ -27,35 +27,30 @@ ms.devlang: azurecli
27
27
1. Specify a **name** for the function app.
28
28
1. Select **.NET** for **Runtime stack**.
29
29
1. Select the **region** closest to you.
30
-
1. Select **Next: Hosting** at the bottom of the page.
30
+
1. Select **Next: Storage** at the bottom of the page.
31
31
32
32
:::image type="content" source="./media/custom-event-to-function/create-function-app-page.png" alt-text="Screenshot showing the Basics tab of the Create Function App page.":::
33
-
1. On the **Hosting** page, create a new storage account or select an existing storage account to be associated with the function app, and then select **Review + create** at the bottom of the page.
33
+
1. On the **Storage** page, create a new storage account or select an existing storage account to be associated with the function app, and then select **Review + create** at the bottom of the page.
34
34
35
-
:::image type="content" source="./media/custom-event-to-function/create-function-app-hosting-page.png" alt-text="Screenshot showing the Hosting tab of the Create Function App page.":::
35
+
:::image type="content" source="./media/custom-event-to-function/create-function-app-hosting-page.png" alt-text="Screenshot showing the Storage tab of the Create Function App page.":::
36
36
1. On the **Review + create** page, review settings, and select **Create** at the bottom of the page to create the function app.
37
37
1. Once the deployment is successful, select **Go to resource** to navigate to the home page for the function app.
38
38
39
39
## Create a function
40
40
Before subscribing to the custom topic, create a function to handle the events.
41
41
42
-
1. On the **Function App** page, select **Functions** on the left menu.
43
-
1. Select **+ Create** on the toolbar to create a function.
42
+
1. On the **Function App** page, select **Create in Azure portal** link in the right pane.
44
43
45
44
:::image type="content" source="./media/custom-event-to-function/create-function-link.png" alt-text="Screenshot showing the selection of Create function link.":::
46
45
47
46
1. On the **Create Function** page, follow these steps:
48
-
1. This step is optional. For **Development environment**, select the development environment that you want to use to work with the function code.
49
47
1. In the **Select a template** section, in the filter or search box, type **Azure Event Grid trigger**.
50
48
1. Select **Azure Event Grid Trigger** template in the template list.
51
49
1. In the **Template details** section in the bottom pane, enter a name for the function. In this example, it's **HandleEventsFunc**.
4. On the **Function** page for the **HandleEventsFunc**, select **Code + Test** on the left navigational menu.
56
-
57
-
:::image type="content" source="./media/custom-event-to-function/function-code-test-menu.png" alt-text="Image showing the selection Code + Test menu for an Azure function.":::
58
-
5. Replace the code with the following code.
53
+
4. On the **Function** page for the **HandleEventsFunc**, select **Code + Test** on the left navigational menu, replace the code with the following code, and then select **Save** on the command bar.
59
54
60
55
```csharp
61
56
#r"Azure.Messaging.EventGrid"
@@ -69,11 +64,11 @@ Before subscribing to the custom topic, create a function to handle the events.
:::imagetype="content"source="./media/custom-event-to-function/function-updated-code.png"alt-text="Screenshot showing the Code + Test view of an Azure function with the updated code.":::
:::imagetype="content"source="./media/custom-event-to-function/function-code-test-menu.png"alt-text="Image showing the selection Code + Test menu for an Azure function.":::
@@ -218,9 +213,17 @@ The second example uses PowerShell to perform similar steps.
218
213
```
219
214
220
215
### Verify that function received the event
221
-
You've triggered the event, and Event Grid sent the message to the endpoint you configured when subscribing. Navigate to your Event Grid triggered function and open the logs. You should see a copy of the data payload of the event in the logs. If you don'tmakesureyouopenthelogswindowfirst, orhitreconnect, andthentrysendingatesteventagain.
216
+
You've triggered the event, and Event Grid sent the message to the endpoint you configured when subscribing.
:::imagetype="content"source="./media/custom-event-to-function/monitor-page-invocations.png"alt-text="Screenshot showing the Invocations tab of the Monitor page.":::
221
+
2. Selecttheinvocationtoseethedetails.
222
+
223
+
:::imagetype="content"source="./media/custom-event-to-function/invocation-details-page.png"alt-text="Screenshot showing the Invocation details.":::
:::imagetype="content"source="./media/custom-event-to-function/successful-function.png"lightbox="./media/custom-event-to-function/successful-function.png"alt-text="Image showing the Monitor view of the Azure function with a log.":::
226
+
:::imagetype="content"source="./media/custom-event-to-function/successful-function.png"lightbox="./media/custom-event-to-function/successful-function.png"alt-text="Image showing the Monitor view of the Azure function with a log.":::
224
227
225
228
## Clean up resources
226
229
Ifyouplantocontinueworkingwiththisevent, don't clean up the resources created in this article. Otherwise, delete the resources you created in this article.
0 commit comments