这是我的命令行:
C:\mydir>msdeploy.exe -verb:sync -Source:dbDacFx="C:\mydir\my.data.dacpac" -dest:dbDacFx="Data Source=myserver;Database=my.data;user id=sa;password=secret",wmsvc="https://www.mysite.co.nz",username=myuser,password=anothersecret -verbose
这是输出:
Info: Using ID 'fad3c5de-98e8-413e-a21f-f3c86038790e' for connections to the remote server.
Verbose: Pre-authenticating to remote agent URL 'https://www.mysite.co.nz:8172/msdeploy.axd' as 'myuser'.
Verbose: Performing synchronization pass #1.
Verbose: Pre-authenticating to remote agent URL 'https://www.mysite.co.nz:8172/msdeploy.axd' as 'myuser'.
Verbose: No backup was executed.
Verbose: Received response from agent (HTTP status 'OK').
Info: Adding MSDeploy.dbDacFx (MSDeploy.dbDacFx).
Verbose: The dependency check 'DependencyCheckInUse' found no issues.
Verbose: The current synchronization pass is missing stream content for 1 objects.
Info: Using ID 'f1cb17ef-04f0-43f3-9759-e7ba58fba703' for connections to the remote server.
Verbose: Performing synchronization pass #2.
Verbose: Pre-authenticating to remote agent URL 'https://www.mysite.co.nz:8172/msdeploy.axd' as 'myuser'.
Info: Adding MSDeploy.dbDacFx (MSDeploy.dbDacFx).
Info: Adding database (data source=myserver;database=my.data;user id=sa)
Verbose: Waiting 120 seconds for the DACFx process to complete.
Verbose: The HTTP connection (ID='f1cb17ef-04f0-43f3-9759-e7ba58fba703', type ='GetTraceStatus') is being kept alive while the request is processed.
Verbose: The HTTP connection (ID='f1cb17ef-04f0-43f3-9759-e7ba58fba703', type ='GetTraceStatus') is being kept alive while the request is processed.
Verbose: Received response from agent (HTTP status 'OK').
Error Code: ERROR_CANNOT_PROCESS_DACPAC_OUTPUT
More Information: The output received from executing dacpac in a seperate process was not valid xml. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CANNOT_PROCESS_DACPAC_OUTPUT.
Error: Data at the root level is invalid. Line 20, position 10.
Error count: 1.
这一点花了很长时间才得到这一点,我不得不求助于通过命令嵌入用户名和密码而不是使用NTLM身份验证。现在有些东西得到了一些无效的XML,我不知道从哪里开始。
我尝试从Team City自动部署数据库更改。我们管理所有服务器,sqlpackage.exe更容易下注吗?
答案 0 :(得分:1)
我遇到了这个问题,最终导致了权限问题。
用户只有db_datareader,db_datawriter和execute。
我需要给SSDT用户db_owner,然后我才能解决这个错误。
答案 1 :(得分:1)
好的,我已经确认,一旦我从dacpac中删除了SqlCmd变量,它就开始给我有意义的回复。我怀疑@GrayPockets看到了与我相同的行为,只是出于不同的原因。
我已经能够成功部署dacpac,但是立即遇到了另一个障碍,因为我们无法使用MSDeploy为dbDacFx提供程序指定BlockOnPossibleDataLoss等选项。
所以,我觉得从技术上来说我已经回答了我的问题,但是我仍然要放弃MSDeploy,直到微软清理掉这些半实现的工具。