SQL Azure database refusing connection

1

I'm having trouble connecting the SQL Azure database through a web application published at this address:

link

This is the connection string:

<add name="Entities" connectionString="metadata=res://*/Context.ControleHorasContext.csdl|res://*/Context.ControleHorasContext.ssdl|res://*/Context.ControleHorasContext.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=srvdbacs2.database.windows.net;initial catalog=dbTimesheet;persist security info=True;user id=acensao@srvdbacs2;password=####;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Attempting to connect causes this error:

  

The underlying provider failed on Open

But when trying to connect through SQL Management Studio, it works perfectly.

I've also tried connecting debug to the local application pointing to the azure database to find errors, but it just does not trigger errors. The error is only occurring in the Azure environment.

What could be happening?

    
asked by anonymous 14.01.2017 / 12:30

1 answer

1

Your connection string is really confusing. Take a look at it if you do not have too much information.

The connection string pattern for Azure SQL is

Server=tcp:[serverName].database.windows.net;Database=myDataBase;
User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;
Encrypt=True;

Replace with this and see if the issue is resolved.

    
16.01.2017 / 11:26