With Azure, Remote connection to SQL server database through AWS works locally, but not when deployed

0

Here is the connection string I am using in the webconfig file.

 <add name="NBAdatabase" connectionString="Data Source=fipsfseed.crgivfdotoce.us-east- 
 2.rds.amazonaws.com,1433;Initial Catalog=NBAreseeded;User ID=asfsADMIN;Password=645afsw;" providerName="System.Data.SqlClient"/>

This works fine locally. However, when I publish it to Azure, I get this error when going to a page that involves a database hit.

[Win32Exception (0x80004005): Access is denied]

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]

I've googled and youtubed and tried a lot of things so far I've found here, but nothing seems to work.

The SQL Server Express database is hosted through Amazon AWS and remote connections are allowed. I'm only having this problem when it's deployed to the web server.

That login info is has been disguised.

sql-server
asp.net-mvc
azure
asked on Stack Overflow Nov 5, 2019 by Jason

2 Answers

0

From the docs, You need to enable the following

Step 1 : Sign in to the Azure portal.

Step 2 : Then navigate the portal to SQL servers > Firewall / Virtual Networks.

Step 3 : Set the Allow access to Azure services control to OFF.**

enter image description here

answered on Stack Overflow Nov 5, 2019 by Sajeetharan
0

I figured it out. A youtube revealed that I needed to created a security group for inbound the RDS instance in the aws console.

answered on Stack Overflow Nov 5, 2019 by Jason

User contributions licensed under CC BY-SA 3.0