# Step 1: Deploy the primary and replica databases

The setup instructions are based on a [architecture-example](https://docs.sonarsource.com/sonarqube-server/2026.1/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/architecture-example "mention").

Deploy the primary and replica PostgreSQL databases on Azure as follows:

1. On the Azure Database for PostgreSQL flexible server creation page of your primary database, select your subscription and resource group.
2. In **Server details** > **Compute + storage**, select **Configure server**. A new pane opens.

<div align="left"><figure><img src="https://content.gitbook.com/content/LWhbesChsC4Yd1BbhHhS/blobs/F1ubh0opIGyxMsgnEwFe/sonarqube-dce-disaster-recovery-configure-azure-database.png" alt="In the Server details of your primary Azure database, select Configure server"><figcaption></figcaption></figure></div>

3. In **Backups**, enable the **Geo-redundancy**.

<div align="left"><figure><img src="https://content.gitbook.com/content/LWhbesChsC4Yd1BbhHhS/blobs/VwSFgZnvuORLxGqH4mwy/sonarqube-dce-disaster-recovery-azure%20database-enable-geo-redundancy.png" alt="Enable the geo-redundancy by selecting the Recover from regional outage or disaster option"><figcaption></figcaption></figure></div>

4. Once the primary database has been deployed, create the replica database. To do so, go to the primary database resource page > **Settings >** **Replication >** **Create replica**. Ensure that you select a different **Availability zone** than for the primary database.

<div align="left"><figure><img src="https://content.gitbook.com/content/LWhbesChsC4Yd1BbhHhS/blobs/IV5adoYmgosTkSr0dpBu/sonarqube-dce-disaster-recovery-azure-replica-database-availability-zone.png" alt="Create the replica database and set a different Availability zone that for the primary database"><figcaption></figcaption></figure></div>

5. Create virtual endpoints: go to **Database Settings** > **Replication** > **Virtual endpoints**.

<figure><img src="https://content.gitbook.com/content/LWhbesChsC4Yd1BbhHhS/blobs/vnLsiwK3nTYkZmtCK067/sonarqube-dce-disaster-recovery-azure-front-door-endpoints-command.png" alt="Creating virtual endpoints"><figcaption></figcaption></figure>

The following pane is displayed.

<div align="left"><figure><img src="https://content.gitbook.com/content/LWhbesChsC4Yd1BbhHhS/blobs/nr1K0e1BQvYOvNyVL16M/sonarqube-dce-disaster-recovery-azure-front-door-create-virtual-endpoints.png" alt="Information displayed in a pane"><figcaption></figcaption></figure></div>

## Related pages <a href="#related-pages" id="related-pages"></a>

* [architecture-example](https://docs.sonarsource.com/sonarqube-server/2026.1/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/architecture-example "mention")
* [set-up-clusters-on-aks](https://docs.sonarsource.com/sonarqube-server/2026.1/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/set-up-clusters-on-aks "mention")
* [configure-azure-front-door](https://docs.sonarsource.com/sonarqube-server/2026.1/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/configure-azure-front-door "mention")
* [test-failover-scenarios](https://docs.sonarsource.com/sonarqube-server/2026.1/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/test-failover-scenarios "mention")


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/2026.1/server-installation/data-center-edition/on-kubernetes-or-openshift/setting-up-disaster-recovery/deploy-databases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
