sqlpackage DeployReport xml corrupted

arielman2304 676 Reputation points
2021-06-10T11:39:22.387+00:00

Hi
I'm running the below command using powershell script:

$sqlpackagereport = Start-Process -FilePath sqlpackage.exe -ArgumentList '/Action:DeployReport','/SourceFile:"Database Services\bin\Release\Database Services.dacpac"',"/TargetServerName:${Env}","/TargetDatabaseName:${Target}","/OutputPath:Report.xml" -wait -PassThru -Credential $Cred
$sqlpackagereport.WaitForExit()
$sqlpackagereport

but when I'm trying to open Report.xml in the server, I get this exception:

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
<DeploymentReport xmlns="http://schemas.microsoft.com/sqlserver/dac/DeployReport/2012/02">
<Alerts/>
...
</DeploymentReport>
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,656 questions
{count} votes

2 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,786 Reputation points Microsoft Vendor
    2021-06-11T03:32:11.22+00:00

    Hi @arielman2304 ,

    > "/OutputPath:Report.xml"

    I am not familiar with powershell. Did the file location for storing XML report is correct? The location did not point a folder, only report file name.

    OutputPath – The path where the XML report will be stored after it is generated

    If we using cmd, below is an example to general XML report.

    104547-screenshot-2021-06-11-113046.jpg

    You can try to use cmd to explore actions and tasks in the SQLPackage, please refer to the blog Exploring actions and tasks in the SQLPackage Utility to get detail example information.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.


  2. CathyJi-MSFT 21,786 Reputation points Microsoft Vendor
    2021-06-14T10:08:21.257+00:00

    Hi @arielman2304 ,

    > I just tested it without powershell, and I got empty xml

    Using cmd?

    > sqlpackage /action:DeployReport /SourceFile:"Database Services\bin\Debug\Database Services.dacpac" /TargetServerName:TEST05,123 /TargetDatabaseName:test /OutputPath:"DeployReport.xml"

    Why the source file location and output path location did not point to a folder? Try to add like C:\ or D:\ in the file location.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.