简体   繁体   English

Azure 应用服务连接到 Azure Sql 数据库

[英]Azure App Service connecting to Azure Sql Database

I have a Web App (Azure App Service) and I have an Azure SQL Database that this Web App talks to.我有一个 Web 应用程序(Azure 应用程序服务),我有一个与此 Web 应用程序通信的 Azure SQL 数据库。 I have two questions regarding communication between the two.关于两者之间的沟通,我有两个问题。

  1. When connecting from the Web App to the Database (using the connection string), does the communication go out to the internet and then back into Azure or does Azure know to keep the traffic locally in Azure?当从 Web 应用程序连接到数据库时(使用连接字符串),通信是先传到 Internet 然后再返回到 Azure 还是 Azure 知道将流量本地保留在 Azure 中?

  2. I have been looking into V-Net Service Endpoints as a possible way to improve speed of communication between the two.我一直在研究 V-Net 服务端点作为提高两者之间通信速度的一种可能方式。 It is said that when connecting from a VM on V-Net with Service Endpoints enabled to a SQL Database, that Azure knows to keep the traffic internal to the Azure network and not go out to the internet, is this the same for Azure App Services?据说当从启用了服务端点的 V-Net 上的 VM 连接到 SQL 数据库时,Azure 知道将流量保持在 Azure 网络内部而不是出去到 Internet,这对于 Azure 应用服务是否相同?

  3. Is it possible to keep traffic between an App Service and SQL Database internal to Azure?是否可以将应用服务和 SQL 数据库之间的流量保持在 Azure 内部?
    If so, how do I go about doing this?如果是这样,我该怎么做?

    Any guidance on this is greatly appreciated.任何关于这方面的指导都非常感谢。

  1. It knows to keep it local on the "Azure backbone" (as per Azure doco).它知道将其本地保存在“Azure 主干”上(按照 Azure doco)。 It doesn't go out to the public internet它不会出现在公共互联网上

  2. Yes是的

  3. Yes.是的。 It is already internal to the "Azure Backbone"它已经在“Azure Backbone”内部

Having said that.... networks are really complicated.话虽如此……网络真的很复杂。

As I understand it the main benefit of V-Net is that you can define your own network and add things to it like firewalls, security groups, subnets, peering between networks.据我了解,V-Net 的主要好处是您可以定义自己的网络并向其中添加诸如防火墙、安全组、子网、网络之间的对等连接等内容。 Also it helps when setting up a hybrid network - ie connecting Azure resources to an on-premises network.在设置混合网络时也有帮助 - 即将 Azure 资源连接到本地网络。 When you can set up the same kind of structures as on premise, it's easier to 'transparently' make it part of the on-premises network.当您可以设置与内部部署相同类型的结构时,更容易“透明地”使其成为内部部署网络的一部分。 Lastly (rereading the doco), you can remove any incoming public IP firewall rules.最后(重读 doco),您可以删除任何传入的公共 IP 防火墙规则。 These are "Azure backbone" IP addresses but they are also "public internet" addresses这些是“Azure 主干”IP 地址,但它们也是“公共互联网”地址

There may be a performance improvement if the App Service and Azure SQL are on the same V-Net.如果应用服务和 Azure SQL 在同一个 V-Net 上,性能可能会有所提升。

Azure SQL service endpoints are a bit mysterious. Azure SQL 服务端点有点神秘。 They "connect" to the VNET but you still need to connect to a public address.它们“连接”到 VNET,但您仍然需要连接到公共地址。 They don't actually take a up a local IP adress.他们实际上并不占用本地 IP 地址。

Depending on what you are really doing, you might want to look into private endpoint, which actually assigns a private IP to your Azure SQL.根据您的实际操作,您可能需要查看私有端点,它实际上为您的 Azure SQL 分配了一个私有 IP。

是的,Azure 应用服务和 Azure SQL 数据库之间的通信是 Azure 虚拟网络中的“本地”通信,不会传到公共 Internet。

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

相关问题 Azure 应用服务 SQL 数据库备份失败 - Azure App Service SQL Database Backup Fails 连接到Azure移动服务数据库时出现SQL异常 - Sql Exception when connecting to Azure Mobile Service database 连接到SQL Azure数据库时出错 - Error connecting to SQL Azure Database 使用 Z23EEEB4347BDD26BDDFC6B7EE 从 Azure 机器学习服务连接 Azure SQL 数据库时出错 - Error in connecting Azure SQL database from Azure Machine Learning Service using python 在 Python 中从桌面应用程序连接到 Azure SQL 数据库:使用 Azure AD 进行授权 - Connecting to Azure SQL database from desktop app in Python: authorization with Azure AD Azure 应用服务 (ASE) SQL Azure 连接 - Azure app service (ASE) SQL Azure connection Azure 应用服务身份验证 - SQL 数据库客户端分片 - Azure App service authentication - SQL database client sharding 从本地WCF连接到Azure SQL数据库 - Connecting to Azure SQL database from local WCF 将 Web 应用程序连接到 Azure VM 上的 SQL Server - Connecting web app to SQL Server on Azure VM 为什么我的 Azure 应用服务备份无法连接到我的 Azure SQL 数据库? - Why can't my Azure app service backup connect to my Azure SQL database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM