azure-devops - Azure DevOps 连接到 Azure SQL 连接字符串错误
问题描述
我正在尝试使用 Azure DevOps 创建解决方案。我需要使用发布/管道中的 Azure Powershell 任务创建与 Azure SQL 数据库的连接。在我的机器上,我可以使用以下方法实现这一点
function new-connection($ServerIsntance, $DatabaseName)
{
$obj = New-Object System.Data.SQLClient.SQLCommand
$obj.Connection = New-Object System.Data.SQLClient.SQLConnection
$obj.Connection.ConnectionString = "Server=tcp:$($ServerInstance),1433;Initial Catalog=$($DatabaseName);Persist Security Info=False;User Id=<username>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=Active Directory Password"
$obj.Connection.Open()
.....
}
但是,当我在 Azure DevOps 中使用此代码时,出现以下异常:##[error]Exception setting "ConnectionString": "Keyword not supported: 'authentication'."
我尝试使用的数据库是 AzureSQL 数据库,因此我无法使用Integrated Security = true
,因为它不受支持。你知道我应该如何面对这个问题吗?
解决方案
推荐阅读
- amazon-web-services - 未读取 API Gateway Authorization 中的标头
- r - 如何在R中绘制X轴
- python - 如何在python中实现字典学习和压缩感知来发出信号?
- unity3d - 将玩家速度整合到相机旋转中
- html - 如何做一个 AngularTS 工作搜索框?
- sql - 如何在 Informix 的 MERGE 语句中使用源参数?
- node.js - Mongoose 加载、限制和跳过两个集合中的数据
- sitecore - Sitecore 丢失了添加到 FullDescription 和 Description 字段的 br 标签
- python - 如何让对象被他的创造者改变
- angular - 在角度服务中读取 url 参数是一种好习惯吗?