通过VS Team Service发布管理进行部署后,SQL连接错误 [英] SQL connection error after deploying through VS team service release management

本文介绍了通过VS Team Service发布管理进行部署后,SQL连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过VS团队服务构建为我的WebAPI项目设置了构建,以进行持续集成,并且我正在使用VS团队服务发布管理持续部署到Azure Web App.在构建或发布时没有出现任何错误,但是当我尝试通过招摇访问Apis时,出现与SQL Server建立连接时发生了与网络相关或特定于实例的错误".

这是我在VSTS版本定义中作为连接字符串的内容 -connectionString @ {"xxxx" =服务器= tcp:xxxx.database.windows.net,1433;数据库= xxxxdb;用户ID = xxxxdbuser @ xxxx;密码= xxxx; Trusted_Connection = False;加密= True;"}

这是我第一次尝试设置CI/CD,希望能对您有所帮助.

非常感谢

解决方案

我必须在Web.config中创建一个未命名为defaultConnection的连接字符串,并将其命名为与VSTS版本定义相同的名称.

I have setup build for my WebAPI project through VS team service Builds for continuous integration and I am using VS team service release management continuous deployment to Azure Web App. I am not getting any errors while build or release however when I try to access my Apis through swagger, I get "A network-related or instance-specific error occurred while establishing a connection to SQL Server".

Here is what I have as a connection string in VSTS release definition -connectionString @{"xxxx"="Server=tcp:xxxx.database.windows.net,1433;Database=xxxxdb;User ID=xxxxdbuser@xxxx;Password=xxxx;Trusted_Connection=False;Encrypt=True;"}

This is my first attempt to setup CI/CD and I would appreciate any help.

Many thanks

解决方案

I had to create a connection string in my Web.config which is not named as defaultConnection and name it same as in my VSTS release definition.

这篇关于通过VS Team Service发布管理进行部署后,SQL连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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