I’m experiencing an issue with my web API connecting to an Azure SQL Managed Instance. Here’s the situation:
- Shared Hosting Server: My API runs on a shared hosting server. When I use the connection string for my Azure SQL Managed Instance, the connection fails.
- Azure App Service: I have another web API running as an Azure App Service, and it can connect to the same Azure SQL Managed Instance without any problems using the same connection string.
- AWS RDS: Previously, I used an AWS RDS instance, and my API on the shared hosting server connected without any issues, no additional configuration was necessary.
What I’ve checked so far:
- The connection string is correct and works from the Azure App Service.
- Firewall rules on the Azure SQL Managed Instance allow my shared hosting server’s IP.
- SSL/TLS settings in the connection string (included
Encrypt=True
).
What could be causing my shared hosting server to fail to connect to the Azure SQL Managed Instance, while the Azure App Service connects without issues? Are there specific configurations or settings I need to adjust in Azure?
Additional Details:
- Connection string example:
Server=tcp:myserver.database.windows.net,1433;Database=mydatabase;User ID=myuser@myserver;Password=mypassword;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
Any insights or suggestions would be greatly appreciated!