converting a blob (.bacpac) to .bacpac file to import database to SQL Server Azure?

夙愿已清 提交于 2019-12-24 12:05:08

问题


While working in MVC/ C# with Azure I need to restore database from a .bacpac file which is stored in blob storage. I m using DAC Framework API to access .bacpac from Blob storage.

Issue:

DacServices.ImportBacpac requires .bacpac file, I am able to refer blob file (which is a .bacpac) but it comes as a blob and not as a .bacpac file. I m not sure how to convert a blob to a .bacpac. Can you please guide me some way or API to do that conversion ? Later I will use this file to import backpac to SQL Server Azure.

Thanks for your time and help.


回答1:


The best way is probably to read the blob as a stream (CloudBlob.DownloadToStream()) and create the bacpac from said stream (BacPackage.Load()).



来源:https://stackoverflow.com/questions/23464034/converting-a-blob-bacpac-to-bacpac-file-to-import-database-to-sql-server-azu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!