将Blob(.bacpac)转换为.bacpac文件以将数据库导入SQL Server Azure? [英] converting a blob (.bacpac) to .bacpac file to import database to SQL Server Azure?

查看:110
本文介绍了将Blob(.bacpac)转换为.bacpac文件以将数据库导入SQL Server Azure?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Azure在MVC/C#中工作时,我需要从存储在Blob存储中的.bacpac文件还原数据库.我正在使用DAC Framework API从Blob存储访问.bacpac.

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.

问题:

DacServices.ImportBacpac需要.bacpac文件,我能够引用blob文件(它是.bacpac),但它是blob而不是.bacpac文件.我不确定如何将Blob转换为.bacpac.您能否以某种方式或API指导我进行这种转换? 稍后,我将使用此文件将backpac导入SQL Server Azure.

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.

推荐答案

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

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

这篇关于将Blob(.bacpac)转换为.bacpac文件以将数据库导入SQL Server Azure?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆