This error message means that you were not able to reach the SQL Server instance you are trying to connect to. This could be because you have misspelled the server name, there are blocking firewalls etc.
As I understand it, you can connect to the database from Azure Data Studio, but your application cannot. That suggests that you need to review the connection string or any configuration file it may be reading from.