Azure SQL database refusing connection

Asked

Viewed 62 times

1

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

http://timesheetacs.azurewebsites.net/Login/Login

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" />

Trying to make the connection triggers this error:

The underlying Provider failed on Open

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

I also tried to connect debug the local application pointing to the database to find errors, but it just doesn’t trigger errors. The error is only occurring in the Azure environment.

What may be happening?

1 answer

1

Your string Connection really is very confusing. Take a look at it if you don’t have too much information.

The standard of Connection string 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 problem is solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.