Entity Framework Unexpectedly attempts to connect to the Master database with the context username but with a blank password.

Richard Hanby 1 Reputation point
2021-12-23T16:54:48.177+00:00

When my webapp builds I'm recently experiencing error 18456 with state 123 as Entity Framework is attempting to connect to the MASTER database, but it isn't providing a password.
This is a new issue, previously we recognised that the app was trying to connect to master so we have granted it connect permission.

I can see from logs in Azure SQL that the connection is coming from our web servers and the username is as expected but for some reason, when the app compiles it attempts connections to master with no password.

We have made no changes to auth on the DB, no changes to packages are evident to blame like ASP.NET Identity, all DB Contexts are set to throw UnintentionalCodeFirstExceptions() as we're using DB first for all our work.

Are there any known reasons why EF6.1.3 would attempt master DB connections with a blank password?
Blank password is an assumption based on the error state which is described in docs as blank pw or username, and the username is present in the logs.

Replicating this by attempting logins in SSMS with a blank password confirm the same error code and state can be achieved.

Any assistance.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,456 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Richard Hanby 1 Reputation point
    2022-02-02T11:42:57.55+00:00

    Upgrading the package to 6.4.4 stopped the issue occurring.

    0 comments No comments