我正在为 asp.net 应用程序设置管道。在集成测试任务期间,我需要连接到 SQL 服务器。我如何对管道说我需要 sql 服务?
我尝试了多个 microsoft 托管代理池(Windows Server 1803、Hosted 2017 和 2019)我使用 Windows Server 1803,问题是:
The operating system of the container does not match the operating system of the host.
我想正确设置一个临时 sql 服务器来运行测试。
我改用了localdb。
我在我的集成测试任务之前运行这个脚本
SqlLocalDB.exe create "DeptLocalDB"
SqlLocalDB.exe share "DeptLocalDB" "DeptSharedLocalDB"
SqlLocalDB.exe start "DeptLocalDB"
SqlLocalDB.exe info "DeptLocalDB"
要与 powershell 连接:Invoke-Sqlcmd -Query "SELECT GETDATE() AS TimeOfQuery;" -ServerInstance "(localdb)\.\DeptSharedLocalDB"
要连接 sqlcmd:sqlcmd -S (localdb)\.\DeptSharedLocalDB
要连接 ac# 应用程序(connectionString):"Data Source=(localdb)\.\DeptS
haredLocalDB;Initial Catalog=DeptLocalDB;Integrated Security=True;"
如果有人知道如何在 azure 管道上的容器中安装 sql 服务器,将不胜感激。感谢阅读