diff --git a/docs/database/includes/postgresql-explicit-username-password.md b/docs/database/includes/postgresql-explicit-username-password.md new file mode 100644 index 0000000000..809a1fe9a9 --- /dev/null +++ b/docs/database/includes/postgresql-explicit-username-password.md @@ -0,0 +1,15 @@ +When you want to explicitly provide the username and password, you can provide those as parameters. Consider the following alternative example: + +```csharp +var username = builder.AddParameter("username", secret: true); +var password = builder.AddParameter("password", secret: true); + +var postgres = builder.AddPostgres("postgres", username, password); + +var postgresdb = postgres.AddDatabase("postgresdb"); + +var exampleProject = builder.AddProject() + .WithReference(postgresdb); +``` + +For more information, see [External parameters](../../fundamentals/external-parameters.md). diff --git a/docs/database/mysql-component.md b/docs/database/mysql-component.md index 5b2b3ca40a..19fd1264b1 100644 --- a/docs/database/mysql-component.md +++ b/docs/database/mysql-component.md @@ -2,7 +2,7 @@ title: .NET Aspire MySQL database component description: This article describes the .NET Aspire MySQL database component. ms.topic: how-to -ms.date: 05/14/2024 +ms.date: 06/03/2024 --- # .NET Aspire MySQL database component @@ -69,6 +69,20 @@ var myService = builder.AddProject() .WithReference(mysqldb); ``` +When you want to explicitly provide a root MySQL password, you can provide it as a parameter. Consider the following alternative example: + +```csharp +var password = builder.AddParameter("password", secret: true); + +var mysql = builder.AddMySql("mysql", password); +var mysqldb = mysql.AddDatabase("mysqldb"); + +var myService = builder.AddProject() + .WithReference(mysqldb); +``` + +For more information, see [External parameters](../fundamentals/external-parameters.md). + ## Configuration The .NET Aspire MySQL database component provides multiple configuration approaches and options to meet the requirements and conventions of your project. diff --git a/docs/database/oracle-entity-framework-component.md b/docs/database/oracle-entity-framework-component.md index d5c85718d9..1847897253 100644 --- a/docs/database/oracle-entity-framework-component.md +++ b/docs/database/oracle-entity-framework-component.md @@ -1,7 +1,7 @@ --- title: Oracle Entity Framework Component description: Oracle Entity Framework Component -ms.date: 05/14/2024 +ms.date: 06/03/2024 --- # .NET Aspire Oracle Entity Framework Component @@ -86,6 +86,20 @@ var myService = builder.AddProject() .WithReference(oracledb); ``` +When you want to explicitly provide a password, you can provide it as a parameter. Consider the following alternative example: + +```csharp +var password = builder.AddParameter("password", secret: true); + +var oracle = builder.AddOracle("oracle", password); +var oracledb = oracle.AddDatabase("oracledb"); + +var myService = builder.AddProject() + .WithReference(oracledb); +``` + +For more information, see [External parameters](../fundamentals/external-parameters.md). + ## Configuration The .NET Aspire Oracle Entity Framework Core component provides multiple options to configure the database connection based on the requirements and conventions of your project. diff --git a/docs/database/postgresql-component.md b/docs/database/postgresql-component.md index a246f61788..7c243da0c0 100644 --- a/docs/database/postgresql-component.md +++ b/docs/database/postgresql-component.md @@ -1,7 +1,7 @@ --- title: .NET Aspire PostgreSQL component description: This article describes the .NET Aspire PostgreSQL component. -ms.date: 05/14/2024 +ms.date: 06/03/2024 ms.topic: how-to --- @@ -58,6 +58,8 @@ var exampleProject = builder.AddProject() .WithReference(postgresdb); ``` +[!INCLUDE [postgresql-explicit-username-password](includes/postgresql-explicit-username-password.md)] + ## Configuration The .NET Aspire PostgreSQL component provides multiple configuration approaches and options to meet the requirements and conventions of your project. diff --git a/docs/database/postgresql-entity-framework-component.md b/docs/database/postgresql-entity-framework-component.md index 907fdfb41f..a273f1e4f5 100644 --- a/docs/database/postgresql-entity-framework-component.md +++ b/docs/database/postgresql-entity-framework-component.md @@ -2,7 +2,7 @@ title: .NET Aspire PostgreSQL Entity Framework Core component description: This article describes the .NET Aspire PostgreSQL Entity Framework Core component. ms.topic: how-to -ms.date: 05/14/2024 +ms.date: 06/03/2024 --- # .NET Aspire PostgreSQL Entity Framework Core component @@ -72,6 +72,8 @@ var myService = builder.AddProject() .WithReference(postgresdb); ``` +[!INCLUDE [postgresql-explicit-username-password](includes/postgresql-explicit-username-password.md)] + ## Configuration The .NET Aspire PostgreSQL Entity Framework Core component provides multiple configuration approaches and options to meet the requirements and conventions of your project. diff --git a/docs/database/qdrant-component.md b/docs/database/qdrant-component.md index 091976973e..93e6171b0b 100644 --- a/docs/database/qdrant-component.md +++ b/docs/database/qdrant-component.md @@ -2,7 +2,7 @@ title: .NET Aspire Qdrant component description: This article describes the .NET Aspire Qdrant component. ms.topic: how-to -ms.date: 05/22/2024 +ms.date: 06/03/2024 --- # .NET Aspire Qdrant component @@ -75,6 +75,19 @@ var myService = builder.AddProject() .WithReference(qdrant); ``` +When you want to explicitly provide the API key, you can provide it as a parameter. Consider the following alternative example: + +```csharp +var apiKey = builder.AddParameter("apikey", secret: true); + +var qdrant = builder.AddQdrant("qdrant", apiKey); + +var myService = builder.AddProject() + .WithReference(qdrant); +``` + +For more information, see [External parameters](../fundamentals/external-parameters.md). + ## Configuration The .NET Aspire Qdrant Client component provides multiple options to configure the server connection based on the requirements and conventions of your project. diff --git a/docs/database/sql-server-component.md b/docs/database/sql-server-component.md index f1f226ec8c..b32cc42559 100644 --- a/docs/database/sql-server-component.md +++ b/docs/database/sql-server-component.md @@ -2,7 +2,7 @@ title: .NET Aspire SQL Server component description: This article describes the .NET Aspire SQL Server component. ms.topic: how-to -ms.date: 05/14/2024 +ms.date: 06/03/2024 --- # .NET Aspire SQL Server component @@ -71,6 +71,20 @@ var myService = builder.AddProject() .WithReference(sqldb); ``` +When you want to explicitly provide a root SQL password, you can provide it as a parameter. Consider the following alternative example: + +```csharp +var password = builder.AddParameter("password", secret: true); + +var sql = builder.AddSqlServer("sql", password); +var sqldb = sql.AddDatabase("sqldb"); + +var myService = builder.AddProject() + .WithReference(sqldb); +``` + +For more information, see [External parameters](../fundamentals/external-parameters.md). + ## Configuration The .NET Aspire SQL Server component provides multiple configuration approaches and options to meet the requirements and conventions of your project. diff --git a/docs/messaging/rabbitmq-client-component.md b/docs/messaging/rabbitmq-client-component.md index ece0b433a0..43711073f0 100644 --- a/docs/messaging/rabbitmq-client-component.md +++ b/docs/messaging/rabbitmq-client-component.md @@ -2,7 +2,7 @@ title: .NET Aspire RabbitMQ component description: Learn how to use the .NET Aspire RabbitMQ client message-broker component. ms.topic: how-to -ms.date: 05/14/2024 +ms.date: 06/03/2024 --- # .NET Aspire RabbitMQ component @@ -79,6 +79,21 @@ builder.AddProject() The method configures a connection in the `ExampleProject` project named `messaging`. +When you want to explicitly provide the username and password, you can provide those as parameters. Consider the following alternative example: + +```csharp +var username = builder.AddParameter("username", secret: true); +var password = builder.AddParameter("password", secret: true); + +var messaging = builder.AddRabbitMQ("messaging", username, password); + +// Service consumption +builder.AddProject() + .WithReference(messaging); +``` + +For more information, see [External parameters](../fundamentals/external-parameters.md). + ## Configuration The .NET Aspire RabbitMQ component provides multiple options to configure the connection based on the requirements and conventions of your project.