
{"id":16035,"date":"2022-12-08T14:17:02","date_gmt":"2022-12-08T14:17:02","guid":{"rendered":"https:\/\/rax-prod-wp-aws.com\/blogs\/backup-sql-database-to-blob-container-and-restore-it-to-another-server\/"},"modified":"2026-11-04T15:20:07","modified_gmt":"2026-11-04T15:20:07","slug":"backup-sql-database-to-blob-container-and-restore-it-to-another-server","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/en-gb\/blogs\/backup-sql-database-to-blob-container-and-restore-it-to-another-server\/","title":{"rendered":"Backup SQL database to blob container and restore it to another Server"},"content":{"rendered":"<p>This blog demonstrates the detailed steps needed to create an SQL Database backup in a blob container. To begin, with you need to list down the available backups, and restore them from a blob container to a Prem SQL Database.<\/p>\n<h4>INTRODUCTION<\/h4>\n<p>Unlike SQL database backup to local drives. The backup to the Azure blob container requires an Azure storage account to be created. The blob container is created under the storage account. Post that you need to create the SQL credential using an Azure account secret key. Once the above steps are complete, you can take a backup to the blob container and restore it back from the blob container.<\/p>\n<p>Refer to the following list:<\/p>\n<p>Backup SQL DB to Blob container:<\/p>\n<ol>\n<li>Create an Azure Storage account<\/li>\n<li>Create a Blob container where backup files need to be placed.<\/li>\n<li>Get the secret key for the Azure Storage account<\/li>\n<li>Create credentials in SQL server with Azure Storage account identity and Secret Key.<\/li>\n<li>Backup DB on the Source server using the SQL credential for the blob container.<\/li>\n<\/ol>\n<p>Restore SQL DB from Blob container:<\/p>\n<ol>\n<li>Create credentials in the SQL server with the same Azure Storage account identity and Secret Key.<\/li>\n<li>Restore DB from the container on the Destination Server<\/li>\n<\/ol>\n<p><strong>Steps to Create SQL database Backup on prem SQL Server:<\/strong><\/p>\n<ol>\n<li>Create an Azure Storage account:<\/li>\n<\/ol>\n<p>Here storage account name should be in lowercase. Geo redundancy is not required, and you can uncheck it. Select the storage type as standard vs premium based on your requirement. Review and create an account.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-1.png\" alt=\"technical-blog-backup-sql-database-image-1\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp; 2. Create a Blob container:<\/p>\n<p>Once the storage account gets created, you need to a create blob container with Private access from the Data storage section. By default, a blob container is created with public access.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-2.png\" alt=\"technical-blog-backup-sql-database-image-2\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong><em>Note down the Blob container URL<\/em><\/strong><\/p>\n<p>Once the blob container gets created go to its properties and copy the blob URL.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-3.png\" alt=\"technical-blog-backup-sql-database-image-3\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp; 3. Get the secret key for the Azure Storage account<\/p>\n<p><em>Copy the Secret key used for the storage account<\/em><\/p>\n<p>Now go to the security + networking section under storage account open Access keys and click on show Keys. You will see the storage account name 2 keys Key1 and Key2 are associated with the storage account. Copy the key from here and note it down as it will be needed for SQL credential creation.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-4.png\" alt=\"technical-blog-backup-sql-database-image-4\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp;4. Create SQL Credential using storage account secret<\/p>\n<p>Open query analyzer from SSMS. Give the credential name, Storage account name and paste the secret key that you copied earlier from the storage account access keys. Now execute the following statement to create a credential for the blob container.<\/p>\n<p><code>CREATE CREDENTIAL [DBBackupCred] WITH IDENTITY = 'sqlrestore123' -- Storage Account Name ,SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==' -- Access key GO<\/code><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-5.png\" alt=\"technical-blog-backup-sql-database-image-5\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>If Blob URL does not exists or URL is not correct you will get below error while taking backup of DB.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-6.png\" alt=\"technical-blog-backup-sql-database-image-6\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; &nbsp; 5. Backup database on source server using credentials:<\/p>\n<p>Paste the blob URL that was copied earlier from blob container properties. Also, give a credential name in the backup command and execute the following statement on the source server. This will take the backup on the blob container.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-7.png\" alt=\"technical-blog-backup-sql-database-image-7\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Restore SQL DB from Blob container:<\/p>\n<ol>\n<li>Create credentials in the SQL server with the same Azure Storage account identity and Secret Key.<\/li>\n<\/ol>\n<p>Open query analyzer from SSMS. Give the credential name, Storage account name and paste the secret key that you copied earlier from the storage account access keys. Now execute the following statement and create the credential for the blob container.<\/p>\n<p><code>CREATE CREDENTIAL [DBBackupCred] WITH IDENTITY = 'sqlrestore123' -- Storage Account Name ,SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==' -- Access key GO<\/code><\/p>\n<p>&nbsp;<\/p>\n<p><strong>NOTE:<\/strong>&nbsp;<em>The same query\/statement is executed on both servers with the same secret key.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-8.png\" alt=\"technical-blog-backup-sql-database-image-8\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; &nbsp; 2. Restore DB from the container on the Destination Server.<\/p>\n<p>Go to the blob container, and list down the available backups in the container. Right-click on the available backup on the container. click on view\/edit and copy the backup URL.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-9.png\" alt=\"technical-blog-backup-sql-database-image-9\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Open query analyzer from SSMS. Give the credential name, Storage account name and paste the secret key that you copied earlier from the storage account access keys. Now execute the following statement to restore the backup from the blob container.<\/p>\n<p><code>CREATE CREDENTIAL [DBBackupCred] WITH IDENTITY = 'sqlrestore123' -- Storage Account Name ,SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==' -- Access key GO<\/code><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-body-technical-blog-backup-sql-database-image-10.png\" alt=\"technical-blog-backup-sql-database-image-10\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Conclusion<\/h3>\n<p>By following the above steps, you will be able to back up the SQL database to an Azure Blob container. DBAs sometimes do not use the same secret key to create credentials in the SQL server. This results in the backup file not getting located. By following the steps covered above, you will be able to get the secret key from the Azure portal, create the SQL credential, and easily restore the same backup file to another SQL server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Backup SQL database to blob container and restore it to another Server<\/p>\n","protected":false},"author":2,"featured_media":16398,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"25669","content_type":"blog","created_by":"11255","authored_on":"2023-06-23T18:47:02+05:30","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Rackspace Technology Staff","seo_description":"Detailed steps to backup an SQL database to a blob container and restore it to another server. Strengthen data protection strategies.","field_featured_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-insights_image-database-technical-blog-1-insights.jpg","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/25669-insights_image-database-technical-blog-1-insights.jpg","field_partners":"","rxt_platforms":"MySQL","product":"","publisheddate":"2022-12-08T14:17:02","rxt_solutions":"","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Backup SQL Database to Blob Container: A Guide","field_topics":"","field_slug":"Backup SQL Database Blob Container Guide","footnotes":""},"categories":[],"tags":[204],"class_list":["post-16035","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/16035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/comments?post=16035"}],"version-history":[{"count":2,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/16035\/revisions"}],"predecessor-version":[{"id":16037,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/16035\/revisions\/16037"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media\/16398"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media?parent=16035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/categories?post=16035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/tags?post=16035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}