0

Good day, I am trying to backup a Microsoft Azure SQL database using an ASP.Net application programmatically into either a .BACPAC file I can download to a local machine or into an Azure blob storage platform. I know similar questions have been asked before but I have searched the web and cannot find a recent solution that seems to work. A simple "Backup database" SQL query also doesn't seem to be possible as I am constantly thrown with the error message: 'BACKUP DATABASE' is not supported in this version of SQL Server. Any help would be greatly appreciated. Attempt at consuming API

1
  • In future please quote the @@VERSION. There are a lot of different SQL offerings now. Commented Sep 30, 2019 at 0:01

1 Answer 1

0

The simplest way i think is to use Databases - Export Rest Api(Exports a database to a bacpac) The rest api provides you with a blobUri which you can use to download or transfer to Azure blob storage

Sign up to request clarification or add additional context in comments.

4 Comments

Awesome, that looks just like what I am looking for. Would you by any chance have any example code of how to consume the API?
learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/… this is a basic Call a Web API From a .NET Client tutorial. If my answer is what you were looking for then accept it.
Could you please look at the edit I made with the attached picture. I am getting an error : "The remote server returned an error: (401) Unauthorized.""
storageUri should be some thing like this "storageUri": "https://test.blob.core.windows.net/bacpacs/testbacpac.bacpac" You only provided location to a sub folder. Try it with postman tool first then with c#

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.