How to connect my Heroku hosted Node REST services to remote SQL? - node.js

Can anyone please tell me about how to connect REST based services on Heroku to a Linux based Remote SQL?
I'm new to hosting REST based services. I've created some REST services via Node.js and Express and I'm trying to connect those services with a remote SQL database on my hosting plan on https://ecowebhosting.co.uk.
But it always shows server closed the connection because it requires an IP address to setup a connection between server and heroku.

Related

How to connect Azure App Service Web App to Google SQL Server Database?

Due to what is happening right now in the world, azure seems to have run out of space. Currently, you cannot create a new SQL Server therefor no SQL Databases. Does anyone have experience or knowledge on how to Connect the Web App hosted on Azure to the GoogleSQL SQL Server? It's the only viable cloud service I found that can be free for some time until azure is back online. I cant figure out how to get the connection strings and how to allow connections etc. There is minimal documentation on SQL Server from googles side.
Thank you in advance,
Mike
For connect to Cloud SQL you need to enable the Public IP of your database and whitelist the Public IP of your Azure app to Allow connections between Azure app and Cloud SQL
The only way to connect to Cloud SQL from the external services is via IP connection in this document is explained step by step how to enable Public IP for your SQL server and how to whitelist the incoming IP addresses.
I found this article about how to create a connection string using public IP

Azure relay hybrid connection - multiple servers (one premise) one client

I want to build a service using Azure relay hybrid connection. The service will be downloaded by the customers and installed on their premise. The service itself is a server basically that will allow a client to connect to and get data from a database. I am following this scenario here : Azure Relay Hybrid Connection and works fine when you have one client and one server. My scenario is something like this (one client and many servers):
How can I build a dynamic server in such way that one client can connect to a specific server and get the data from the database?
I was thinking about having some config file that is generated when the customer downloads the server and the server will read the settings from the file, but still how do I connect to a specific server? Azure service bus topics and subscriptions work in similar way. Can this be achieved using the relay hybrid connections?

Connect nodeJs app to on-premise server using Secure Gateway

I'm trying to connect from a nodejs webapp to a REST api hosted on premise. I bounded a Secure Gateway instance and created a destination on port 80 to the machine where the SG client for RHEL 6 is running.
The request is still throwing a Timeout exception.
Do I have to modify the nodejs application code in any way or the SG should allow me to access the REST api transparently?
Your Node.js app needs to talk to the Secure Gateway service and not the API directly. Where you establish a connection to your on-premise API, replace the host name and port number with the cloud host name and port number that you were given when you created the destination.
There is an npm module to help your app obtain that host name and port - https://www.npmjs.com/package/bluemix-secure-gateway
And an example - https://www.ibm.com/blogs/bluemix/2015/04/reaching-enterprise-backend-bluemix-secure-gateway-via-sdk-api/

Cannot access on-premise Web API through Azure Hybrid connection

I deployed a web API at port 8090 on an on-prem server. Created a hybrid connection to on-prem server using port 8090. Status is connected. I deployed an Angular application as a Web App to Azure but AJAX request fails with "Name not resolved".
You need to use the fully qualified name of the server your application is hosted on, e.g. http://server.contoso.com/myservice rather than http://server/myservice as you would do locally.

How to run the Azure Cloud Service without using Sql Azure Database?

My azure application successfully running with azure sql database,but now i want to run Cloud application with my own database servers because of their data security. for this, we can establish the local database connection from our own systems with cloud application and connect to my database perfectly with following steps using below link,
http://www.codeproject.com/Articles/261063/Azure-Virtual-Network-Connecting-Local-Database
After this i deployed my application in to azure and it deployed without any error.but when i try to run my cloud application using cloud url like xxx.cloudapp.net getting an error like
"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: TCP Provider, error: 0 - The requested name is valid, but no data of the requested type was found.)".
Please give some suggestions why am getting this error.
Thanks,
PCSSCP.
Try connecting using SQL Management from another machine outside of your network. I believe that there is no problem with publication in Azure Cloud Service, but a connectivity problem with your SQL server.
Arthur Oliveira
You have to remote to VM and check SQL Server port is opened or not, the same with SQL Server machine. I used to connect local DB with cloud based application.
This is an intermittent issue with the SQL Server.
Check this link if it helps,
IntermittentSQLServerIssue

Resources