Login failed for user 'sa' when creating the db in Chapter 5 #192
Replies: 2 comments 1 reply
-
I missed updating the readme file here. With a previous Aspire version we had to set the password (and retrieve it using the secrets) and need to pass it to the app model for the database. With the changes it's simpler now. |
Beta Was this translation helpful? Give feedback.
-
I already had password with SQL updated in the book and in samples, thus it was working as expected. I've added more details to the readme file of chapter 5. Running the application with this configuration: var sqlServer = builder.AddSqlServer("sql")
.WithDataVolume("codebreaker-sql-data", isReadOnly: false)
.AddDatabase("CodebreakerSql"); Creates a volume with a random password. This only works once, because next time a new password is created, and this does not match the one stored. Setting Another option is to retrieve the password from parameters, and pass it to the var sqlPassword = builder.AddParameter("SqlPassword", secret: true);
var sqlServer = builder.AddSqlServer("sql", sqlPassword)
.WithDataVolume("codebreaker-sql-data", isReadOnly: false)
.AddDatabase("CodebreakerSql"); Here, the configuration I hope this helps. Converting this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Could not connect to the db via Azure Data Studio either with the same error.
After some digging I went to inspect the container and checked the MSSQL_SA_PASSWORD value. It was completely different from the one in the instructions MSSQL_SA_PASSWORD=Pa$$w0rd. Once you use the password form the container - it seems to be working fine.
Beta Was this translation helpful? Give feedback.
All reactions