{"id":2409,"date":"2021-03-02T05:45:43","date_gmt":"2021-03-02T13:45:43","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=2409"},"modified":"2021-03-02T07:08:20","modified_gmt":"2021-03-02T15:08:20","slug":"continuous-backup-now-in-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/continuous-backup-now-in-preview\/","title":{"rendered":"Continuous backup with point in time restore now in preview"},"content":{"rendered":"<p><span data-contrast=\"none\">The <\/span><span data-contrast=\"none\">public preview of\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/continuous-backup-restore-introduction\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">continuous backup\u00a0<\/span><span data-contrast=\"none\">and\u00a0<\/span><\/a><span data-contrast=\"none\">point-in-time restore capabilities for Azure Cosmos DB database\u00a0accounts with Core (SQL) API or API for MongoDB was announced today at <a href=\"https:\/\/myignite.microsoft.com\/home\" target=\"_blank\" rel=\"noopener\">Microsoft Ignite<\/a>. These powerful new capabilities<\/span><span data-contrast=\"none\">\u00a0make i<\/span>t easy to:<\/p>\n<ul>\n<li><span data-contrast=\"none\">R<\/span><span data-contrast=\"none\">estore<\/span><span data-contrast=\"none\">\u00a0a<\/span><span data-contrast=\"none\">n accidentally<\/span><span data-contrast=\"none\">\u00a0deleted account<\/span><span data-contrast=\"none\">,\u00a0<\/span><span data-contrast=\"none\">d<\/span><span data-contrast=\"none\">atabase,<\/span><span data-contrast=\"none\">\u00a0or container<\/span><span data-contrast=\"none\">.<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"none\">Recover from accidental corruption by restoring data<\/span> <span data-contrast=\"none\">to any second in the last 30 days.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"none\">Perform r<\/span><span data-contrast=\"none\">estore in<\/span><span data-contrast=\"none\">to<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">any<\/span> <span data-contrast=\"none\">regions (in multi-region accounts)<\/span><span data-contrast=\"none\">.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;134233279&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">You can use Azure <\/span><\/span><a class=\"Hyperlink SCXW205981770 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-portal#provision\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\" data-ccp-charstyle=\"Hyperlink\">portal<\/span><\/span><\/a><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">, <\/span><\/span><a class=\"Hyperlink SCXW205981770 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-powershell#provision-sql-api\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\" data-ccp-charstyle=\"Hyperlink\">PowerShell<\/span><\/span><\/a><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">,\u00a0<\/span><\/span><a class=\"Hyperlink SCXW205981770 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-command-line#provision-sql-api\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\" data-ccp-charstyle=\"Hyperlink\">CLI<\/span><\/span><\/a><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">\u00a0commands or\u00a0<\/span><\/span><a class=\"Hyperlink SCXW205981770 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-template#provision\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\" data-ccp-charstyle=\"Hyperlink\">Azure resource manager<\/span><\/span><\/a><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\"> templates to:<\/span><\/span><\/p>\n<ul>\n<li><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">Enable continuous backup during new account creation (pro tip: once enabled, there is no need to configure retention)<\/span><\/span><\/li>\n<li>Trigger time-consistent restores<\/li>\n<li>Exercise the <span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">well-defined<\/span><span class=\"NormalTextRun SCXW205981770 BCX8\">\u00a0<\/span><\/span><a class=\"Hyperlink SCXW205981770 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-resource-model\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\" data-ccp-charstyle=\"Hyperlink\">resource model<\/span><\/span><\/a><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\">\u00a0<\/span><\/span><\/li>\n<\/ul>\n<p>In addition, you can use the portal, PowerShell, and CLI to:<\/p>\n<ul>\n<li><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2 SCXW205981770 BCX8\">Define<\/span><span class=\"NormalTextRun SCXW205981770 BCX8\">\u00a0<\/span><\/span><a class=\"Hyperlink SCXW205981770 BCX8\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-permissions\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\" data-ccp-charstyle=\"Hyperlink\">who can restore<\/span><\/span><\/a><span class=\"TextRun SCXW205981770 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW205981770 BCX8\"> at the subscription or account level using existing roles<\/span><\/span><\/li>\n<\/ul>\n<h4><\/h4>\n<h4><b><span data-contrast=\"none\">Enabling\u00a0<\/span><\/b><b><span data-contrast=\"none\">Continuous Backup<\/span><\/b><b><span data-contrast=\"none\">\u00a0<\/span><\/b><b><span data-contrast=\"none\">\u00a0<\/span><\/b><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/h4>\n<p><span style=\"text-decoration: underline;\">In Azure portal<\/span><\/p>\n<p><span data-contrast=\"none\">Using the Azure portal, enable continuous backup during account creation by navigating to \u201cBackup Policy\u201d, as shown below.<\/span><\/p>\n<p><figure id=\"attachment_2414\" aria-labelledby=\"figcaption_attachment_2414\" class=\"wp-caption aligncenter\" ><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/create-contbackup.png\"><img decoding=\"async\" class=\"wp-image-2414 size-full\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/create-contbackup.png\" alt=\"Image of continuous backup enabled during account creation\" width=\"1057\" height=\"267\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/create-contbackup.png 1057w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/create-contbackup-300x76.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/create-contbackup-1024x259.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/create-contbackup-768x194.png 768w\" sizes=\"(max-width: 1057px) 100vw, 1057px\" \/><\/a><figcaption id=\"figcaption_attachment_2414\" class=\"wp-caption-text\">Azure portal<\/figcaption><\/figure><\/p>\n<p><span style=\"text-decoration: underline;\">Using Azure CLI (command line interface)<\/span><\/p>\n<div>\n<pre>az cosmosdb create \\\r\n  --name pitracct2 \\\r\n  --resource-group myrg \\\r\n  --backup-policy-type Continuous \\\r\n  --locations regionName=\"West US\"<\/pre>\n<\/div>\n<p><span style=\"text-decoration: underline;\">Using Azure PowerShell<\/span><\/p>\n<pre class=\"prettyprint\">New-AzCosmosDBAccount `\r\n  -ResourceGroupName \"myrg\" `\r\n  -Location \"West US\" `\r\n  -BackupPolicyType Continuous `\r\n  -Name \"pitracct2\" `\r\n  -ApiKind \"Sql\"<\/pre>\n<h4><\/h4>\n<h4><b><span data-contrast=\"none\">Restor<\/span><\/b><b><span data-contrast=\"none\">ing data to a <\/span><\/b><b><span data-contrast=\"none\">point in time<\/span><\/b><\/h4>\n<p><span style=\"text-decoration: underline;\">In Azure portal<\/span><\/p>\n<p><span data-contrast=\"none\">Restore requires\u00a0<\/span><span data-contrast=\"none\">a c<\/span><span data-contrast=\"none\">lick on the point in time restore\u00a0<\/span><span data-contrast=\"none\">on the portal menu, choosing the date, utc time<\/span><span data-contrast=\"none\">,\u00a0<\/span><span data-contrast=\"none\">location<\/span><span data-contrast=\"none\">\u00a0<\/span><span data-contrast=\"none\">and\u00a0<\/span><span data-contrast=\"none\">new account name.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/DeletedData-2.gif\"><img decoding=\"async\" class=\"size-full wp-image-2485 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/DeletedData-2.gif\" alt=\"Deleted Data restore\" width=\"1164\" height=\"904\" \/><\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-decoration: underline;\">Using Azure CLI<\/span><\/p>\n<div>\n<pre>az cosmosdb restore \\\r\n --target-database-account-name &lt;restored-account-name&gt; \\\r\n --account-name &lt;sourceDatabaseAccountName&gt; \\\r\n --restore-timestamp   &lt;UTC time&gt; \\   \r\n --resource-group  &lt;resourceGroupName&gt; \\\r\n --location &lt;Azure Region Name&gt;<\/pre>\n<\/div>\n<pre><\/pre>\n<p><span style=\"text-decoration: underline;\">Using Azure PowerShell<\/span><\/p>\n<div>\n<pre>Restore-AzCosmosDBAccount `\r\n  -TargetResourceGroupName &lt;resourceGroupName&gt; `\r\n  -TargetDatabaseAccountName &lt;restored-account-name&gt; `\r\n  -SourceDatabaseAccountName &lt;sourceDatabaseAccountName&gt; `\r\n  -RestoreTimestampInUtc &lt;UTC time&gt; `\r\n  -Location &lt;Azure Region Name&gt;<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h4>Restoring a deleted account<\/h4>\n<p><span data-contrast=\"none\">You can <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-portal#restore-deleted-account\">restore<\/a> a deleted account by using the restore capability on the portal like below<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/RestoreDeletedAcctNoLoop.gif\"><img decoding=\"async\" class=\"size-full wp-image-2480 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2021\/02\/RestoreDeletedAcctNoLoop.gif\" alt=\"Restore Deleted Account\" width=\"1164\" height=\"904\" \/><\/a><\/p>\n<h4><b>\u00a0<\/b><\/h4>\n<p>You can assign the <code>CosmosRestoreOperator<\/code> built-in role at the subscription or account level to restrict who can restore. The example below shows how to assign that capability at the subscription level:<\/p>\n<pre class=\"prettyprint\">az role assignment create --role \"CosmosRestoreOperator\" --assignee &lt;email&gt; \u2013scope \/subscriptions\/&lt;subscriptionId&gt;<\/pre>\n<h3><\/h3>\n<h3>Getting started<\/h3>\n<ul>\n<li>Create<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-portal#provision\" target=\"_blank\" rel=\"noopener\"> a new account<\/a> in Azure portal and enable continuous backup<\/li>\n<li><span data-contrast=\"none\">Review<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/continuous-backup-restore-introduction#current-limitations-public-preview\" target=\"_blank\" rel=\"noopener\"> technical documentation\u00a0<\/a><\/span><\/li>\n<li><span data-contrast=\"none\"><span class=\"TextRun BCX8 SCXW48788681\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun BCX8 SCXW48788681\">Find <a href=\"https:\/\/azure.microsoft.com\/en-us\/pricing\/details\/cosmos-db\/\" target=\"_blank\" rel=\"noopener\">pricing information<\/a>\u00a0<\/span><\/span><\/span><\/li>\n<\/ul>\n<h3><\/h3>\n<h3>New to Azure Cosmos DB?<\/h3>\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/four-ways-to-try-azure-cosmos-db-free\/\">Try Azure Cosmos DB free<\/a> in production or non-production environments<\/li>\n<li>Download the free\u00a0<a href=\"https:\/\/azure.microsoft.com\/en-us\/resources\/azure-cosmos-db-onboarding-best-practices\/\" target=\"_blank\" rel=\"noopener noreferrer\">best practices and optimization guide\u00a0<\/a><\/li>\n<li class=\"x-hidden-focus\">Visit\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/learn\/browse\/?terms=cosmos%20db\" target=\"_blank\" rel=\"noopener noreferrer\">MS Learn<\/a>\u00a0to build your Azure Cosmos DB skills<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Azure Cosmos DB now offers continuous backup with point-in-time restore capabilities.   This feature can help to recover your database from accidental delete of accounts, containers or mutation of data. The restore can be accomplished through a wide area of tools available on the platform.<\/p>\n","protected":false},"author":10035,"featured_media":2414,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12,15,14,667],"tags":[1770,1774],"class_list":["post-2409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcements","category-mongodb-api","category-core-sql-api","category-security","tag-azure-cosmosdb","tag-msignite"],"acf":[],"blog_post_summary":"<p>Azure Cosmos DB now offers continuous backup with point-in-time restore capabilities.   This feature can help to recover your database from accidental delete of accounts, containers or mutation of data. The restore can be accomplished through a wide area of tools available on the platform.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/2409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/10035"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=2409"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/2409\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/2414"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=2409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=2409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=2409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}