Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 2.27 KB

sample-point-in-time-restore.md

File metadata and controls

54 lines (37 loc) · 2.27 KB
title description ms.author author ms.service ms.devlang ms.topic ms.custom ms.date
Azure CLI script - Restore
This sample Azure CLI script shows how to restore an Azure Database for PostgreSQL - Flexible Server instance and its databases to a previous point in time.
alkuchar
AwdotiaRomanowna
postgresql
azurecli
sample
mvc, devx-track-azurecli
02/11/2022

Restore an Azure Database for PostgreSQL - Flexible Server instance using Azure CLI

[!INCLUDEapplies-to-postgres-single-flexible-server]

This sample CLI script restores a single Azure Database for PostgreSQL flexible server instance to a previous point in time.

[!INCLUDE quickstarts-free-trial-note]

[!INCLUDE azure-cli-prepare-your-environment.md]

Sample script

[!INCLUDE cli-run-local-sign-in.md]

Run the script

:::code language="azurecli" source="~/azure_cli_scripts/postgresql/backup-restore/backup-restore.sh" id="FullScript":::

Clean up deployment

[!INCLUDE cli-clean-up-resources.md]

az group delete --name $resourceGroup

Sample reference

This script uses the commands outlined in the following table:

Command Notes
az group create Creates a resource group in which all resources are stored.
az postgresql server create Creates an Azure Database for PostgreSQL flexible server instance that hosts the databases.
az postgresql server restore Restore a server from backup.
az group delete Deletes a resource group including all nested resources.

Next steps