I am unable to access SQL Azure DB from Azure website even though same connection string works from local website. The error is as follows:
System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'XYZ'.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,
Boolean breakConnection, Action`1 wrapCloseInAction) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,
Boolean callerHasConnectionLock, Boolean asyncClose) <...>
Error Number:18456,State:1,Class:14 <...>
After checking previous answers,
- I have made added my database to my website's linked resources on Azure portal.
I have added 0.0.0.0 - 255.255.255.255 range to my firewall exclusion listNot needed!- I have made sure that my connection string usage does not allow any ambiguity.
- I have made sure that
ApplicationDbContext
is built using correct connection string.
What else I could try?
The website code is here.