How to fix "login failed for user" when manipulating SQL database in Azure from a .NET Core webapp? azure entity-framework-core sql


I have an SQL Database in Azure and a .Net Core web app in which I would like to manipulate the database using Entity Framework Core.

I believe I have all the model, data and controller classes needed for this, and I have a few sample objects I'd like to see in my database.

My problem is that no matter what I do or how I want to manipulate the database, I always get the error "login failed for user", yet the login info is an admin and I believe I set up everything that is needed.

I see the database in the SQL Server Object Explorer, I can connect to it using SSMS or simply on the Azure Portal, and there seems to be no problem with my connection string. The username&password combo is fine, I've checked it multiple times, my IP is enabled in the firewall of the database, I have no idea what could be the problem, please help me!

Here is the error: enter image description here

5/1/2018 3:34:40 PM

Popular Answer

The problem is solved now, it was a very tiny, stupid error:

the connection string I copied from the Azure site was waiting for an escaped field, assuming I won't write my username and password manually, which of course won't be happening in the future, I just wanted to test if the whole stuff worked as this is my first project in this area.

So the Azure connection string looked like this: USER={XY};PASSWORD={ASD} but I left the curly brackets in the string even though I didn't use a variable there.

1/11/2020 8:22:40 PM

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow