简体   繁体   English

如何从 Azure 应用服务中托管的 API 应用程序连接到 AWS 中托管的 SQL 数据库

[英]How to connect to SQL database hosted in AWS from API application hosted in Azure App Service

I hosted my .Net Core(3.1) WebAPI application in Azure App Service(Linux OS) and I have created a Virtual Machine (with Windows 2012 Server OS) in AWS and installed the MS SQL Server我在 Azure 应用服务(Linux 操作系统)中托管了我的 .Net Core(3.1) WebAPI 应用程序,并且我在AWS 中创建了一个虚拟机(使用 Windows 2012 Server 操作系统)并安装了 MS SQL Server

While I am trying to communicate with API to SQL Database it was throwing 502 Bad Gateway errors当我尝试与 SQL 数据库的 API 通信时,它抛出了 502 Bad Gateway 错误

Could some one suggest me how to achieve this functionality?有人可以建议我如何实现这一功能吗?

You need to setup a security group and open up inbound and outbound ports in AWS.您需要在 AWS 中设置一个安全组并打开入站和出站端口。

Only after your sql server port is opened you can connect to your server from Azure.只有在您的 sql server 端口打开后,您才能从 Azure 连接到您的服务器。

If you are using MySql which uses 3306 port by default (you need to change this for security reasons), you need to open up 3306 to receive and throw bytes.如果您使用的是默认使用 3306 端口的 MySql(出于安全原因,您需要更改此设置),您需要打开 3306 以接收和抛出字节。

For more info you can refer this link .有关更多信息,您可以参考此链接

暂无
暂无

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

相关问题 如何将托管的Web应用程序与本地数据库连接? - How to connect a hosted Web Application with a local database? API 托管在 Azure 但数据库托管在我们的网络中 - API Hosted in Azure but Database is Hosted in our Network 如何通过IIS 7.5上托管的RESTful WCF服务从iPhone应用程序将数据输入SQL数据库 - How to enter data into SQL database from an iPhone app Via RESTful WCF service hosted on IIS 7.5 如何从托管在 Azure 应用服务中的 .Net Framework Asp.Net 应用程序访问 Azure KeyValut? - How do I access an Azure KeyValut from an .Net Framework Asp.Net application hosted in an Azure App Service? 通过Windows Store应用连接到Azure托管的SQL DB - Connect to a SQL DB hosted on azure through a windows store app 无法使用SQL身份验证从IIS托管应用程序连接到SQL Server数据库 - Unable to connect to SQL Server database from IIS hosted application using SQL authentication 无法从IIS托管的应用程序连接到远程REST服务 - Unable to connect to the remote REST service from the IIS-hosted application 如果 web 应用程序托管在 azure 应用程序服务上,如何读取证书 - how to read certificate if web app is hosted over azure app service 从 Azure 应用服务到 Azure VM 上托管的 API 的 API 调用--错误尝试以访问权限禁止的方式访问套接字 - API call from Azure App Service to API hosted on Azure VM --Error An attempt was made to access a socket in a way forbidden by its access permissions 从Visual Studio Online缩减Azure中托管的SQL数据库的规模 - Downscale an sql database hosted in Azure from Visual studio online
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM