Search code examples
azureazure-sql-databasevisual-studio-2022ef-core-2.1

Azure Database database is slow when locally debugging in VS 2022


I'm working on an issue with my team where we are using Azure SQL Database as a service.

In one example:

  • Connecting to azure database via azure app service: call takes 350 ms
  • Connecting to azure database via VS 2022 on our work computers: call takes 2.5 seconds
  • Connecting to a bacpac database (from the azure database) locally on sql server on our work computers: call takes 350 milliseconds

Things we have done:

  • Change the pricing tier from elastic pool to Standard S2: 50 DTUs -> still the same slowness
  • Changed the location of the azure database
  • Optimized some of the calls (helps, but we still see a big difference between local db and azure database)

We believe it could have something to do with the overall specific call to the server where we are making X calls to the database and opening a connection for each one?

Still doesn't seem to make sense of why it works so fast locally, but then when we connect to the azure database while developing it is so slow.

Also, it seems that this USE to not be the issue. We thought maybe a change in our work VPN could have caused it, but we've tested off the VPN and the issue still is slow connecting to the azure database.

Any thoughts?


Solution

  • Solution:

    The issue was tied to our company work VPN.

    A split-tunnel was setup to resolve the issue for the workstation to azure db traffic. (It is not evaluated via the VPN network now).