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 |
[!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]
[!INCLUDE cli-run-local-sign-in.md]
:::code language="azurecli" source="~/azure_cli_scripts/postgresql/backup-restore/backup-restore.sh" id="FullScript":::
[!INCLUDE cli-clean-up-resources.md]
az group delete --name $resourceGroup
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. |
- Read more information on the Azure CLI: Azure CLI documentation.
- Try additional scripts: Azure CLI samples for Azure Database for PostgreSQL - Flexible Server
- How to backup and restore a server in Azure Database for PostgreSQL - Flexible Server using the Azure portal