Azure Pipeline 在没有公共访问权限的服务器上运行 SQL
我们在 azure 中有一个 SQL 实例,直到最近才公开可用,并且根据 IP 白名单限制访问。我们最近勾选了“拒绝公共访问”复选框并为服务器设置了专用端点。
我们还在 azure devops 中构建和发布管道,它创建一个 SQL 实体框架迁移文件作为构建的一部分,并使用管理员凭据针对 SQL 运行它作为发布的一部分,这意味着我们可以在没有应用程序的情况下在数据库上应用迁移需要对数据库有超过基本的读/写访问权限。
我们遇到的问题是,当版本需要对数据库执行 SQL 时,它无法连接,我认为是因为构建代理位于我们的 vnet 之外。
我们正在考虑在 vnet 内创建我们自己的构建代理,并将其用于构建和构建。发布管道,我们有信心这将解决问题,但希望有其他选择(如果有)?
We have a SQL instance in azure which until recently was publicly available with access restricted based on IP whitelisting. We have recently ticked the "Deny public access" checkbox and set up private endpoints for the server.
We also have build and release pipelines in azure devops which create a SQL entity framework migration file as part of the build and run it against SQL as part of the release using admin credentials, this means that we can apply migrations on the database without the app needing to have more than basic read/write access to the database.
The problem that we have encountered is that when the release gets to the point of needing to execute the SQL against the database it cannot connect, I assume because the build agent is outside of our vnet.
We are looking at creating our own build agent inside the vnet and using this for the build & release pipelines, we are confident that this will resolve the issue but would like other options if there are any?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢5NRF和Ryu S.。将您的讨论作为答案发布以帮助其他社区成员。
参考:c创建自我托管代理,通过 VPN 从本地环境进行连接,
Thank you 5NRF and Ryu S.. Posting your discussions as answer to help other community members.
Reference: create self-hosted agent, Connecting from an on-premises environment over VPN,