.net - Azure: Login failed for user -


what have done:

  • i added resource group in azure.
  • added web service previous resource group.
  • added sql server database previous resource group.
  • retrieved generated connection string database , provided here username , password.
  • added connection string app settings in web service.
  • published app via visual studio.

problem: error when tries test hosted app in azure, on local version of app , connection string works fine..

server error in '/' application.  login failed user 'username'.  description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.   exception details: system.data.sqlclient.sqlexception: login failed user 'username'.  source error:   unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below.  stack trace:    [sqlexception (0x80131904): login failed user 'username'.]    system.data.sqlclient.sqlinternalconnectiontds..ctor(dbconnectionpoolidentity identity, sqlconnectionstring connectionoptions, sqlcredential credential, object providerinfo, string newpassword, securestring newsecurepassword, boolean redirecteduserinstance, sqlconnectionstring userconnectionoptions, sessiondata reconnectsessiondata, dbconnectionpool pool, string accesstoken, boolean applytransientfaulthandling) +1418    system.data.sqlclient.sqlconnectionfactory.createconnection(dbconnectionoptions options, dbconnectionpoolkey poolkey, object poolgroupproviderinfo, dbconnectionpool pool, dbconnection owningconnection, dbconnectionoptions useroptions) +470    system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnectionpool pool, dbconnection owningobject, dbconnectionoptions options, dbconnectionpoolkey poolkey, dbconnectionoptions useroptions) +70    system.data.providerbase.dbconnectionpool.createobject(dbconnection owningobject, dbconnectionoptions useroptions, dbconnectioninternal oldconnection) +777    system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection owningobject, dbconnectionoptions useroptions, dbconnectioninternal oldconnection) +114    system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, uint32 waitformultipleobjectstimeout, boolean allowcreate, boolean onlyonecheckconnection, dbconnectionoptions useroptions, dbconnectioninternal& connection) +1637    system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, taskcompletionsource`1 retry, dbconnectionoptions useroptions, dbconnectioninternal& connection) +117    system.data.providerbase.dbconnectionfactory.trygetconnection(dbconnection owningconnection, taskcompletionsource`1 retry, dbconnectionoptions useroptions, dbconnectioninternal oldconnection, dbconnectioninternal& connection) +267    system.data.providerbase.dbconnectioninternal.tryopenconnectioninternal(dbconnection outerconnection, dbconnectionfactory connectionfactory, taskcompletionsource`1 retry, dbconnectionoptions useroptions) +318    system.data.sqlclient.sqlconnection.tryopeninner(taskcompletionsource`1 retry) +132    system.data.sqlclient.sqlconnection.tryopen(taskcompletionsource`1 retry) +246    system.data.sqlclient.sqlconnection.open() +122    system.data.entity.infrastructure.interception.internaldispatcher`1.dispatch(ttarget target, action`2 operation, tinterceptioncontext interceptioncontext, action`3 executing, action`3 executed) +104    system.data.entity.infrastructure.interception.dbconnectiondispatcher.open(dbconnection connection, dbinterceptioncontext interceptioncontext) +509    system.data.entity.sqlserver.<>c__displayclass1.<execute>b__0() +15    system.data.entity.sqlserver.defaultsqlexecutionstrategy.execute(func`1 operation) +238    system.data.entity.sqlserver.sqlproviderservices.usingconnection(dbconnection sqlconnection, action`1 act) +331    system.data.entity.sqlserver.sqlproviderservices.usingmasterconnection(dbconnection sqlconnection, action`1 act) +916    system.data.entity.sqlserver.sqlproviderservices.getdbprovidermanifesttoken(dbconnection connection) +413    system.data.entity.core.common.dbproviderservices.getprovidermanifesttoken(dbconnection connection) +116  [providerincompatibleexception: provider did not return providermanifesttoken string.]    system.data.entity.core.common.dbproviderservices.getprovidermanifesttoken(dbconnection connection) +377    system.data.entity.utilities.dbproviderservicesextensions.getprovidermanifesttokenchecked(dbproviderservices providerservices, dbconnection connection) +35  [providerincompatibleexception: error occurred accessing database. means connection database failed. check connection string correct , appropriate dbcontext constructor being used specify or find in application's config file. see http://go.microsoft.com/fwlink/?linkid=386386 information on dbcontext , connections. see inner exception details of failure.]    system.data.entity.utilities.dbproviderservicesextensions.getprovidermanifesttokenchecked(dbproviderservices providerservices, dbconnection connection) +266    system.collections.concurrent.concurrentdictionary`2.getoradd(tkey key, func`2 valuefactory) +84    system.data.entity.utilities.dbconnectionextensions.getproviderinfo(dbconnection connection, dbprovidermanifest& providermanifest) +89    system.data.entity.dbmodelbuilder.build(dbconnection providerconnection) +63    system.data.entity.internal.lazyinternalcontext.createmodel(lazyinternalcontext internalcontext) +91    system.data.entity.internal.retrylazy`2.getvalue(tinput input) +227    system.data.entity.internal.lazyinternalcontext.initializecontext() +846    hakon.hamiltoncargo.web.ninjectwebcommon.initializedatabase() +111    hakon.hamiltoncargo.web.ninjectwebcommon.start() +124  [targetinvocationexception: exception has been thrown target of invocation.]    system.runtimemethodhandle.invokemethod(object target, object[] arguments, signature sig, boolean constructor) +0    system.reflection.runtimemethodinfo.unsafeinvokeinternal(object obj, object[] parameters, object[] arguments) +260    system.reflection.runtimemethodinfo.invoke(object obj, bindingflags invokeattr, binder binder, object[] parameters, cultureinfo culture) +146    system.reflection.methodbase.invoke(object obj, object[] parameters) +34    webactivatorex.baseactivationmethodattribute.invokemethod() +288    webactivatorex.activationmanager.runactivationmethods(boolean designermode) +785    webactivatorex.activationmanager.runprestartmethods(boolean designermode) +58    webactivatorex.activationmanager.run() +82  [invalidoperationexception: pre-application start initialization method run on type webactivatorex.activationmanager threw exception following error message: exception has been thrown target of invocation..]    system.web.compilation.buildmanager.invokeprestartinitmethodscore(icollection`1 methods, func`1 sethostingenvironmentcultures) +877    system.web.compilation.buildmanager.invokeprestartinitmethods(icollection`1 methods) +169    system.web.compilation.buildmanager.callprestartinitmethods(string prestartinitlistpath, boolean& isrefassemblyloaded) +133    system.web.compilation.buildmanager.executepreappstart() +176    system.web.hosting.hostingenvironment.initialize(applicationmanager appmanager, iapplicationhost apphost, iconfigmappathfactory configmappathfactory, hostingenvironmentparameters hostingparameters, policylevel policylevel, exception appdomaincreationexception) +734  [httpexception (0x80004005): pre-application start initialization method run on type webactivatorex.activationmanager threw exception following error message: exception has been thrown target of invocation..]    system.web.httpruntime.firstrequestinit(httpcontext context) +539    system.web.httpruntime.ensurefirstrequestinit(httpcontext context) +125    system.web.httpruntime.processrequestnotificationprivate(iis7workerrequest wr, httpcontext context) +731  version information: microsoft .net framework version:4.0.30319; asp.net version:4.6.1590.0 

the problem 2 keys in generated connection string microsoft.. must set "persist security info" , "trustservercertificate" keys value: "true".


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -