asp.net mvc - Azure and SQL Server: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server -


using azure sql server. in 30% of cases simpleroleprovider implicitly called error: named pipes provider, error: 40 - not open connection sql server. error occurs not reproducible. looks timeout..

[authorize(roles = "administrator")] public class admincontroller : controller {    ... } 

the stack trace looks like:

[win32exception (0x80004005): access denied] 

[sqlexception (0x80131904): network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)] system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection, action1 wrapcloseinaction) +5296071 system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean asyncclose) +558 system.data.sqlclient.tdsparser.connect(serverinfo serverinfo, sqlinternalconnectiontds connhandler, boolean ignoresniopentimeout, int64 timerexpire, boolean encrypt, boolean trustservercert, boolean integratedsecurity, boolean withfailover) +5308555 system.data.sqlclient.sqlinternalconnectiontds.attemptonelogin(serverinfo serverinfo, string newpassword, securestring newsecurepassword, boolean ignoresniopentimeout, timeouttimer timeout, boolean withfailover) +145 system.data.sqlclient.sqlinternalconnectiontds.loginnofailover(serverinfo serverinfo, string newpassword, securestring newsecurepassword, boolean redirecteduserinstance, sqlconnectionstring connectionoptions, sqlcredential credential, timeouttimer timeout) +889 system.data.sqlclient.sqlinternalconnectiontds.openloginenlist(timeouttimer timeout, sqlconnectionstring connectionoptions, sqlcredential credential, string newpassword, securestring newsecurepassword, boolean redirecteduserinstance) +307 system.data.sqlclient.sqlinternalconnectiontds..ctor(dbconnectionpoolidentity identity, sqlconnectionstring connectionoptions, sqlcredential credential, object providerinfo, string newpassword, securestring newsecurepassword, boolean redirecteduserinstance, sqlconnectionstring userconnectionoptions) +434 system.data.sqlclient.sqlconnectionfactory.createconnection(dbconnectionoptions options, dbconnectionpoolkey poolkey, object poolgroupproviderinfo, dbconnectionpool pool, dbconnection owningconnection, dbconnectionoptions useroptions) +225 system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnectionpool pool, dbconnectionoptions options, dbconnectionpoolkey poolkey, dbconnectionoptions useroptions) +37 system.data.providerbase.dbconnectionpool.createobject(dbconnectionoptions useroptions) +558 system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnectionoptions useroptions) +67 system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, uint32 waitformultipleobjectstimeout, boolean allowcreate, boolean onlyonecheckconnection, dbconnectionoptions useroptions, dbconnectioninternal& connection) +1052 system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, taskcompletionsource1 retry, dbconnectionoptions useroptions, dbconnectioninternal& connection) +78 system.data.providerbase.dbconnectionfactory.trygetconnection(dbconnection owningconnection, taskcompletionsource1 retry, dbconnectionoptions useroptions, dbconnectioninternal& connection) +167 system.data.providerbase.dbconnectionclosed.tryopenconnection(dbconnection outerconnection, dbconnectionfactory connectionfactory, taskcompletionsource1 retry, dbconnectionoptions useroptions) +143 system.data.sqlclient.sqlconnection.tryopen(taskcompletionsource`1 retry) +83 system.data.sqlclient.sqlconnection.open() +96 system.web.dataaccess.sqlconnectionholder.open(httpcontext context, boolean revertimpersonate) +88 system.web.dataaccess.sqlconnectionhelper.getconnection(string connectionstring, boolean revertimpersonation) +239 system.web.security.sqlroleprovider.getrolesforuser(string username) +762 webmatrix.webdata.simpleroleprovider.getrolesforuser(string username) +54 system.web.security.roleprincipal.isinrole(string role) +9461104

we don't have problem on our own server. configuration issue? using free trail version of azure yet.

--- addition ---

the bad thing mvc-framework "handles" request, in example given (role management). use of framework add abstraction layer handle "domain request" conveniently. in case?

thanks in advance help!

i assume azure , sql server mean saas azure sql database (the names change faster can keep track), not iaas sql server on windows azure. first thing ou need determine wether application being throttled, see connection constraints , give article good, thorrough read: causes of connection termination. if application being throttled need revisit design , address specific reason why you're being throttled.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -