title: Access denied from website to database hosted in MS Azure
body: <p>I got a simple website hosted on SmarterAsp.net.
  The database is hosted on MS Azure.
  When I try to log in the app and connect to the db, I got Access is denied error.</p>
  
  <blockquote>
    <p>[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - Access is denied.)]</p>
  </blockquote>
  
  <p>Yes, I allowed the website's IP address in the db's firewall settings.
  The connection string on the website looks like this:</p>
  
  <blockquote>
    <p>Data Source=sasdb.database.windows.net,1433;Initial Catalog=SaSDB;Persist Security Info=True;User ID=XXX;Password=XXX</p>
  </blockquote>
  
  <p>I am not sure what else to check apart from the allowed IP addresses..
  Thank you
  Petr</p>
  
  <p>EDIT:
  Ok, so the site is <a href="http://speakasspeaker.info/" rel="nofollow">http://speakasspeaker.info/</a> there is a test button on the main page called Test, when I click it, it should just return some row count from the database. I went to Azure, get a new connection string which looks like this:</p>
  
  <blockquote>
    <p>Server=tcp:sasdb.database.windows.net,1433;Data Source=sasdb.database.windows.net;Initial Catalog=SaSDB;Persist Security Info=False;User ID=XXX;Password=XXX;Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;</p>
  </blockquote>
  
  <p>Now I got new error</p>
  
  <blockquote>
    <p>The network path was not found</p>
  </blockquote>
  
  <p>When you click the button it will show you the stack trace..
  Thanks</p>