Connect to on-prem sql server using Azure Relay

Santhi Dhanuskodi 325 Reputation points
2024-04-01T07:44:00.09+00:00

Hi,

I would like to connect to a on-prem sql server and execute T-SQL commands to listen and receive SQL broker messages from Azure cloud hosted .net application.

How can i connect to on-prem sql server and execute these sql commands and receive the responses? Looking for solutions and sample code.

I have connection string specified in my .net app...how should I change my connection string or any other code?

My current code in.net (without any relay/hybrid connection)is in below picture. Should I modify this code if I use hybrid connection/Azure Relay? or it is only a configuration required at azure rely and hybrid connections?

User's image

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,944 questions
Azure Fluid Relay
Azure Fluid Relay
An Azure service used to add real-time collaborative experiences to apps with Fluid Framework.
5 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
102 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,662 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 67,251 Reputation points
    2024-04-01T15:41:21.96+00:00

    only the connection string is modified to the relay endpoint.


  2. Bruce (SqlWork.com) 67,251 Reputation points
    2024-04-09T19:54:02.98+00:00

    for an azure app to connect to you on-prem sqlserver, you need a network connection between them. you have several options:

    note: none these solutions magically turn your sqlserver in a http api server.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.