|
| 1 | +--- |
| 2 | +title: Move Azure Event Grid custom topics to another region |
| 3 | +description: This article shows you how to move Azure Event Grid custom topics from one region to another region. |
| 4 | +ms.topic: how-to |
| 5 | +ms.custom: subject-moving-resources |
| 6 | +ms.date: 08/28/2020 |
| 7 | +#Customer intent: As an Azure service administrator, I want to be able to move Event Grid custom topics from one region to another region to have it closer to customers, to meet internal policy and governance requirements, or in response to capacity planning requirements. |
| 8 | +--- |
| 9 | + |
| 10 | +# Move Azure Event Grid custom topics to another region |
| 11 | +You might want to move your resources to another region for a number of reasons. For example, to take advantage of a new Azure region, to meet internal policy and governance requirements, or in response to capacity planning requirements. |
| 12 | + |
| 13 | +Here are the high-level steps covered in this article: |
| 14 | + |
| 15 | +- **Export the custom topic** resource to an Azure Resource Manager template. |
| 16 | + |
| 17 | + > [!IMPORTANT] |
| 18 | + > Only the custom topic is exported to the template. Any subscriptions for the topic aren't exported. |
| 19 | +- **Use the template to deploy the custom topic** to the target region. |
| 20 | +- **Create subscriptions manually** in the target region. When you exported the custom topic to a template in the current region, only the topic is exported. Subscriptions aren't included in the template, so create them manually after the custom topic is created in the target region. |
| 21 | +- **Verify the deployment**. Verify that the custom topic is created in the target region. |
| 22 | +- To **complete the move**, delete custom topic from the source region. |
| 23 | + |
| 24 | +## Prerequisites |
| 25 | +- Complete the [Quickstart: Route custom events to web endpoint](custom-event-quickstart-portal.md) in the source region. Do this step so that you can test steps in this article. |
| 26 | +- Ensure that the Event Grid service is available in the target region. See [Products available by region](https://azure.microsoft.com/global-infrastructure/services/?products=event-grid®ions=all). |
| 27 | + |
| 28 | +## Prepare |
| 29 | +To get started, export a Resource Manager template for the custom topic. |
| 30 | + |
| 31 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 32 | +2. In the search bar, type **Event Grid topics**, and select **Event Grid Topics** from the results list. |
| 33 | + |
| 34 | + :::image type="content" source="./media/move-custom-topics-across-regions/search-topics.png" alt-text="Search for and select Event Grid topics"::: |
| 35 | +3. Select the **topic** that you want to export to a Resource Manager template. |
| 36 | + |
| 37 | + :::image type="content" source="./media/move-custom-topics-across-regions/select-custom-topic.png" alt-text="Select the custom topic"::: |
| 38 | +4. On the **Event Grid Topic** page, select **Export Template** under **Settings** on the left menu, and then select **Download** on the toolbar. |
| 39 | + |
| 40 | + :::image type="content" source="./media/move-custom-topics-across-regions/export-template-download.png" alt-text="Export template -> Download"::: |
| 41 | + |
| 42 | + > [!IMPORTANT] |
| 43 | + > Only the topic is exported to the template. Subscriptions for the topic aren't exported. So, you need to create subscriptions for the topic after you move the topic to the target region. |
| 44 | +5. Locate the **.zip** file you downloaded from the portal, and unzip that file to a folder of your choice. This zip file contains template and parameters JSON files. |
| 45 | +1. Open the **template.json** in an editor of your choice. |
| 46 | +8. Update `location` for the **topic** resource to the target region or location. To obtain location codes, see [Azure locations](https://azure.microsoft.com/global-infrastructure/locations/). The code for a region is the region name with no spaces, for example, `West US` is equal to `westus`. |
| 47 | + |
| 48 | + ```json |
| 49 | + "type": "Microsoft.EventGrid/topics", |
| 50 | + "apiVersion": "2020-06-01", |
| 51 | + "name": "[parameters('topics_mytopic0130_name')]", |
| 52 | + "location": "westus" |
| 53 | + ``` |
| 54 | +1. **Save** the template. |
| 55 | + |
| 56 | +## Recreate |
| 57 | +Deploy the template to create a custom topic in the target region. |
| 58 | + |
| 59 | +1. In the Azure portal, select **Create a resource**. |
| 60 | +2. In **Search the Marketplace**, type **template deployment**, and then press **ENTER**. |
| 61 | +3. Select **Template deployment**. |
| 62 | +4. Select **Create**. |
| 63 | +5. Select **Build your own template in the editor**. |
| 64 | +6. Select **Load file**, and then follow the instructions to load the **template.json** file that you downloaded in the last section. |
| 65 | +7. Select **Save** to save the template. |
| 66 | +8. On the **Custom deployment** page, follow these steps: |
| 67 | + 1. Select an Azure **subscription**. |
| 68 | + 1. Select an existing **resource group** in the target region or create one. |
| 69 | + 1. For **Region**, select the target region. If you selected an existing resource group, this setting is read-only. |
| 70 | + 1. For the **topic name**, enter a new name for the topic. |
| 71 | + 1. Select **Review + create** at the bottom of the page. |
| 72 | + |
| 73 | + :::image type="content" source="./media/move-custom-topics-across-regions/deploy-template.png" alt-text="Custom deployment"::: |
| 74 | + 1. On the **Review + create** page, review settings, and select **Create**. |
| 75 | + |
| 76 | +## Verify |
| 77 | + |
| 78 | +1. After the deployment succeeds, select **Go to resource**. |
| 79 | + |
| 80 | + :::image type="content" source="./media/move-custom-topics-across-regions/navigate-custom-topic.png" alt-text="Go to resource"::: |
| 81 | +1. Confirm that you see the **Event Grid Topic** page for the custom topic. |
| 82 | +1. Follow steps in the [Route custom events to a web endpoint](custom-event-quickstart-portal.md#send-an-event-to-your-topic) to send events to the topic. Verify that the webhook event handler is invoked. |
| 83 | + |
| 84 | +## Discard or clean up |
| 85 | +To complete the move, delete the custom topic in the source region. |
| 86 | + |
| 87 | +If you want to start over, delete the topic in the target region, and repeat steps in the [Prepare](#prepare) and [Recreate](#recreate) sections of this article. |
| 88 | + |
| 89 | +To delete a custom topic by using the Azure portal: |
| 90 | + |
| 91 | +1. In the search window at the top of Azure portal, type **Event Grid Topics**, and select **Event Grid Topics** from search results. |
| 92 | +2. Select the topic to delete, and select **Delete** from the toolbar. |
| 93 | +3. On the confirmation page, enter the name of the resource group, and select **Delete**. |
| 94 | + |
| 95 | +To delete the resource group that contains the custom topic by using the Azure portal: |
| 96 | + |
| 97 | +1. In the search window at the top of Azure portal, type **Resource groups**, and select **Resource groups** from search results. |
| 98 | +2. Select the resource group to delete, and select **Delete** from the toolbar. |
| 99 | +3. On the confirmation page, enter the name of the resource group, and select **Delete**. |
| 100 | + |
| 101 | +## Next steps |
| 102 | +You learned how to move an Event Grid custom topic from one region to another region. See the following articles for moving system topics, domains, and partner namespaces across regions. |
| 103 | + |
| 104 | +- [Move system topics across regions](move-system-topics-across-regions.md). |
| 105 | +- [Move domains across regions](move-domains-across-regions.md). |
| 106 | + |
| 107 | +To learn more about moving resources between regions and disaster recovery in Azure, see the following article: [Move resources to a new resource group or subscription](../azure-resource-manager/management/move-resource-group-and-subscription.md). |
0 commit comments