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-disaster-recovery-client-side.md
+33-30Lines changed: 33 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Build your own client-side disaster recovery for Azure Event Grid topics
3
3
description: This article describes how you can build your own client-side disaster recovery for Azure Event Grid topics.
4
4
ms.topic: tutorial
5
-
ms.date: 06/14/2022
5
+
ms.date: 09/07/2022
6
6
ms.devlang: csharp
7
7
ms.custom: devx-track-csharp
8
8
---
@@ -23,13 +23,12 @@ To test your failover configuration, you'll need an endpoint to receive your eve
23
23
To simplify testing, deploy a [pre-built web app](https://github.com/Azure-Samples/azure-event-grid-viewer) that displays the event messages. The deployed solution includes an App Service plan, an App Service web app, and source code from GitHub.
24
24
25
25
1.[Deploy the solution](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure-Samples%2Fazure-event-grid-viewer%2Fmaster%2Fazuredeploy.json) to your subscription. In the Azure portal, provide values for the parameters.
26
-
1. The deployment may take a few minutes to complete. After the deployment has succeeded, view your web app to make sure it's running. In a web browser, navigate to:
26
+
1. The deployment may take a few minutes to complete. After the deployment has succeeded, navigate to the resource group, select the **App Service**, and then select **URL** to navigate to your web app.
27
27
`https://<your-site-name>.azurewebsites.net`
28
28
Make sure to note this URL as you'll need it later.
29
-
30
29
1. You see the site but no events have been posted to it yet.
31
30
32
-

31
+
:::image type="content" source="./media/blob-event-quickstart-portal/view-site.png" alt-text="Screenshot showing the Event Grid Viewer sample web app.":::

47
-
48
-
Select the star next to Event Grid topics to add it to resource menu for easier access in the future.
49
-
50
-
1. In the Event Grid topics Menu, select **+ADD** to create the primary topic.
51
-
52
-
* Give the topic a logical name and add "-primary" as a suffix to make it easy to track.
53
-
* This topic's region will be your primary region.
42
+
1. In the search bar at the top, enter **Event Grid topics**, and then select **Event Grid topics** in the results.
54
43
55
-

44
+
:::image type="content" source="./media/custom-disaster-recovery/select-topics-menu.png" lightbox="./media/custom-disaster-recovery/select-topics-menu.png" alt-text="Screenshot showing the search bar in the Azure portal.":::
45
+
1. On the **Event Grid topics** page, select **+Create** to create the primary topic.
56
46
57
-
1. Once the Topic has been created, navigate to it and copy the **Topic Endpoint**. you'll need the URI later.
47
+
:::image type="content" source="./media/custom-disaster-recovery/create-primary-topic-menu.png" lightbox="./media/custom-disaster-recovery/create-primary-topic-menu.png" alt-text="Screenshot showing the selection of the Create button on the Event Grid topics page.":::
48
+
1. On the **Create topic** page, follow these steps:
49
+
1. Select the **Azure subscription** where you want to create a topic.
50
+
1. Select an existing **Azure resource group** or create a resource group.
51
+
1. Enter a **name** for the topic. Give the topic a logical name and add "-primary" as a suffix to make it easy to track.
52
+
1. Select a **region** for the topic. This topic's region will be your primary region.
53
+
1. Select **Review + create** at the bottom of the page.
58
54
59
-

55
+
:::image type="content" source="./media/custom-disaster-recovery/create-primary-topic.png" lightbox="./media/custom-disaster-recovery/create-primary-topic.png" alt-text="Screenshot showing the Create topic page.":::
56
+
1. On the **Review + create** page, select **Create** at the bottom of the page.
57
+
1. Once the topic has been created, select **Go to resource** to navigate to it and copy the **topic endpoint**. you'll need the URI later.
1. Get the access key for the topic, which you'll also need later. Click on **Access keys** in the resource menu and copy Key 1.
62
61
63
-

64
-
65
-
1. In the **Topic** page, click **+Event Subscription** to create a subscription connecting your subscribing the event receiver website you made in the pre-requisites to the tutorial.
66
-
67
-
* Give the event subscription a logical name and add "-primary" as a suffix to make it easy to track.
68
-
* Select Endpoint Type Web Hook.
69
-
* Set the endpoint to your event receiver's event URL, which should look something like: `https://<your-event-reciever>.azurewebsites.net/api/updates`
70
-
71
-

72
-
73
-
1. Repeat the same flow to create your secondary topic and subscription. This time, replace the "-primary" suffix with "-secondary" for easier tracking. Finally, make sure you put it in a different Azure Region. While you can put it anywhere you want, it's recommended that you use the [Azure Paired Regions](../availability-zones/cross-region-replication-azure.md). Putting the secondary topic and subscription in a different region ensures that your new events will flow even if the primary region goes down.
62
+
:::image type="content" source="./media/custom-disaster-recovery/get-primary-access-key.png" lightbox="./media/custom-disaster-recovery/get-primary-access-key.png" alt-text="Screenshot showing the access key of a primary topic.":::
63
+
1. Switch back to the **Overview** page, and click **+Event Subscription** to create a subscription connecting your subscribing the event receiver website you made in the pre-requisites to the tutorial.
64
+
65
+
:::image type="content" source="./media/custom-disaster-recovery/create-event-subscription-link.png" lightbox="./media/custom-disaster-recovery/create-event-subscription-link.png" alt-text="Screenshot showing the selection of the Create event subscription link.":::
66
+
1. On the **Create Event Subscription** page, follow these steps:
67
+
1. Give the event subscription a logical **name** and add "-primary" as a suffix to make it easy to track.
68
+
1. For **Endpoint Type**, select **Web Hook**.
69
+
70
+
:::image type="content" source="./media/custom-disaster-recovery/create-event-subscription-page.png" lightbox="./media/custom-disaster-recovery/create-event-subscription-page.png" alt-text="Screenshot showing the selection of the Create Event Subscription page.":::
71
+
1. Click **Select an endpoint**.
72
+
1. On the **Select Web Hook** page, set the endpoint to your event receiver's event URL, which should look something like: `https://<your-event-reciever>.azurewebsites.net/api/updates`, and then select **Confirm Selection**. Remember to add `/api/updates` to the URL of the web app.
73
+
74
+
:::image type="content" source="./media/custom-disaster-recovery/select-webhook.png" lightbox="./media/custom-disaster-recovery/select-webhook.png" alt-text="Screenshot showing the selection of the Select Web Hook page.":::
75
+
1. Now, back on the **Create Event Subscription** page, select **Create** at the bottom pf the page.
76
+
1. Repeat the same flow to create your secondary topic and subscription. This time, replace the "-primary" suffix with "-secondary" for easier tracking. Finally, make sure you put it in a **different Azure Region**. While you can put it anywhere you want, it's recommended that you use the [Azure Paired Regions](../availability-zones/cross-region-replication-azure.md). Putting the secondary topic and subscription in a different region ensures that your new events will flow even if the primary region goes down.
74
77
75
78
You should now have:
76
79
@@ -186,7 +189,7 @@ Now that you have all of your components in place, you can test out your failove
186
189
187
190
Try running the event publisher. You should see your test events land in your Event Grid viewer like below.
188
191
189
-

192
+
:::image type="content" source="./media/custom-disaster-recovery/event-grid-viewer.png" alt-text="Screenshot showing the Event Grid Viewer app with posted events.":::
190
193
191
194
To make sure your failover is working, you can change a few characters in your primary topic key to make it no longer valid. Try running the publisher again. You should still see new events appear in your Event Grid viewer, however when you look at your console, you'll see that they are now being published via the secondary topic.
0 commit comments