[英]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 以接收和抛出字节。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.