简体   繁体   English

.NET 上 Azure 数据库的弹性查询

[英]Elastic Query for Azure Databases on VNET

We have a couple of databaes on Azure which query back and forth between themselves using elastic query and also sp_execute_remote .我们在 Azure 上有几个数据库,它们使用弹性查询和sp_execute_remote在它们之间来回查询。 We wanted to move these databases onto a .NET and provide a private endpoint for App Services to use it.我们想将这些数据库移动到 .NET 上,并为 App Services 提供一个专用端点以使用它。 That part proved relatively easy and we have our app service able to talk to these databases no problem.这部分证明相对容易,我们的应用程序服务能够毫无问题地与这些数据库对话。 However it seems like when we established the connection and turned off public access to the database our external tables stopped being accessible.然而,当我们建立连接并关闭对数据库的公共访问时,我们的外部表似乎停止了访问。

Running a select * from externaltable now results in an error like this: select * from externaltable现在会导致如下错误:

Msg 46823, Level 16, State 1, Line 1
Error retrieving data from xxxxxxxxxxxx.database.windows.net.yyyyyyyyyy.  The underlying error message received was: 'Reason: An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes (https://learn.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://learn.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database).'.

I suspect that these requests are still being routed to the public endpoint and that SQL server is not observing the .NET routing to the other servers via the private endpoint.我怀疑这些请求仍在路由到公共端点,而 SQL 服务器没有观察到通过专用端点到其他服务器的 .NET 路由。 Is there a way to get this to work?有没有办法让它工作? For the app service we set WEBSITE_.NET_ROUTE_ALL but I don't imagine there is an exact parallel there for SQL server.对于应用程序服务,我们设置了WEBSITE_.NET_ROUTE_ALL但我不认为 SQL 服务器有一个完全平行的地方。

How can I enable .net and private endpoints while still being able to do elastic query?如何启用 .net 和专用端点,同时仍然能够进行弹性查询?

Because the Azure SQL is not actually within your .NET - only the Private Link part - when it tries to go to the second database it isn't coming from a valid IP Address.因为 Azure SQL 实际上不在您的 .NET 中 - 只有专用链接部分 - 当它尝试 go 到第二个数据库时,它不是来自有效的 IP 地址。

This is still a missing part of the puzzle with Private Link I believe.我相信这仍然是 Private Link 难题的缺失部分。

Have you tried keeping "Allow Access to Azure Services" on - this may still conflict with the Private Link configuration and is not a valid option if your aim is to lock down access to only the specific .NET.您是否尝试过打开“允许访问 Azure 服务”——这可能仍然与专用链接配置冲突,并且如果您的目标是仅锁定对特定 .NET 的访问权限,则该选项无效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM