question

ArchiShah-3614 avatar image
0 Votes"
ArchiShah-3614 asked Lawrence080-MSFT answered

Azure app-service taking longer to execute query on on-prem SQL server with hybrid connection.

Hello, I have a c# .NET core app-service on azure which uses on premise SQL Server. I have used hybrid connection to connect to the database. The issue on app service is, the query takes too long to run on app-service. However, while running the query on-prem, it runs quickly. Could you suggest me possible fixes for the same?

azure-webapps-hybrid-connection
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How should we recommend you something if we don't know any details about your application and/or environment?

If I recommend you to speed up or increaseyour network speed because it is too slow then it is a total guess as we don't know anything about your connection.
We don't know how your setting up the connection, we don't know anything about your code or statement or even your table structures...

So how should we - with your given information - recommend you something.

Sorry.

0 Votes 0 ·

In addition, @ArchiShah-3614, hybrid connections work over Azure Relay. So, when it comes to isolating latency, I would advise enabling Application Insights auto-instrumentation. This guide will walk you through how to utilize that telemetry to investigate you issue.


0 Votes 0 ·

1 Answer

Lawrence080-MSFT avatar image
0 Votes"
Lawrence080-MSFT answered

Hi @ArchiShah-3614 ,

Thank you for submitting your question to Microsoft Q&A.

Queries running faster on-prem compared to in the cloud is expected. In on-prem scenarios the queries are running directly against the database within your dedicated network. Requests take longer running inside the cloud as it involves our network and communication between datacenters and services.

You can try and reduce the execution time by:

  • Placing your resources in the same region

  • Creating a dedicated connection from the on-prem server to the app service (if current connection method is public)

x

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.