Skip to content

✅ Merge main into live #1173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/database/azure-cosmos-db-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: .NET Aspire Azure Cosmos DB component
description: This article describes the .NET Aspire Azure Cosmos DB component features and capabilities.
ms.topic: how-to
ms.date: 06/05/2024
ms.date: 06/28/2024
---

# .NET Aspire Azure Cosmos DB component
Expand Down Expand Up @@ -114,7 +114,7 @@ The recommended connection approach is to use an account endpoint, which works w
```json
{
"ConnectionStrings": {
"cosmosConnectionName": "https://{account_name}.documents.azure.com:443/"
"cosmosConnectionName": "https://{account_name}.documents.azure.com:443/"
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/database/mysql-entity-framework-component.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: MySQL Entity Framework Component
description: MySQL Entity Framework Component
ms.date: 06/05/2024
ms.date: 06/28/2024
---

# .NET Aspire Pomelo MySQL Entity Framework Component
Expand Down Expand Up @@ -94,7 +94,7 @@ And then the connection string will be retrieved from the `ConnectionStrings` co

The `EnrichMySqlDbContext` won't make use of the `ConnectionStrings` configuration section since it expects a `DbContext` to be registered at the point it is called.

See the [MySqlConnector documentation](https://mysqlconnector.net/connection-options/) for more information on how to format this connection string.
For more information, see the [MySqlConnector documentation](https://mysqlconnector.net/connection-options/).

### Use configuration providers

Expand Down
4 changes: 2 additions & 2 deletions docs/database/oracle-entity-framework-component.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Oracle Entity Framework Component
description: Oracle Entity Framework Component
ms.date: 06/03/2024
ms.date: 06/28/2024
---

# .NET Aspire Oracle Entity Framework Component
Expand Down Expand Up @@ -126,7 +126,7 @@ And then the connection string will be retrieved from the `ConnectionStrings` co

The `EnrichOracleDatabaseDbContext` won't make use of the `ConnectionStrings` configuration section since it expects a `DbContext` to be registered at the point it is called.

See the [ODP.NET documentation](https://www.oracle.com/database/technologies/appdev/dotnet/odp.html) for more information on how to format this connection string.
For more information, see the [ODP.NET documentation](https://www.oracle.com/database/technologies/appdev/dotnet/odp.html).

### Use configuration providers

Expand Down
4 changes: 3 additions & 1 deletion docs/database/postgresql-component.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: .NET Aspire PostgreSQL component
description: This article describes the .NET Aspire PostgreSQL component.
ms.date: 06/05/2024
ms.date: 06/28/2024
ms.topic: how-to
---

Expand Down Expand Up @@ -86,6 +86,8 @@ And then the connection string will be retrieved from the `ConnectionStrings` co
}
```

For more information, see the [ConnectionString](https://www.npgsql.org/doc/connection-string-parameters.html).

### Use configuration providers

The .NET Aspire PostgreSQL component supports <xref:Microsoft.Extensions.Configuration?displayProperty=fullName>. It loads the <xref:Aspire.Npgsql.NpgsqlSettings> from _:::no-loc text="appsettings.json":::_ or other configuration files by using the `Aspire:Npgsql` key. Example _:::no-loc text="appsettings.json":::_ that configures some of the options:
Expand Down
26 changes: 24 additions & 2 deletions docs/database/postgresql-entity-framework-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 06/05/2024
ms.date: 06/28/2024
---

# .NET Aspire PostgreSQL Entity Framework Core component
Expand Down Expand Up @@ -82,6 +82,28 @@ var myService = builder.AddProject<Projects.MyService>()

The .NET Aspire PostgreSQL Entity Framework Core component provides multiple configuration approaches and options to meet the requirements and conventions of your project.

### Use a connection string

When using a connection string from the `ConnectionStrings` configuration section, you provide the name of the connection string when calling `AddNpgsqlDbContext`:

```csharp
builder.AddNpgsqlDbContext<MyDbContext>("myConnection");
```

The connection string is retrieved from the `ConnectionStrings` configuration section:

```json
{
"ConnectionStrings": {
"myConnection": "Host=myserver;Database=test"
}
}
```

The `EnrichNpgsqlDbContext` won't make use of the `ConnectionStrings` configuration section since it expects a `DbContext` to be registered at the point it is called.

For more information, see the [ConnectionString](https://www.npgsql.org/doc/connection-string-parameters.html).

### Use configuration providers

The .NET Aspire PostgreSQL Entity Framework Core component supports <xref:Microsoft.Extensions.Configuration?displayProperty=fullName>. It loads the <xref:Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.NpgsqlEntityFrameworkCorePostgreSQLSettings> from configuration files such as _:::no-loc text="appsettings.json":::_ by using the `Aspire:Npgsql:EntityFrameworkCore:PostgreSQL` key. If you have set up your configurations in the `Aspire:Npgsql:EntityFrameworkCore:PostgreSQL` section you can just call the method without passing any parameter.
Expand Down Expand Up @@ -115,7 +137,7 @@ builder.AddNpgsqlDbContext<YourDbContext>(
static settings => settings.ConnectionString = "YOUR_CONNECTIONSTRING");
```

### Configure multiple DBContext classes
### Configure multiple DbContext classes

If you want to register more than one <xref:Microsoft.EntityFrameworkCore.DbContext> with different configuration, you can use `$"Aspire:Npgsql:EntityFrameworkCore:PostgreSQL:{typeof(TContext).Name}"` configuration section name. The json configuration would look like:

Expand Down
28 changes: 24 additions & 4 deletions docs/database/sql-server-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 06/05/2024
ms.date: 06/28/2024
---

# .NET Aspire SQL Server component
Expand Down Expand Up @@ -91,6 +91,26 @@ For more information, see [External parameters](../fundamentals/external-paramet

The .NET Aspire SQL Server component provides multiple configuration approaches and options to meet the requirements and conventions of your project.

### Use a connection string

When using a connection string from the `ConnectionStrings` configuration section, you provide the name of the connection string when calling `AddSqlServerClient`:

```csharp
builder.AddSqlServerClient("myConnection");
```

The connection string is retrieved from the `ConnectionStrings` configuration section:

```json
{
"ConnectionStrings": {
"myConnection": "Data Source=myserver;Initial Catalog=master"
}
}
```

For more information, see the [ConnectionString](/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring#remarks).

### Use configuration providers

The .NET Aspire SQL Server supports <xref:Microsoft.Extensions.Configuration?displayProperty=fullName>. It loads the `MicrosoftDataSqlClientSettings` from configuration files such as _:::no-loc text="appsettings.json":::_ by using the `Aspire:SqlServer:SqlClient` key. If you have set up your configurations in the `Aspire:SqlServer:SqlClient` section, you can just call the method without passing any parameter.
Expand All @@ -116,7 +136,7 @@ The following example shows an _:::no-loc text="appsettings.json":::_ file that
You can also pass the `Action<MicrosoftDataSqlClientSettings>` delegate to set up some or all the options inline, for example to turn off the `DisableMetrics`:

```csharp
builder.AddSqlServerSqlClientConfig(
builder.AddSqlServerClient(
static settings => settings.DisableMetrics = true);
```

Expand All @@ -139,10 +159,10 @@ If you want to add more than one `SqlConnection` you could use named instances.
}
```

To load the named configuration section from the json config call the `AddSqlServerSqlClientConfig` method by passing the `INSTANCE_NAME`.
To load the named configuration section from the json config call the `AddSqlServerClient` method by passing the `INSTANCE_NAME`.

```csharp
builder.AddSqlServerSqlClientConfig("INSTANCE_NAME");
builder.AddSqlServerClient("INSTANCE_NAME");
```

### Configuration options
Expand Down
24 changes: 23 additions & 1 deletion docs/database/sql-server-entity-framework-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: .NET Aspire SqlServer Entity Framework Core component
description: This article describes the .NET Aspire SQL Server Entity Framework Core component.
ms.topic: how-to
ms.date: 06/05/2024
ms.date: 06/28/2024
---

# .NET Aspire SqlServer Entity Framework Core component
Expand Down Expand Up @@ -74,6 +74,28 @@ var myService = builder.AddProject<Projects.MyService>()

The .NET Aspire SQL Server Entity Framework Core component provides multiple configuration approaches and options to meet the requirements and conventions of your project.

### Use connection string

When using a connection string from the `ConnectionStrings` configuration section, you provide the name of the connection string when calling `builder.AddSqlServerDbContext<TContext>()`:

```csharp
builder.AddSqlServerDbContext<MyDbContext>("myConnection");
```

The connection string is retrieved from the `ConnectionStrings` configuration section:

```json
{
"ConnectionStrings": {
"myConnection": "Data Source=myserver;Initial Catalog=master"
}
}
```

The `EnrichSqlServerDbContext` won't make use of the `ConnectionStrings` configuration section since it expects a `DbContext` to be registered at the point it's called.

For more information, see the [ConnectionString](/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring#remarks).

### Use configuration providers

The .NET Aspire SQL Server Entity Framework Core component supports <xref:Microsoft.Extensions.Configuration?displayProperty=fullName>. It loads the <xref:Aspire.Microsoft.EntityFrameworkCore.SqlServer.MicrosoftEntityFrameworkCoreSqlServerSettings> from configuration files such as _:::no-loc text="appsettings.json":::_ by using the `Aspire:Microsoft:EntityFrameworkCore:SqlServer` key. If you have set up your configurations in the `Aspire:Microsoft:EntityFrameworkCore:SqlServer` section you can just call the method without passing any parameter.
Expand Down
Binary file removed docs/messaging/media/vscode-select-worker.png
Binary file not shown.
20 changes: 10 additions & 10 deletions docs/reference/aspire-faq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ metadata:
title: Frequently asked questions about .NET Aspire
description: Answers to some of the most common questions and scenarios for .NET Aspire.
ms.topic: faq
ms.date: 05/18/2024
ms.date: 06/28/2024
title: Frequently asked questions about .NET Aspire
summary: |
This article lists frequently asked questions about .NET Aspire. For a more comprehensive overview, see [.NET Aspire overview](../get-started/aspire-overview.md).
Expand Down Expand Up @@ -36,12 +36,8 @@ sections:
- question: |
Why is there a need for yet another framework to do what's already being done very well by everyone else?
answer: |
.NET Aspire isn't a framework. Perhaps the most controversial parts of it are the `DistributedApplication` APIs that you can use to build up the orchestration model in any .NET-based language. While everything is possible today, it's not easy. Using the Unix philosophy, the entire cloud-native ecosystem is built around tying various pieces of CNCF software together to build a stack. .NET Aspire tries to do the same thing using learnings from the cloud-native space and picks some opinions (in ways that use the same building blocks). One novel thing about how .NET Aspire builds various pieces of the stack is that it doesn't restrict the access or compatibility of other applications, frameworks, or services. As people play with it more, they realize how composable and extensible it is.
.NET Aspire isn't a framework, it's an [opinionated stack](../get-started/aspire-overview.md). Perhaps the most controversial parts of it are the `DistributedApplication` APIs that you can use to build up the orchestration model in any .NET-based language. While everything is possible today, it's not easy. Using the Unix philosophy, the entire cloud-native ecosystem is built around tying various pieces of CNCF software together to build a stack. .NET Aspire tries to do the same thing using learnings from the cloud-native space and picks some opinions (in ways that use the same building blocks). One novel thing about how .NET Aspire builds various pieces of the stack is that it doesn't restrict the access or compatibility of other applications, frameworks, or services. As people play with it more, they realize how composable and extensible it is.

- question: |
When will .NET Aspire be released?
answer: |
.NET Aspire was [officially released](https://devblogs.microsoft.com/dotnet/dotnet-aspire-general-availability/) May 21st, 2024 to general availability (GA). Stay up to day with development and new releases on [official .NET Aspire repository](https://github.com/dotnet/aspire).
- question: |
What's the difference between .NET Aspire and Microsoft Orleans?
answer: |
Expand All @@ -50,6 +46,7 @@ sections:
[Orleans](/dotnet/orleans) is a distributed actor-based framework. .NET Aspire is a cloud-ready stack for building observable, production-ready, distributed applications. It includes local orchestration capabilities to simplify the developer inner loop and reusable opinionated components for integrating with commonly used application dependencies. An Orleans-based solution will still have external dependencies such as data stores and caches for which .NET Aspire can be used for orchestration purposes.

For more information, see [Use Orleans with .NET Aspire](../frameworks/orleans.md) and the corresponding [Orleans voting app sample](/samples/dotnet/aspire-samples/orleans-voting-sample-app-on-aspire/).

- question: |
What's the difference between .NET Aspire and Dapr?
answer: |
Expand All @@ -58,32 +55,35 @@ sections:
Where Dapr abstracts some of the underlying cloud platform, .NET Aspire provides opinionated configuration around the underlying cloud technologies without abstracting them. A .NET-based application that uses Dapr can use .NET Aspire to orchestrate the local developer inner loop and streamline deployment. .NET Aspire includes extensions that support the launching of Dapr side-car processes during the inner loop.

For more information, see [Use Dapr with .NET Aspire](../frameworks/dapr.md) and the corresponding [Dapr sample app](https://github.com/dotnet/aspire-samples/tree/main/samples/AspireWithDapr) in the .NET Aspire sample repository.

- question: |
What's the difference between .NET Aspire and Project Tye?
answer: |
Project Tye was an experiment which explored the launching and orchestration of micro-services and support
deployment into orchestrators such as Kubernetes. .NET Aspire is a superset of Tye which includes the
orchestration and deployment capabilities along with opinionated components for integrating common
cloud-native dependencies. .NET Aspire can be considered the evolution of the Project Tye experiment.

- question: |
What's the relationship between .NET Aspire and the Azure SDK for .NET?
answer: |
.NET Aspire provides components that rely on the [Azure SDK for .NET](/dotnet/azure/intro), to expose common functionality for storage ([Azure Blob Storage](../storage/azure-storage-blobs-component.md), [Azure Storage Queues](../storage/azure-storage-queues-component.md), and [Azure Table Storage](../storage/azure-storage-tables-component.md)), databases ([Azure Cosmos DB](../database/azure-cosmos-db-component.md) and [Azure Cosmos DB with Entity Framework Core](../database/azure-cosmos-db-entity-framework-component.md)), [messaging](../messaging/azure-service-bus-component.md), and [security](../security/azure-security-key-vault-component.md).

- question: |
What's the relationship between .NET Aspire and Kubernetes?
answer: |
.NET Aspire makes it easy to develop distributed applications that can be orchestrated on your local development environment as executables and containers. Kubernetes is a technology that orchestrates and manages containers across multiple machines. .NET Aspire projects can produce a [manifest](../deployment/manifest-format.md) that tool authors can use to produce artifacts for deployment to Kubernetes. In essence, Kubernetes is a deployment target for .NET Aspire projects.

- question: |
Are worker services supported in .NET Aspire?
answer: |
Due to a deployment related bug, preview 1 of .NET Aspire doesn't support deployment of worker services.
Yes, worker services are fully supported and there are docs and samples available to help you get started. Worker services are a great way to run background tasks, scheduled tasks, or long-running tasks in .NET Aspire. For more information, see [Database migrations with Entity Framework Core sample app](/samples/dotnet/aspire-samples/aspire-efcore-migrations/).

As a workaround consider deploying a web application as a worker which is not exposed to the internet. We are currently tracking this issue and plan to have it resolved for preview 2 (see [GitHub issue](https://github.com/dotnet/aspire/issues/743)).
- question: |
Are Azure Functions supported in .NET Aspire?
answer: |
We have no specific support for Azure Functions in preview 1 of .NET Aspire however it's a target
execution environment for deployment that we are planning to support in future previews.
We have no specific support for Azure Functions thus far in .NET Aspire, however it's a target
execution environment for deployment that we are planning to support in future.

additionalContent: |

Expand Down
Loading
Loading