0

I have some REST APIs deployed to an app service an Azure.

I have added a hybrid connection to the app service, and deployed the hybrid connection manager to the relay server which I verified can connect to the DB. Both show as "connected".

I am having trouble configuring it, as it is my first attempt at this. I have 2 questions that if someone could I would be very grateful.

  1. The Hybrid Connection Endpoint host. Is this the DB server name, or name and instance?

The DB I want to connect to is on Server\Instance, but it will not allow the "\" at all in the name. I've tried just server, just instance, and IP, they all still gave the error "The server was not found or was not accessible".

  1. Is the problem with the REST services config? They are using the Entity Framework, and have the connection string:

    add name="WEBEntities" connectionString="metadata=res:///Models.WEB.csdl|res:///Models.WEB.ssdl|res://*/Models.WEB.msl;provider=System.Data.SqlClient;provider connection string="data source=server\instance;initial catalog=WEB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient"

Do I need to change this to point the Hybrid Connection instead? If so, how?

Thanks for any help, it's very appreciated.

J.Cart
  • 519
  • 1
  • 8
  • 19
  • 1
    It should be the dbserver name and port, without the instance name. – Sage Aug 24 '18 at 18:43
  • Thanks. I got it to connect and now I'm getting the error: "System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.) ---> System.ComponentModel.Win32Exception: An established connection was aborted by the software in your host machine" – J.Cart Aug 24 '18 at 19:14

1 Answers1

2

The host should be the FQDN of the server - e.g. server1.xyz.com. You can use a named instance but you must use a static port. Please review: https://learn.microsoft.com/en-us/azure/biztalk-services/integration-hybrid-connection-overview . You won't need to change your EF connection string if the hybrid connection is configured correctly.

Mehdi Ibrahim
  • 2,434
  • 1
  • 13
  • 13
  • 1
    Also, I noticed your using Integrated Security=true in your connection string. This will obviously not work for the Hybrid Connection. You should use a SQL username/password. That or a firewall issue may be causing the Win32 exception you're getting. – Mehdi Ibrahim Aug 24 '18 at 19:39
  • Ya I've changed it to a username/password. Now the error is: "System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.) ---> System.ComponentModel.Win32Exception: An established connection was aborted by the software in your host machine" – J.Cart Aug 24 '18 at 20:43
  • Ok good, at least the error is different so you're making progress. The new error appears to be firewall related. Did you open up the ports mentioned in the link posted above and follow all other configuration? What are you seeing in the event logs of your SQL Server host? – Mehdi Ibrahim Aug 24 '18 at 21:16
  • I'll have to check that on Monday as I'm not able to access the firewall unfortunately – J.Cart Aug 24 '18 at 21:26