{"id":371,"date":"2016-04-13T15:55:00","date_gmt":"2016-04-13T15:55:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/azuregov\/?p=371"},"modified":"2016-04-13T15:55:00","modified_gmt":"2016-04-13T15:55:00","slug":"how-to-backup-to-sql-server-directly-azure-government-storage-account","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azuregov\/how-to-backup-to-sql-server-directly-azure-government-storage-account\/","title":{"rendered":"How To: Backup to SQL Server directly Azure Government Storage Account"},"content":{"rendered":"<p>You might run into some problems importing your Azure Government publish settings file into SQL Server. However you can still backup to Azure Government Storage Accounts using the Storage Account keys.<\/p>\n<p><strong>Step 1: Create a credential<\/strong>\nUSE master\nCREATE CREDENTIAL &lt;name of cred&gt; WITH IDENTITY='&lt;the storage account name&gt;&#8217;, SECRET='&lt;one of the storage account keys&gt;&#8217;<\/p>\n<p>To get the name and keys, navigate to your storage account in the Azure Gov Management portal and select \u201cManage Access Keys\u201d. You will see them here.\n<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/43\/2019\/03\/blog01.png\"><img decoding=\"async\" class=\"alignnone  wp-image-374\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/43\/2019\/03\/blog01-300x202.png\" alt=\"blog01\" width=\"400\" height=\"269\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/43\/2019\/03\/blog02.png\"><img decoding=\"async\" class=\"alignnone  wp-image-384\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/43\/2019\/03\/blog02-300x241.png\" alt=\"blog02\" width=\"400\" height=\"321\" \/><\/a>\n<strong>Step 2: create the backup using the credential you created<\/strong>\nBACKUP DATABASE &lt;name of db&gt; TO\u00a0 URL = N'&lt;backup endpoint&gt;&#8217;\nWITH\u00a0 CREDENTIAL = N'&lt;name of cred&gt;&#8217;\n, NOFORMAT, NOINIT,\u00a0 NAME = N'&lt;name of backup&gt;&#8217;, NOSKIP, NOREWIND, NOUNLOAD,\u00a0 STATS = 10\nGO<\/p>\n<p>The backup endpoint should look like this\nhttps:\/\/&lt;storage account name&gt;.blob.core.usgovcloudapi.net\/&lt;container name&gt;\/&lt;file name&gt;.bak<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might run into some problems importing your Azure Government publish settings file into SQL Server. However you can still backup to Azure Government Storage Accounts using the Storage Account keys. Step 1: Create a credential USE master CREATE CREDENTIAL &lt;name of cred&gt; WITH IDENTITY='&lt;the storage account name&gt;&#8217;, SECRET='&lt;one of the storage account keys&gt;&#8217; To [&hellip;]<\/p>\n","protected":false},"author":5375,"featured_media":20423,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[30],"tags":[130,531],"class_list":["post-371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-storage-backup-recovery","tag-backup","tag-storage"],"acf":[],"blog_post_summary":"<p>You might run into some problems importing your Azure Government publish settings file into SQL Server. However you can still backup to Azure Government Storage Accounts using the Storage Account keys. Step 1: Create a credential USE master CREATE CREDENTIAL &lt;name of cred&gt; WITH IDENTITY='&lt;the storage account name&gt;&#8217;, SECRET='&lt;one of the storage account keys&gt;&#8217; To [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/users\/5375"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media\/20423"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}