0
I am getting the following error in my application that is hosted on aws
Sqlexception: 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. (Preview: Named Pipes Provider, error: 40 - Could not open a Connection to SQL Server)
Invalidoperationexception: An Exception has been Raised that is likely due to a Transient Failure. Consider enabling Transient error resiliency by Adding 'Enableretryonfailure()' to the 'Usesqlserver' call.
This error apparently is because of the instance of the database, but the strange thing is that by SQL SERVER MANAGEMENT I can use the database correctly, and only in the web application that is giving this error, you know what I can do ?
Application is in Elastic Beanstalk and the seat is in RDS in aws
My Connection:
"Data Source=mydbdevkonbaseinstance.codi6jnwlp6k.sa-East-1.rds.amazonaws.com,1433;Initial Catalog=*******;Integrated Security=False;User ID=*********;Password=*************;Connect Timeout=30;Encrypt=False;Trustservercertificate=True;Applicationintent=Readwrite;Multisubnetfailover=False"
Is the database on the same server as the application? How is the connection string? Give more details...
– Jéf Bueno
@LINQ I put in question
– Matheus
Please specify in the question which are your Subnets (Subnets) and Security groups (Security Groups). As a temporary solution you can add the IP address of Elaticbeanstalk EC2 in the RDS Security group. More details in the AWS English documentation about connecting a Beanstalk instance to RDS: https://docs.aws.amazon.com/pt_br/elasticbeanstalk/latest/dg/AWSHowTo.RDS.html#rds-External-defaultvpc Here’s how to encode in c# to access a RDS instance: https://docs.aws.amazon.com/pt_br/elasticbeanstalk/latest/dg/create_deploy_NET.rds.html#dotnet-rds-connect
– Rafael Gorski