2

I wrote an app and I am trying upload it on Azure. The app runs ok locally and has a SQL Server database as the backend; the app is based off MVC.

When I try to access a page such as /person, I get this error:

Azure Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'null'.

Anyone ever dealt with such an error and how did you resolve it.

I have tried a few suggestions but none seems to work:

  • adding to config file
  • setting Persist Security Info=False to true

What is the best way to solve this?

1 Answer 1

3

On the app's data connection, the connection string had no userid. Adding a userid fixed the issue. Even though when the app was published with a proper connection string, the user id was empty.

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

3 Comments

Thanks for posting! I had the same problem. I didn't realize that azure managed connection strings. I thought whatever I pushed out in my web.config got used.
Where is this dataconnection string? I have the proper connection string in the web.config file as well as in the azure portal.
I've been using Azure web apps and azure sql databases for years and this is the first time I have experiences this user null issue. I have not prepared my publish or even publish to azure differently than before.

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.