asp.net - Azure site only works when running locally with remote database -
i have site that's running off windows azure , have hooked database via linked resource , looks site should using database. i've included proper connection string in web.config file.
when run website locally , use azure database's connection string default connection, works , i've seen updating data local machine reflected in remote database.
whenever try access page makes database hits (ie, logging in or looking @ basic index (from scaffolded out views)), 500 error. tried turning on custom errors 500 error get. tried debug local machine didn't @ since worked when running site locally , connecting azure database.
i have pulled down web.config files , web.configs on both sides identical.
i figure has configuration issue, i'm not sure what.
is there maybe i'd have asp.net mvc 5 make work windows azure? looks .net framework set on azure .net 4.5. i'm guessing has fact azure doesn't know should using database supplied in web.config.
here web.config connection strings:
<add name="defaultconnection" connectionstring="data source=####.database.windows.net,1433;initial catalog=####_db;persist security info=true;user id=####;password=####" providername="system.data.sqlclient" /> <add name="defaultconnectiondeploy" connectionstring="data source=####.database.windows.net;initial catalog=####_db;persist security info=true;user id=####;password=####" providername="system.data.sqlclient" /> <add name="defaultconnection_databasepublish" connectionstring="data source=####.database.windows.net,1433;initial catalog=####_db;persist security info=true;user id=####;password=####" providername="system.data.sqlclient" />
windows azure makes use of transforms manage connection strings. connection strings merged in @ runtime, , can controlled configure tab on web site management page. whenever set azure database linked resource, automatically configures azure database server firewall rules allow connection web server, , adds connection string. using connection string, naming same string used in development, not necessary modify code prior deployment. if don't set azure database linked resource, necessary modify firewall rules hand, doesn't play nicely scalability of azure websites, it's not recommended.
Comments
Post a Comment