0

I have the following appsettings.json file, with the connection string taken from my Azure SQL database dashboard:

{
    "ConnectionStrings": 
    {
        "DefaultConnection": "Server=tcp:xxxxx.database.windows.net,1433;Initial Catalog=xxxxx;Persist Security Info=False;User ID=xxxxx;Password=xxxxxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=60;"
    },
    "Logging": {
        "LogLevel": {
            "Default": "Information",
            "Microsoft": "Warning",
            "Microsoft.Hosting.Lifetime": "Information"
        }
    },
    "AllowedHosts": "*"
}

which seems not to work. Is there some more specific formatting it has to undergo?

1 Answer 1

1

Without having the exact information on the error that you are getting and the place where you are trying to use the connection string, first thing I would check is, if the development mode is enabled and if it is looking for an "appsettings.Development.json" file.

If this is not what it is, please update the question with the error that you are getting with the exact line where you are getting the error.

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

2 Comments

That's the issue, I can't seem to find any error messages. And I know for sure there is data in the table etc. Thanks for the dev-mode tip, will check it out!
You might find the error in the debug console output window of whichever code editor you are using VS or VSCode.

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.