Skip to content

Files

Latest commit

5041aac · Jun 5, 2022

History

History
117 lines (68 loc) · 6.55 KB

how-to-manage-database-account.md

File metadata and controls

117 lines (68 loc) · 6.55 KB
title description author ms.service ms.subservice ms.topic ms.date ms.author ms.reviewer
Learn how to manage database accounts in Azure Cosmos DB
Learn how to manage Azure Cosmos DB resources by using the Azure portal, PowerShell, CLI, and Azure Resource Manager templates
seesharprun
cosmos-db
cosmosdb-sql
how-to
09/13/2021
sidandrews
mjbrown

Manage an Azure Cosmos account using the Azure portal

[!INCLUDEappliesto-all-apis]

This article describes how to manage various tasks on an Azure Cosmos account using the Azure portal.

Tip

Azure Cosmos DB can also be managed with other Azure management clients including Azure PowerShell, Azure CLI, Azure Resource Manager templates, and Bicep.

Create an account

[!INCLUDE cosmos-db-create-dbaccount]

Add/remove regions from your database account

Tip

When a new region is added, all data must be fully replicated and committed into the new region before the region is marked as available. The amount of time this operation takes will depend upon how much data is stored within the account. If an asynchronous throughput scaling operation is in progress, the throughput scale-up operation will be paused and will resume automatically when the add/remove region operation is complete.

  1. Sign in to Azure portal.

  2. Go to your Azure Cosmos account, and open the Replicate data globally menu.

  3. To add regions, select the hexagons on the map with the + label that corresponds to your desired region(s). Alternatively, to add a region, select the + Add region option and choose a region from the drop-down menu.

  4. To remove regions, clear one or more regions from the map by selecting the blue hexagons with check marks. Or select the "wastebasket" (🗑) icon next to the region on the right side.

  5. To save your changes, select OK.

    :::image type="content" source="./media/how-to-manage-database-account/add-region.png" alt-text="Add or remove regions menu":::

In a single-region write mode, you cannot remove the write region. You must fail over to a different region before you can delete the current write region.

In a multi-region write mode, you can add or remove any region, if you have at least one region.

Configure multiple write-regions

Open the Replicate Data Globally tab and select Enable to enable multi-region writes. After you enable multi-region writes, all the read regions that you currently have on the account will become read and write regions.

:::image type="content" source="./media/how-to-manage-database-account/single-to-multi-master.png" alt-text="Azure Cosmos account configures multi-region writes screenshot":::

Enable service-managed failover for your Azure Cosmos account

The Service-Managed failover option allows Azure Cosmos DB to failover to the region with the highest failover priority with no user action should a region become unavailable. When service-managed failover is enabled, region priority can be modified. Account must have two or more regions to enable service-managed failover.

  1. From your Azure Cosmos account, open the Replicate data globally pane.

  2. At the top of the pane, select Automatic Failover.

    :::image type="content" source="./media/how-to-manage-database-account/replicate-data-globally.png" alt-text="Replicate data globally menu":::

  3. On the Automatic Failover pane, make sure that Enable Automatic Failover is set to ON.

  4. Select Save.

    :::image type="content" source="./media/how-to-manage-database-account/automatic-failover.png" alt-text="Automatic failover portal menu":::

Set failover priorities for your Azure Cosmos account

After a Cosmos account is configured for automatic failover, the failover priority for regions can be changed.

Important

You cannot modify the write region (failover priority of zero) when the account is configured for service-managed failover. To change the write region, you must disable service-managed failover and do a manual failover.

  1. From your Azure Cosmos account, open the Replicate data globally pane.

  2. At the top of the pane, select Automatic Failover.

    :::image type="content" source="./media/how-to-manage-database-account/replicate-data-globally.png" alt-text="Replicate data globally menu":::

  3. On the Automatic Failover pane, make sure that Enable Automatic Failover is set to ON.

  4. To modify the failover priority, drag the read regions via the three dots on the left side of the row that appear when you hover over them.

  5. Select Save.

    :::image type="content" source="./media/how-to-manage-database-account/automatic-failover.png" alt-text="Automatic failover portal menu":::

Perform manual failover on an Azure Cosmos account

Important

The Azure Cosmos account must be configured for manual failover for this operation to succeed.

Note

If you perform a manual failover operation while an asynchronous throughput scaling operation is in progress, the throughput scale-up operation will be paused. It will resume automatically when the failover operation is complete.

  1. Go to your Azure Cosmos account, and open the Replicate data globally menu.

  2. At the top of the menu, select Manual Failover.

    :::image type="content" source="./media/how-to-manage-database-account/replicate-data-globally.png" alt-text="Replicate data globally menu":::

  3. On the Manual Failover menu, select your new write region. Select the check box to indicate that you understand this option changes your write region.

  4. To trigger the failover, select OK.

    :::image type="content" source="./media/how-to-manage-database-account/manual-failover.png" alt-text="Manual failover portal menu":::

Next steps

For more information and examples on how to manage the Azure Cosmos account as well as database and containers, read the following articles: