I have an Azure SQL Database and some C# line of business applications that use it. I have been working to reduce the attack surface and understand the performance better.
In the SQL Azure contained database I have:
1) A SQL Authentication user with a login called 'ReaderUser', with a fixed long and crazy password.
2) Users created in the database without login using: CREATE USER [] WITHOUT LOGIN
3) Tables with data, secured by USER and Row Level Security. ReaderUser cannot access any of the data, it is merely a "Proxy" user.
4) ReaderUser can impersonate any other non-administrative user (of the variety created "without login"). Data is only ever read by any of them.
When our developed application/s are accessed by users, the database connection is made with ReaderUser. Applications use a .Net 4.6.2 ADO.net connection. The connection string is encrypted and fixed. I.e. it doesn’t change for any user, they all use the same connection string.
When an application user signs in, the logged in application identity (Active Directory UPN) is then passed to the database to set the correct user context using:
EXECUTE AS USER = 'myuser@mydomain.com' WITH NO REVERT;
Users then access the application and only see their data, as constrained by the row level security.
My question is, how will the connections be pooled? Will they be pooled per user or per the ReaderUser login (connection string)? Users may connect from multiple applications simultaneously using the same connection string. I have surfed around a few articles but I can't get a clear explanation on this specific scenario. Can anyone shed some light?