Skip to content

Commit

Permalink
Removed unused sqlpassword variable from code and text (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
Banovvv authored Jan 24, 2024
1 parent 69e6c30 commit 73a26ae
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
var builder = DistributedApplication.CreateBuilder(args);

var sqlpassword = builder.Configuration["sqlpassword"];

var sql = builder.AddSqlServer("sql")
.AddDatabase("sqldata");

Expand Down
8 changes: 1 addition & 7 deletions docs/database/sql-server-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,7 @@ Replace the contents of the _Program.cs_ file in the _AspireSQLEFCore.AppHost_ p

:::code language="csharp" source="snippets/tutorial/AspireSQLEFCore/AspireSQLEFCore.AppHost/Program.cs":::

The preceding code adds a SQL Server Container resource to your app and configures a connection to a database called `sqldata`. The Entity Framework classes you configured earlier will automatically use this connection when migrating and connecting to the database. The `sqlpassword` variable represents the password for the default database user in the SQL Server container.

Set a `sqlpassword` key in the [user secrets](/aspnet/core/security/app-secrets) store of the _AspireSQLEFCore.AppHost_ project using the `dotnet user-secrets` command in the AppHost project directory. Passwords must meet the [Password Policy](/sql/relational-databases/security/password-policy#password-complexity) complexity requirements.

```dotnetcli
dotnet user-secrets set sqlpassword <password>
```
The preceding code adds a SQL Server Container resource to your app and configures a connection to a database called `sqldata`. The Entity Framework classes you configured earlier will automatically use this connection when migrating and connecting to the database.

## Run and test the app locally

Expand Down

0 comments on commit 73a26ae

Please sign in to comment.