アプリ開発用の Azure NoSQL データベース サービス。
こんにちは @**三澤 ひかり
**
Azure CosmosのDBアカウントを誤って削除してしまうのがどれほどフラストレーションになるか、よくわかります。幸いなことに、継続バックアップモードを使っていれば、アカウントやデータベース、コンテナを最近の時点に復元できます。その方法は以下の通りです:
Cosmos DBアカウントを復元するためのステップバイステップガイド:
バックアップ保持の確認:バックアップ保持ポリシーが少なくとも7日間に設定されていることを確認してください。もし削除時の数値がこれより少なければ、回復は不可能かもしれません。現在の保持ポリシーはAzureポータルで確認できます。
復元機能の活用:
- Azureポータルへの復元:Azureポータルから復元を開始できます。手順のリンクはこちらです: ポータルを使ってCosmos DBアカウントを復元する方法。
- PowerShellまたはCLI:復元にはPowerShellやAzureコマンドラインインターフェース(CLI)も使えます。それぞれのリンクは以下の通りです:
- [Restore using PowerShell](https://docs.microsoft.com/azure/cosmos-db/restore-account-continuous-backup#restore-account-powershell) - [Restore using CLI](https://docs.microsoft.com/azure/cosmos-db/restore-account-continuous-backup#restore-account-cli) **New Account Creation**: It’s important to note that the restore process will create a new Azure Cosmos DB account with a name that follows the format `<original_account_name>-restored1`. You won't be able to restore to the original account. **Consider the Restore Duration**: Keep in mind that Azure does not provide a guaranteed timeline for restoration completion. It may take a few hours, depending on the amount of data being restored. **Post-Restore Actions**: Once the data is restored, be sure to inspect it to ensure everything is restored as expected. If satisfied, you can migrate the data back to your original account if needed.
- PowerShellまたはCLI:復元にはPowerShellやAzureコマンドラインインターフェース(CLI)も使えます。それぞれのリンクは以下の通りです:
まだ確認していなければ、今後は連続バックアップモードを選ぶことを検討してください。これにより回復の柔軟性が高まります。
参考文献
より詳しいガイダンスについては、役立つリンクをいくつかご紹介します。
- Resolve Azure Cosmos DB restore data issues
- ポイントインタイム復元による連続バックアップ
- Request data restoration from an Azure Cosmos DB backup
- Azure Cosmos DB バックアップおよび復元プロセスとポリシー
これがあなたのCosmosデータベースをスムーズに稼働させる助けになれば幸いです!もし他に質問があれば、遠慮なく聞いてください!