Description: Some ADO.NET code to test a connection
string conn = "Data Source=.;Initial Catalog=MarketIndexData;Integrated Security=True;";
using (SqlConnection connection = new SqlConnection(conn))
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from AssetPrices";
cmd.Connection = connection;
SqlDataReader rdr = cmd.ExecuteReader();
catch (Exception ex)
string s = ex.Message;
Figure: Low Level ADO.NET Code
Place the code in your code behind of your webform or mvc app
Make sure you have [NT AUTHORITY\NETWORK SERVICE] as an account. If you don’t, right mouse click on “Logins” and add it.
Figure Logins in SSMS
Go to “User Mapping.” Notice that I was way too liberal. I chose all my databases and gave multiple roles to each database. But then again, there is no production data here anywhere.
Figure: User Mapping – SQL Server
Type “inetmgr” in the run window. Click on “Application Pools.” Notice that the identity is “Network Service.”
What is the funky app pool identity running as “NetworkService?”
Looks to me that that when I installed Azure SDK 1.3, the system added a new app pool for my cloud apps to run in in the local development fabric.
Figure Internet Information Manager (inetmgr.exe)
Start SQL Server Management Studio and grant privileges to the newly added “Network Service” account.
Figure: SQL Server Management Studio