Skip to content

Commit

Permalink
Merge pull request #94 from dotnet/main
Browse files Browse the repository at this point in the history
Merge `main` into `live`
  • Loading branch information
IEvangelist authored Nov 27, 2023
2 parents 7fec254 + 9013eb7 commit 8e5e08b
Show file tree
Hide file tree
Showing 31 changed files with 74 additions and 73 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ updates:
open-pull-requests-limit: 5
- package-ecosystem: "nuget"
directory: "/docs/get-started/snippets/quickstart/AspireSample/AspireSample.ServiceDefaults" #AspireSample.ServiceDefaults.csproj
ignore:
- dependency-name: "Microsoft.Extensions.ServiceDiscovery"
versions: ["*"]
- dependency-name: "Microsoft.Extensions.Http.Resilience"
versions: ["*"]
schedule:
interval: "weekly"
day: "wednesday"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/live-protection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
env:
SHOULD_COMMENT: ${{ github.base_ref == 'refs/heads/live' && !(github.event.issue.user.login == 'cxwtool' || github.head_ref == 'refs/heads/main') }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-main-to-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Create pull request
uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
retries: 3
script: |
Expand Down
10 changes: 5 additions & 5 deletions docs/caching/quickstart-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Visual Studio creates a new .NET Aspire solution that consists of the following

## Configure the UI with output caching

1. Add the [.NET Aspire StackExchange Redis output caching](/aspire/caching/stackexchange-redis-output-caching-component) component packages to your `AspireStorage` app:
1. Add the [.NET Aspire StackExchange Redis output caching](stackexchange-redis-output-caching-component.md) component packages to your `AspireStorage` app:

```dotnetcli
dotnet add package Aspire.StackExchange.Redis.OutputCaching --prerelease
Expand Down Expand Up @@ -73,19 +73,19 @@ dotnet add package Aspire.StackExchange.Redis.OutputCaching --prerelease
```razor
@page "/"
@attribute [OutputCache(Duration = 10)]

<PageTitle>Home</PageTitle>

<h1>Hello, world!</h1>

Welcome to your new app on @DateTime.Now
```

The component include the `[OutputCache]` attribute, which caches the entire rendered response. The page also include a call to `@DateTime.Now` to help verify that the response is cached.

## Configure the API with distributed caching

1. Add the [.NET Aspire StackExchange Redis distributed caching](/aspire/caching/stackexchange-redis-distributed-caching-component) component packages to your `AspireRedis` app:
1. Add the [.NET Aspire StackExchange Redis distributed caching](stackexchange-redis-output-caching-component.md) component packages to your `AspireRedis` app:

```dotnetcli
dotnet add package Aspire.StackExchange.Redis.DistributedCaching --prerelease
Expand Down
6 changes: 3 additions & 3 deletions docs/caching/stackexchange-redis-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dotnet add package Aspire.StackExchange.Redis --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down Expand Up @@ -107,10 +107,10 @@ builder.AddRedis(
In your orchestrator project, register the .NET Aspire Stack Exchange Redis component and consume the service using the following methods:

```csharp
// Service registration
// Service registration
var redis = builder.AddRedisContainer("redis");

// Service consumption
// Service consumption
builder.AddProject<Projects.ExampleProject>()
.WithReference(redis)
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dotnet add package Aspire.StackExchange.Redis.DistributedCaching --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down Expand Up @@ -106,7 +106,7 @@ You can also set up the [ConfigurationOptions](https://stackexchange.github.io/S

```csharp
builder.AddRedisDistributedCache(
"cache",
"cache",
configureOptions: options => options.ConnectTimeout = 3000);
```

Expand All @@ -115,10 +115,10 @@ builder.AddRedisDistributedCache(
In your orchestrator project, register the .NET Aspire Stack Exchange Redis component and consume the service using the following methods, such as <xref:Aspire.Hosting.RedisBuilderExtensions.AddRedisContainer%2A>:

```csharp
// Service registration
// Service registration
var redis = builder.AddRedisContainer("redis");

// Service consumption
// Service consumption
builder.AddProject<Projects.ExampleProject>()
.WithReference(redis)
```
Expand Down
12 changes: 6 additions & 6 deletions docs/caching/stackexchange-redis-output-caching-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ ms.date: 11/15/2023

# .NET Aspire StackExchange Redis output caching component

In this article, you learn how to use the .NET Aspire StackExchange Redis output caching component. The `Aspire.StackExchange.Redis.OutputCaching` library is used to register an [ASP.NET Core Output Caching](/aspnet/core/performance/caching/output) provider backed by a [Redis](https://redis.io/) server. It enables corresponding health check, logging and telemetry.
In this article, you learn how to use the .NET Aspire StackExchange Redis output caching component. The `Aspire.StackExchange.Redis.OutputCaching` library is used to register an [ASP.NET Core Output Caching](/aspnet/core/performance/caching/output) provider backed by a [Redis](https://redis.io/) server. It enables corresponding health check, logging, and telemetry.

## Get started

To get started with the .NET Aspire StackExchange Redis output caching component, install the [Aspire.StackExchange.Redis.OutputCache](https://www.nuget.org/packages/Aspire.StackExchange.Redis.OutputCache) NuGet package.
To get started with the .NET Aspire StackExchange Redis output caching component, install the [Aspire.StackExchange.Redis.OutputCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.OutputCaching) NuGet package.

### [.NET CLI](#tab/dotnet-cli)

Expand All @@ -28,7 +28,7 @@ dotnet add package Aspire.StackExchange.Redis.OutputCaching

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down Expand Up @@ -114,7 +114,7 @@ You can also set up the [ConfigurationOptions](https://stackexchange.github.io/S

```csharp
builder.AddRedisOutputCache(
"cache",
"cache",
configureOptions: options => options.ConnectTimeout = 3000);
```

Expand All @@ -123,10 +123,10 @@ builder.AddRedisOutputCache(
In your orchestrator project, register the .NET Aspire StackExchange Redis output caching component and consume the service using the following methods:

```csharp
// Service registration
// Service registration
var redis = builder.AddRedisContainer("redis");

// Service consumption
// Service consumption
var basket = builder.AddProject<Projects.ExampleProject>()
.WithReference(redis)
```
Expand Down
6 changes: 3 additions & 3 deletions docs/components-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following table lists the .NET Aspire components currently available for use
---
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).
1. In the _Program.cs_ file of your project, call the <xref:Microsoft.Extensions.Hosting.AspirePostgreSqlNpgsqlExtensions.AddNpgsqlDataSource%2A> extension method to register a `NpgsqlDataSource` for use via the dependency injection container. The method expects a connection name parameter.
Expand Down Expand Up @@ -118,7 +118,7 @@ public class ExampleService(NpgsqlDataSource dataSource)
}
```

For more information, see [.NET dependency injection](/dotnet/core/extensions/dependency-injection.md).
For more information, see [.NET dependency injection](/dotnet/core/extensions/dependency-injection).

### Keyed services

Expand Down Expand Up @@ -186,4 +186,4 @@ If either of these operations fail, the health check also fails. For more inform

- **Timeouts**: You can configure how long an .NET Aspire component waits for a request to finish before it times out. Timeout configurations can be useful for handling dependencies with variable response times.

For more information, see [Build resilient HTTP apps](/dotnet/core/resilience/http-resilience.md).
For more information, see [Build resilient HTTP apps](/dotnet/core/resilience/http-resilience).
2 changes: 1 addition & 1 deletion docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Consider the following example screenshot of the metrics page, with the `webfron

:::image type="content" source="media/dashboard/metrics-view.png" lightbox="media/dashboard/metrics-view.png" alt-text="A screenshot of the .NET Aspire dashboard Metrics page.":::

For more information about metrics, see [Built-in Metrics in .NET](/dotnet/core/diagnostics/built-in-metrics.md).
For more information about metrics, see [Built-in Metrics in .NET](/dotnet/core/diagnostics/built-in-metrics).

## Theme selection

Expand Down
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 @@ -28,7 +28,7 @@ dotnet add package Aspire.Microsoft.Azure.Cosmos --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down Expand Up @@ -133,7 +133,7 @@ builder.AddAzureCosmosDB(
In your orchestrator project, register the .NET Aspire Azure Cosmos DB component and consume the service using the following methods:

```csharp
// Service registration
// Service registration
var cosmosdb = builder.AddAzureCosmosDB("cdb")
.AddDatabase("cosmosdb");

Expand Down
4 changes: 2 additions & 2 deletions docs/database/azure-cosmos-db-entity-framework-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dotnet add package Aspire.Microsoft.EntityFrameworkCore.Cosmos --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down Expand Up @@ -107,7 +107,7 @@ builder.AddCosmosDbContext<MyDbContext>(
In your orchestrator project, register the .NET Aspire Microsoft Entity Framework Core Cosmos DB component and consume the service using the following methods:

```csharp
// Service registration
// Service registration
var cosmosdbService = builder.AddAzureCosmosDB("cdb")
.AddDatabase("cosmosdb");

Expand Down
2 changes: 1 addition & 1 deletion docs/database/postgresql-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dotnet add package Aspire.Npgsql --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down
2 changes: 1 addition & 1 deletion docs/database/postgresql-entity-framework-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dotnet add package Aspire.Npgsql.EntityFrameworkCore.PostgreSQL --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down
2 changes: 1 addition & 1 deletion docs/database/sql-server-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dotnet add package Aspire.Microsoft.Data.SqlClient --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down
6 changes: 3 additions & 3 deletions docs/database/sql-server-entity-framework-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In this article, you learn how to use the .NET Aspire SqlServer Entity Framework

## Get started

To get started with the .NET Aspire PostgreSQL Entity Framework Core component, install the [Aspire.Microsoft.EntityFrameworkCore.SqlServer](https://www.nuget.org/packages/Aspire.Microsoft.EntityFrameworkCore.SqlServer) NuGet package.
To get started with the .NET Aspire SQL Server Entity Framework Core component, install the [Aspire.Microsoft.EntityFrameworkCore.SqlServer](https://www.nuget.org/packages/Aspire.Microsoft.EntityFrameworkCore.SqlServer) NuGet package.

### [.NET CLI](#tab/dotnet-cli)

Expand All @@ -37,7 +37,7 @@ dotnet add package Aspire.Microsoft.EntityFrameworkCore.SqlServer --prerelease

---

For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package.md) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies.md).
For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies).

## Example usage

Expand Down Expand Up @@ -205,6 +205,6 @@ The .NET Aspire SQL Server Entity Framework Core component will emit the followi
- ec_Microsoft_EntityFramew_total_optimistic_concurrency_failures
- ec_Microsoft_EntityF_optimistic_concurrency_failures_per_second

- [Azure Database for PostgreSQL documentation](/azure/postgresql/)
- [Azure SQL Database documentation](/azure/azure-sql/)
- [.NET Aspire components](../components-overview.md)
- [.NET Aspire GitHub repo](https://github.com/dotnet/aspire)
2 changes: 0 additions & 2 deletions docs/deployment/azure/includes/aca-deployment-bicep.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Now, you'll create two new files - `infra\provision.bicep` and `infra\provision.
1. In `infra/provision.bicep`, add the following code to the top of the empty file. These lines of code represent the parameters you'll feed the Bicep file using the environment variables you set earlier. The `env` variable is an array that will be passed to both of the container apps hosting your Aspire project code, setting some conventional environment variables useful during development.

```bicep
targetScope = 'subscription'
@minLength(1)
@maxLength(64)
@description('Name of the resource group that will contain all the resources')
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/manifest-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dotnet run --project AspireApp.AppHost\AspireApp.AppHost.csproj `
--output-path aspire-manifest.json
```

For more information, see [dotnet build](/dotnet/core/tools/dotnet-build.md). The previous command produces the following output:
For more information, see [dotnet build](/dotnet/core/tools/dotnet-build). The previous command produces the following output:

```Output
Building...
Expand Down
3 changes: 3 additions & 0 deletions docs/get-started/aspire-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ms.date: 11/15/2023

.NET Aspire is an opinionated, cloud ready stack for building observable, production ready, distributed applications.​ .NET Aspire is delivered through a collection of NuGet packages that handle specific cloud-native concerns. Cloud-native apps often consist of small, interconnected pieces or microservices rather than a single, monolithic code base. Cloud-native apps generally consume a large number of services, such as databases, messaging, and caching.

> [!NOTE]
> A _distributed application_ is one that uses computational resources across multiple nodes, such as containers run on different hosts. Such nodes must communicate across the network to deliver responses to users. A cloud-native app is a specific type of distributed app that takes full advantage of the scalability, resilience, and manageability of cloud infrastructures.
.NET Aspire helps with:

- [**Orchestration**](#orchestration): .NET Aspire provides features for running and connecting multi-project applications and their dependencies.
Expand Down
8 changes: 4 additions & 4 deletions docs/get-started/quickstart-build-your-first-aspire-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Consider the _Program.cs_ file of the _AspireSample.AppHost_ project:

:::code source="snippets/quickstart/AspireSample/AspireSample.AppHost/Program.cs":::

If you've used either the [.NET Generic Host](/dotnet/core/extensions/generic-host.md) or the [ASP.NET Core Web Host](/aspnet/core/fundamentals/host/web-host) before, the app host programming model and builder pattern should be familiar to you. The preceding code:
If you've used either the [.NET Generic Host](/dotnet/core/extensions/generic-host) or the [ASP.NET Core Web Host](/aspnet/core/fundamentals/host/web-host) before, the app host programming model and builder pattern should be familiar to you. The preceding code:

- Creates an <xref:Aspire.Hosting.IDistributedApplicationBuilder> instance from calling <xref:Aspire.Hosting.DistributedApplication.CreateBuilder?displayProperty=nameWithType>.
- Calls <xref:Aspire.Hosting.RedisBuilderExtensions.AddRedisContainer%2A> with the name `"cache"` to add a Redis container to the app, assigning the returned value to a variable named `cache`, which is of type `IResourceBuilder<RedisContainerResource>`.
Expand All @@ -69,7 +69,7 @@ The service defaults project exposes an extension method on the <xref:Microsoft.

## Orchestrate service communication

.NET Aspire provides orchestration features to assist with configuring connections and communication between the different parts of your app. The _AspireSample.AppHost_ project added the _AspireSample.ApiService_ and _AspireSample.Web_ projects to the application model. It also declared their names as `"webfrontend"` for Blazor front end, `"apiservice"` for the API project reference. Additionally, a Redis container resource labelled `"redis"` was added. These names are used to configure service discovery and communication between the projects in your app.
.NET Aspire provides orchestration features to assist with configuring connections and communication between the different parts of your app. The _AspireSample.AppHost_ project added the _AspireSample.ApiService_ and _AspireSample.Web_ projects to the application model. It also declared their names as `"webfrontend"` for Blazor front end, `"apiservice"` for the API project reference. Additionally, a Redis container resource labelled `"cache"` was added. These names are used to configure service discovery and communication between the projects in your app.

The front end app defines a typed <xref:System.Net.Http.HttpClient> that's used to communicate with the API project.

Expand All @@ -85,7 +85,7 @@ The preceding code:
- Calls <xref:Microsoft.Extensions.Hosting.AspireRedisOutputCacheExtensions.AddRedisOutputCache%2A> with the same `connectionName` that was used when adding the Redis container `"cache"` to the application model. This configures the app to use Redis for output caching.
- Calls <xref:Microsoft.Extensions.DependencyInjection.HttpClientFactoryServiceCollectionExtensions.AddHttpClient%2A> and configures the <xref:System.Net.Http.HttpClient.BaseAddress?displayProperty=nameWithType> to be `"http://apiservice"`. This is the name that was used when adding the API project to the application model, and with service discovery configured, it will automatically resolve to the correct address to the API project.

For more information, see [Make HTTP requests with the `HttpClient`](/dotnet/fundamentals/networking/http/httpclient.md) class.
For more information, see [Make HTTP requests with the `HttpClient`](/dotnet/fundamentals/networking/http/httpclient) class.

## Test the app locally

Expand All @@ -104,7 +104,7 @@ In Visual Studio, set the **AspireSample.AppHost** project as the startup projec
dotnet run --project AspireSample/AspireSample.AppHost
```

For more information, see [dotnet run](/dotnet/core/tools/dotnet-run.md).
For more information, see [dotnet run](/dotnet/core/tools/dotnet-run).

---

Expand Down
Loading

0 comments on commit 8e5e08b

Please sign in to comment.