简体   繁体   English

将SQL数据库从Azure Blob Azure上传到Sql数据库

[英]Upload SQL Database from Azure Blob Azure to Sql Database

I want to transfer .bacpac database from Azure Blob Storage to Azure SQL Database. 我想将.bacpac数据库从Azure Blob存储转移到Azure SQL数据库。 I am using sqlpackage.exe using import command as 我正在使用sqlpackage.exe使用导入命令作为

sqlpackage.exe /a:Import /sf:< Azure Blob .bacpac file > /tsn:< Azure Server Name > /tdn:< target databse name > /tu:< target database user name > /tp:< target database password > sqlpackage.exe / a:导入/ sf:<Azure Blob .bacpac文件> / tsn:<Azure服务器名称> / tdn:<目标数据库名称> / tu:<目标数据库用户名> / tp:<目标数据库密码>

But this command giving error as 但是此命令给出错误为

"Could not load package from . File format not supported". “无法从加载程序包。不支持文件格式”。

Please note while giving local file(.bacpac file in same system as sqlpackage)in /sf field, it works fine. 请注意,在/ sf字段中提供本地文件(与sqlpackage相同的系统中的.bacpac文件)时,它可以正常工作。

---Edit--- - -编辑 - -

More detail: I want to upload .bacpac file into Azure DB using nodejs code. 详细信息:我想使用nodejs代码将.bacpac文件上传到Azure DB。 So the only option I came up is upload user's .bacpac file to Azure blob and then call a custom script containing sqlpackage.exe command in configured azure Windows Server to transfer this uploaded bacpac to Azure DB. 因此,我想到的唯一选择是将用户的.bacpac文件上传到Azure blob,然后在已配置的Azure Windows Server中调用一个包含sqlpackage.exe命令的自定义脚本,以将该上传的bacpac传输到Azure DB。 It would be helpful if you can provide any feasible solution for this scenario other than I figured out. 如果您能为我提供除此以外的任何可行解决方案,将对您有所帮助。

Hi this can be done via the portal or via PowerShell is there a specific need to use sqlpackage.exe? 嗨,这可以通过门户网站或PowerShell来完成,是否特别需要使用sqlpackage.exe?

PowerShell instructions are available at: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-import-powershell 可在以下位置获得PowerShell说明: https : //docs.microsoft.com/zh-cn/azure/sql-database/sql-database-import-powershell

Portal at: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-import-portal 门户位于: https : //docs.microsoft.com/zh-cn/azure/sql-database/sql-database-import-portal

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

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