1

I'm following this guide building a new core version of my current mvc 5 website. I have an existing sql database hosted on azure and I want to build the project database first. I followed the instructions but on the "reverse engineer you model" part I keep getting an error:

System.AggregateException: One or more errors occurred. (Login failed for user 'removed'.) ---> System.Data.SqlClient.SqlException: Login failed for user 'removed'.

The username and password are correct and working on the current project. This is the connection string:

Scaffold-DbContext "Server=tcp:removed.database.windows.net,1433;
  Data Source=removed.database.windows.net;Initial Catalog=removedCatalog;
  Persist Security Info=False;User ID=removedId@removed;Password=removedPass;
  Pooling=False;MultipleActiveResultSets=False;Encrypt=True;
  TrustServerCertificate=False;Connection Timeout=30;"
   Microsoft.EntityFrameworkCore.SqlServer

Any insight to what am I missing here?

7
  • This link could help: stackoverflow.com/questions/3674160/… Two things to check are that the server name/IP in the connection string must exactly match the server name/IP in the certificate (@Moriarty) and @Vort3x made a point about servers with default certificates changing when they are restarted. Commented May 28, 2016 at 4:30
  • Things is, I can connect to it via VS Server Explorer with the same credentials. Also, the local version of the online site connects to the db with this exact connection string. So I believe it's something with the import proccess, not the string or the server. Commented May 28, 2016 at 4:38
  • 1
    That makes sense. Good luck! Commented May 28, 2016 at 5:01
  • Did this error occur when running "Scaffold-DbContext" command or somewhere else? I just tried that command and it works on my side. Commented May 31, 2016 at 4:27
  • it happens when I write it as is in the console Commented May 31, 2016 at 4:59

1 Answer 1

1

Make sure that the user exist on SQL Server, that the user is enabled, and has access (mapped) to the correct database.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.