AAD Auth with Azure SQL Server is not using connection pool. RRS feed

  • Question

  • Hi,

    I am using AAD token based authentication with sql server to open connection.

    I am able connect to db. I did some load test with 50 user/5 mins. It is creating new connections/sessions for each request. Here it should use connection pool as i am using same connection string for each request.

    Is this behavior by design?



    Monday, May 21, 2018 6:47 PM


All replies

  • Hi Ashutosh,

    The connection pool is per (Connection String,AppDomain). Each Server might have multiple AppDomains. And each AppDomain will have one connection pool per connection string. So here if you have different user/password combos, they will generate different connection pools.

    Tuesday, May 22, 2018 12:00 AM
  • Actually i am using aad cert based to get token. Same token is used to get sql connection for all request till token expire. token expire time is 1 hr. 

    For each db hit using aad auth, it is creating new connection and session. So suppose there is 100 request with same connection string with same token then it is creating 100 connections and 100 sessions.

    Tuesday, May 22, 2018 4:00 AM

    I have used above approach.

    Tuesday, May 22, 2018 4:03 AM
  • Issue has been resolved. I was calling get token method inline with sql connection. When i moved method to constructor. It is not creating new connection/sessions.
    Thursday, May 24, 2018 9:13 AM
  • @Ashutoshks, Good hear that your problem is solved now and thanks for updating the forum with the solution that did the trick.
    Thursday, May 24, 2018 10:20 AM