Azure SQL Dacpac任务中出现意外错误 [英] Unexpected error in Azure SQL Dacpac Task

查看:100
本文介绍了Azure SQL Dacpac任务中出现意外错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将架构更改部署到我们使用Azure SQL Dacpac Task暂存SQL Azure数据库时遇到错误:


2019-05-07T19:19:27.3692738Z ## [debug] Execute-Command: ***发生意外故障:发生一个或多个错误..

2019-05-07T19:19:27.3705603Z ## [debug]在D:\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -a538-4d2b-8589-1d37a9ab970f\1.3.16\SqlAzureActions.ps1:458 char:5

2019-05-07T19:19:27.3717034Z ## [debug] +      Execute-Command -FileName $ sqlPackagePath -Arguments $ sqlpackageA ...
$
2019-05-07T19:19:27.3728969Z ## [debug] +      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
$
2019-05-07T19:19:27.3741337Z ## [debug]    + CategoryInfo          :NotSpecified:(:) [Write-Error],WriteErrorException

2019-05-07T19:19:27.3752775Z ## [debug]    + FullyQualifiedErrorId:Microsoft.PowerShell.Commands.WriteErrorException,Execute-Command

2019-05-07T19:19:27.3764769Z ## [debug] 

2019-05 -07T19:19:27.3784625Z ## [debug]脚本堆栈跟踪:

2019-05-07T19:19:27.3824342Z ## [debug] at Execute-Command,D:\\ \\ _tasks \SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\Utility.ps1:line 276

2019-05-07T19:19:27.3835721Z ## [debug] at Execute-SqlPackage,D:\\\\\\\\\\\\\\\\\\\\\\\\ 19:27.3849833Z ## [debug] at Publish-Dacpac,D:\\\\_tasks \SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\SqlAzureActions.ps1:第186行
2019-05-07T19:19:27.3863605Z ## [debug] at< ScriptBlock> ;, D:\\\ tasks \SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f \ 1.3.16 \\D eploySqlAzure.ps1:行132

2019-05-07T19:19:27.3875314Z ## [debug] at< ScriptBlock>,< No file>:line 1

2019-05-07T19:19:27.3887807Z ## [debug] at< ScriptBlock>,< No file> ;: line 22

2019-05-07T19:19:27.3900455Z ## [debug] at< ScriptBlock>,< No file> ;:第18行

2019-05-07T19:19:27.3913209Z ## [debug] at< ScriptBlock>,< No file> ;:第1行

2019-05-07T19:19:27.3933528Z ## [debug]异常:
$
2019-05-07T19:19:27.3977486Z ## [调试] Microsoft.PowerShell.Commands.WriteErrorException:***发生意外故障:发生了一个或多个错误..


此版本在VS2017托管代理上执行: 


使用Visual Studio安装的Dac Framework在C:\Program Files(x86)\ Microsoft Visual Studio \\\ 2017 \ Enterprise机器fv-az381上的\Common7 \IDE \ Extensions \ Myscoft \ SQLDB \DAC \ 150'\\ _SqlPackage.exe

解决方案

< blockquote>

Hi Cenko2,


您能否验证在运行VS2017托管代理的主机上安装了哪个版本的SqlServer PowerShell模块?不确定以下cmdlet是否会帮助您,但您需要将您的环境升级到最新的

SqlServer
模块。

 Get-Module SqlServer -ListAvailable 

安装SQL Server Pow erShell模块


基于Microsoft.SQLServer.SMO版本v140的模块的最新版本是21.0.17279


最多该模块的当前版本基于Microsoft的版本v150.SMO是  21.1.18102


我意识到您正在使用兼容级别130但是您需要注意您正在使用的SQL Server版本。


我希望这会有所帮助。


When deploying schema changes into our staging SQL Azure database using Azure SQL Dacpac Task, we encountered the error:

2019-05-07T19:19:27.3692738Z ##[debug]Execute-Command : *** An unexpected failure occurred: One or more errors occurred..
2019-05-07T19:19:27.3705603Z ##[debug]At D:\a\_tasks\SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\SqlAzureActions.ps1:458 char:5
2019-05-07T19:19:27.3717034Z ##[debug]+     Execute-Command -FileName $sqlPackagePath -Arguments $sqlpackageA ...
2019-05-07T19:19:27.3728969Z ##[debug]+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-05-07T19:19:27.3741337Z ##[debug]    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
2019-05-07T19:19:27.3752775Z ##[debug]    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Execute-Command
2019-05-07T19:19:27.3764769Z ##[debug] 
2019-05-07T19:19:27.3784625Z ##[debug]Script stack trace:
2019-05-07T19:19:27.3824342Z ##[debug]at Execute-Command, D:\a\_tasks\SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\Utility.ps1: line 276
2019-05-07T19:19:27.3835721Z ##[debug]at Execute-SqlPackage, D:\a\_tasks\SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\SqlAzureActions.ps1: line 458
2019-05-07T19:19:27.3849833Z ##[debug]at Publish-Dacpac, D:\a\_tasks\SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\SqlAzureActions.ps1: line 186
2019-05-07T19:19:27.3863605Z ##[debug]at <ScriptBlock>, D:\a\_tasks\SqlAzureDacpacDeployment_ce85a08b-a538-4d2b-8589-1d37a9ab970f\1.3.16\DeploySqlAzure.ps1: line 132
2019-05-07T19:19:27.3875314Z ##[debug]at <ScriptBlock>, <No file>: line 1
2019-05-07T19:19:27.3887807Z ##[debug]at <ScriptBlock>, <No file>: line 22
2019-05-07T19:19:27.3900455Z ##[debug]at <ScriptBlock>, <No file>: line 18
2019-05-07T19:19:27.3913209Z ##[debug]at <ScriptBlock>, <No file>: line 1
2019-05-07T19:19:27.3933528Z ##[debug]Exception:
2019-05-07T19:19:27.3977486Z ##[debug]Microsoft.PowerShell.Commands.WriteErrorException: *** An unexpected failure occurred: One or more errors occurred..

The release is executed on VS2017 Hosted Agent: 

Dac Framework installed with Visual Studio found at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150\SqlPackage.exe on machine fv-az381

解决方案

Hi Cenko2,

Can you verify which version of the SqlServer PowerShell module you have installed on your host where the VS2017 Hosted Agent is running? Not sure if the below cmdlet will help you here but you need to potentially upgrade your environment to the latest SqlServer module.

Get-Module SqlServer -ListAvailable

Install SQL Server PowerShell module

The last version of the module based on version v140 of Microsoft.SQLServer.SMO is 21.0.17279

The most current version of the module is based upon version v150 of Microsoft.SQLServer.SMO is 21.1.18102

I realize you are working with a compatibility level of 130 but you need to be aware of the version of SQL Server you are working with.

I hope this helps.


这篇关于Azure SQL Dacpac任务中出现意外错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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