简体   繁体   English

将blob(.bacpac)转换为.bacpac文件以将数据库导入SQL Server Azure?

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

While working in MVC/ C# with Azure I need to restore database from a .bacpac file which is stored in blob storage. 在Azure中使用MVC / C#时,我需要从存储在blob存储中的.bacpac文件中恢复数据库。 I m using DAC Framework API to access .bacpac from Blob storage. 我使用DAC Framework API从Blob存储中访问.bacpac。

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. DacServices.ImportBacpac需要.bacpac文件,我能够引用blob文件(这是一个.bacpac),但它是一个blob而不是一个.bacpac文件。 I m not sure how to convert a blob to a .bacpac. 我不知道如何将blob转换为.bacpac。 Can you please guide me some way or API to do that conversion ? 你可以用某种方式或API来指导我做这种转换吗? Later I will use this file to import backpac to SQL Server Azure. 稍后我将使用此文件将backpac导入SQL Server Azure。

Thanks for your time and help. 谢谢你的时间和帮助。

最好的方法可能是将blob作为流(CloudBlob.DownloadToStream())读取并从所述流(BacPackage.Load())创建bacpac。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM