diff --git a/docs/azureai/azureai-search-document-integration.md b/docs/azureai/azureai-search-document-integration.md index 1e93268d3b..ce0aad6d60 100644 --- a/docs/azureai/azureai-search-document-integration.md +++ b/docs/azureai/azureai-search-document-integration.md @@ -186,7 +186,7 @@ builder.AddAzureSearch( static options => options.Diagnostics.ApplicationId = "CLIENT_ID")); ``` -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] The .NET Aspire Azure AI Search Documents integration implements a single health check, that calls the method on the `SearchIndexClient` to verify that the service is available. diff --git a/docs/caching/azure-cache-for-redis-distributed-caching-integration.md b/docs/caching/azure-cache-for-redis-distributed-caching-integration.md new file mode 100644 index 0000000000..58f4c2a89b --- /dev/null +++ b/docs/caching/azure-cache-for-redis-distributed-caching-integration.md @@ -0,0 +1,126 @@ +--- +title: Azure Cache for Redis distributed caching integration +description: Learn how to integrate Azure Cache for Redis as a distributed caching solution with the .NET Aspire stack. +ms.date: 02/05/2025 +--- + +# .NET Aspire Azure Cache for Redis®**[*](#registered)** distributed caching integration + + + +[!INCLUDE [includes-hosting-and-client](../includes/includes-hosting-and-client.md)] + +[!INCLUDE [azure-redis-intro](includes/azure-redis-intro.md)] + +The .NET Aspire Azure Cache for Redis integration enables you to connect to existing Azure Cache for Redis instances, or create new instances from .NET with the [`docker.io/library/redis` container image](https://hub.docker.com/_/redis/). + +## Hosting integration + +[!INCLUDE [azure-redis-app-host](includes/azure-redis-app-host.md)] + +## Client integration + +[!INCLUDE [redis-distributed-client-nuget](includes/redis-distributed-client-nuget.md)] + +### Add Redis distributed cache client + +In the _:::no-loc text="Program.cs":::_ file of your client-consuming project, call the extension to register the required services for distributed caching and add a for use via the dependency injection container. + +```csharp +builder.AddRedisDistributedCache(connectionName: "cache"); +``` + +> [!TIP] +> The `connectionName` parameter must match the name used when adding the Azure Cache for Redis resource in the app host project. For more information, see [Add Azure Cache for Redis resource](#add-azure-cache-for-redis-resource). + +You can then retrieve the `IDistributedCache` instance using dependency injection. For example, to retrieve the cache from a service: + +```csharp +public class ExampleService(IDistributedCache cache) +{ + // Use cache... +} +``` + +For more information on dependency injection, see [.NET dependency injection](/dotnet/core/extensions/dependency-injection). + +[!INCLUDE [azure-redis-distributed-client](includes/azure-redis-distributed-client.md)] + +### Add keyed Redis client + +There might be situations where you want to register multiple `IDistributedCache` instances with different connection names. To register keyed Redis clients, call the method: + +```csharp +builder.AddKeyedRedisDistributedCache(name: "chat"); +builder.AddKeyedRedisDistributedCache(name: "product"); +``` + +Then you can retrieve the `IDistributedCache` instances using dependency injection. For example, to retrieve the connection from an example service: + +```csharp +public class ExampleService( + [FromKeyedServices("chat")] IDistributedCache chatCache, + [FromKeyedServices("product")] IDistributedCache productCache) +{ + // Use caches... +} +``` + +For more information on keyed services, see [.NET dependency injection: Keyed services](/dotnet/core/extensions/dependency-injection#keyed-services). + +### Configuration + +The .NET Aspire Redis distributed caching integration provides multiple options to configure the Redis connection based on the requirements and conventions of your project. + +#### Use a connection string + +When using a connection string from the `ConnectionStrings` configuration section, you can provide the name of the connection string when calling `builder.AddRedisDistributedCache`: + +```csharp +builder.AddRedisDistributedCache("cache"); +``` + +And then the connection string will be retrieved from the `ConnectionStrings` configuration section: + +```json +{ + "ConnectionStrings": { + "cache": "localhost:6379" + } +} +``` + +For more information on how to format this connection string, see the [Stack Exchange Redis configuration docs](https://stackexchange.github.io/StackExchange.Redis/Configuration.html#basic-configuration-strings). + +#### Use configuration providers + +[!INCLUDE [redis-distributed-client-json-settings](includes/redis-distributed-client-json-settings.md)] + +#### Use inline delegates + +You can also pass the `Action` delegate to set up some or all the options inline, for example to configure `DisableTracing`: + +```csharp +builder.AddRedisDistributedCache( + "cache", + settings => settings.DisableTracing = true); +``` + +You can also set up the [ConfigurationOptions](https://stackexchange.github.io/StackExchange.Redis/Configuration.html#configuration-options) using the `Action configureOptions` delegate parameter of the `AddRedisDistributedCache` method. For example to set the connection timeout: + +```csharp +builder.AddRedisDistributedCache( + "cache", + static settings => settings.ConnectTimeout = 3_000); +``` + +[!INCLUDE [redis-distributed-client-health-checks-and-diagnostics](includes/redis-distributed-client-health-checks-and-diagnostics.md)] + +## See also + +- [Azure Cache for Redis docs](/azure/azure-cache-for-redis/) +- [Stack Exchange Redis docs](https://stackexchange.github.io/StackExchange.Redis/) +- [.NET Aspire integrations](../fundamentals/integrations-overview.md) +- [.NET Aspire GitHub repo](https://github.com/dotnet/aspire) + +[!INCLUDE [redis-trademark](includes/redis-trademark.md)] diff --git a/docs/caching/azure-cache-for-redis-integration.md b/docs/caching/azure-cache-for-redis-integration.md new file mode 100644 index 0000000000..4323505b1f --- /dev/null +++ b/docs/caching/azure-cache-for-redis-integration.md @@ -0,0 +1,118 @@ +--- +title: Azure Cache for Redis integration +description: Learn how to integrate Azure Cache for Redis with the .NET Aspire stack. +ms.date: 02/05/2025 +--- + +# .NET Aspire Azure Cache for Redis®**[*](#registered)** integration + + + +[!INCLUDE [includes-hosting-and-client](../includes/includes-hosting-and-client.md)] + +[!INCLUDE [azure-redis-intro](includes/azure-redis-intro.md)] + +The .NET Aspire Azure Cache for Redis integration enables you to connect to existing Azure Cache for Redis instances, or create new instances, or run as a container locally from .NET with the [`docker.io/library/redis` container image](https://hub.docker.com/_/redis/). + +## Hosting integration + +[!INCLUDE [azure-redis-app-host](includes/azure-redis-app-host.md)] + +## Client integration + +[!INCLUDE [redis-client-nuget](includes/redis-client-nuget.md)] + +### Add Redis client + +In the _:::no-loc text="Program.cs":::_ file of your client-consuming project, call the extension method on any to register an `IConnectionMultiplexer` for use via the dependency injection container. The method takes a connection name parameter. + +```csharp +builder.AddRedisClient(connectionName: "cache"); +``` + +> [!TIP] +> The `connectionName` parameter must match the name used when adding the Azure Cache for Redis resource in the app host project. For more information, see [Add Azure Cache for Redis resource](#add-azure-cache-for-redis-resource). + +You can then retrieve the `IConnectionMultiplexer` instance using dependency injection. For example, to retrieve the connection from an example service: + +```csharp +public class ExampleService(IConnectionMultiplexer connectionMux) +{ + // Use connection multiplexer... +} +``` + +For more information on dependency injection, see [.NET dependency injection](/dotnet/core/extensions/dependency-injection). + +[!INCLUDE [azure-redis-client](includes/azure-redis-client.md)] + +### Add keyed Redis client + +There might be situations where you want to register multiple `IConnectionMultiplexer` instances with different connection names. To register keyed Redis clients, call the method: + +```csharp +builder.AddKeyedRedisClient(name: "chat"); +builder.AddKeyedRedisClient(name: "queue"); +``` + +Then you can retrieve the `IConnectionMultiplexer` instances using dependency injection. For example, to retrieve the connection from an example service: + +```csharp +public class ExampleService( + [FromKeyedServices("chat")] IConnectionMultiplexer chatConnectionMux, + [FromKeyedServices("queue")] IConnectionMultiplexer queueConnectionMux) +{ + // Use connections... +} +``` + +For more information on keyed services, see [.NET dependency injection: Keyed services](/dotnet/core/extensions/dependency-injection#keyed-services). + +### Configuration + +The .NET Aspire Stack Exchange Redis client integration provides multiple options to configure the Redis connection based on the requirements and conventions of your project. + +#### Use a connection string + +When using a connection string from the `ConnectionStrings` configuration section, you can provide the name of the connection string when calling : + +```csharp +builder.AddRedis("cache"); +``` + +Then the connection string will be retrieved from the `ConnectionStrings` configuration section: + +```json +{ + "ConnectionStrings": { + "cache": "localhost:6379" + } +} +``` + +For more information on how to format this connection string, see the [Stack Exchange Redis configuration docs](https://stackexchange.github.io/StackExchange.Redis/Configuration.html#basic-configuration-strings). + +#### Use configuration providers + +[!INCLUDE [redis-client-json-settings](includes/redis-client-json-settings.md)] + +#### Use inline delegates + +You can also pass the `Action` delegate to set up some or all the options inline, for example to configure `DisableTracing`: + +```csharp +builder.AddRedisClient( + "cache", + static settings => settings.DisableTracing = true); +``` + +[!INCLUDE [redis-client-health-checks-and-diagnostics](includes/redis-client-health-checks-and-diagnostics.md)] + +## See also + +- [Azure Cache for Redis docs](/azure/azure-cache-for-redis/) +- [Stack Exchange Redis docs](https://stackexchange.github.io/StackExchange.Redis/) +- [.NET Aspire integrations](../fundamentals/integrations-overview.md) +- [.NET Aspire GitHub repo](https://github.com/dotnet/aspire) + +[!INCLUDE [redis-trademark](includes/redis-trademark.md)] diff --git a/docs/caching/azure-cache-for-redis-output-caching-integration.md b/docs/caching/azure-cache-for-redis-output-caching-integration.md new file mode 100644 index 0000000000..0fa8000491 --- /dev/null +++ b/docs/caching/azure-cache-for-redis-output-caching-integration.md @@ -0,0 +1,114 @@ +--- +title: Azure Cache for Redis output caching integration +description: Learn how to integrate Azure Cache for Redis as an output caching solution with the .NET Aspire stack. +ms.date: 02/05/2025 +--- + +# .NET Aspire Azure Cache for Redis®**[*](#registered)** output caching integration + + + +[!INCLUDE [includes-hosting-and-client](../includes/includes-hosting-and-client.md)] + +[!INCLUDE [azure-redis-intro](includes/azure-redis-intro.md)] + +The .NET Aspire Azure Cache for Redis integration enables you to connect to existing Azure Cache for Redis instances, or create new instances from .NET with the [`docker.io/library/redis` container image](https://hub.docker.com/_/redis/). + +## Hosting integration + +[!INCLUDE [azure-redis-app-host](includes/azure-redis-app-host.md)] + +## Client integration + +[!INCLUDE [redis-output-client-nuget](includes/redis-output-client-nuget.md)] + +### Add output caching + +In the _:::no-loc text="Program.cs":::_ file of your client-consuming project, call the extension method on any to register the required services for output caching. + +```csharp +builder.AddRedisOutputCache(connectionName: "cache"); +``` + +> [!TIP] +> The `connectionName` parameter must match the name used when adding the Azure Cache for Redis resource in the app host project. For more information, see [Add Azure Cache for Redis resource](#add-azure-cache-for-redis-resource). + +Add the middleware to the request processing pipeline by calling : + +```csharp +var app = builder.Build(); + +app.UseOutputCache(); +``` + +For [minimal API apps](/aspnet/core/fundamentals/minimal-apis/overview), configure an endpoint to do caching by calling , or by applying the , as shown in the following examples: + +```csharp +app.MapGet("/cached", () => "Hello world!") + .CacheOutput(); + +app.MapGet( + "/attribute", + [OutputCache] () => "Hello world!"); +``` + +For apps with controllers, apply the `[OutputCache]` attribute to the action method. For Razor Pages apps, apply the attribute to the Razor page class. + +[!INCLUDE [azure-redis-output-client](includes/azure-redis-output-client.md)] + +### Configuration + +The .NET Aspire Stack Exchange Redis output caching integration provides multiple options to configure the Redis connection based on the requirements and conventions of your project. + +#### Use a connection string + +When using a connection string from the `ConnectionStrings` configuration section, you can provide the name of the connection string when calling : + +```csharp +builder.AddRedisOutputCache(connectionName: "cache"); +``` + +Then the connection string will be retrieved from the `ConnectionStrings` configuration section: + +```json +{ + "ConnectionStrings": { + "cache": "localhost:6379" + } +} +``` + +For more information on how to format this connection string, see the [Stack Exchange Redis configuration docs](https://stackexchange.github.io/StackExchange.Redis/Configuration.html#basic-configuration-strings). + +#### Use configuration providers + +[!INCLUDE [redis-output-client-json-settings](includes/redis-output-client-json-settings.md)] + +#### Use inline delegates + +You can also pass the `Action configurationSettings` delegate to set up some or all the options inline, for example to disable health checks from code: + +```csharp +builder.AddRedisOutputCache( + "cache", + static settings => settings.DisableHealthChecks = true); +``` + +You can also set up the [ConfigurationOptions](https://stackexchange.github.io/StackExchange.Redis/Configuration.html#configuration-options) using the `Action configureOptions` delegate parameter of the method. For example to set the connection timeout: + +```csharp +builder.AddRedisOutputCache( + "cache", + static settings => settings.ConnectTimeout = 3_000); +``` + +[!INCLUDE [redis-output-client-health-checks-and-diagnostics](includes/redis-output-client-health-checks-and-diagnostics.md)] + +## See also + +- [Azure Cache for Redis docs](/azure/azure-cache-for-redis/) +- [Stack Exchange Redis docs](https://stackexchange.github.io/StackExchange.Redis/) +- [.NET Aspire integrations](../fundamentals/integrations-overview.md) +- [.NET Aspire GitHub repo](https://github.com/dotnet/aspire) + +[!INCLUDE [redis-trademark](includes/redis-trademark.md)] diff --git a/docs/caching/caching-integrations.md b/docs/caching/caching-integrations.md index 2438b3cf1a..58381e211d 100644 --- a/docs/caching/caching-integrations.md +++ b/docs/caching/caching-integrations.md @@ -1,7 +1,7 @@ --- title: Implement caching with .NET Aspire integrations description: Learn how to connect to Redis and cache data using .NET Aspire integrations. -ms.date: 11/08/2024 +ms.date: 02/05/2025 ms.topic: tutorial --- @@ -172,7 +172,7 @@ Configuring connection string with this method, while functional, requires dupli await cache.SetAsync("forecast", Encoding.UTF8.GetBytes(JsonSerializer.Serialize(forecast)), new () { AbsoluteExpiration = DateTime.Now.AddSeconds(10) - }); ; + }); return forecast; } diff --git a/docs/caching/includes/azure-redis-app-host.md b/docs/caching/includes/azure-redis-app-host.md index 8a7ce49019..442b1833bb 100644 --- a/docs/caching/includes/azure-redis-app-host.md +++ b/docs/caching/includes/azure-redis-app-host.md @@ -2,9 +2,7 @@ ms.topic: include --- -### Azure Redis hosting integration - -To deploy your Redis resources to Azure, install the [πŸ“¦ Aspire.Hosting.Azure.Redis](https://www.nuget.org/packages/Aspire.Hosting.Azure.Redis) NuGet package: +The .NET Aspire Azure Cache for Redis hosting integration models an Azure Redis resource as the type. To access this type and APIs for expressing them as resources in your [app host](xref:dotnet/aspire/app-host) project, add the [πŸ“¦ Aspire.Hosting.Azure.Redis](https://www.nuget.org/packages/Aspire.Hosting.Azure.Redis) NuGet package: ### [.NET CLI](#tab/dotnet-cli) @@ -21,20 +19,146 @@ dotnet add package Aspire.Hosting.Azure.Redis --- -#### Add Azure Cache for Redis server resource +For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies). + +### Add Azure Cache for Redis resource -After you've installed the .NET Aspire hosting Azure Redis package, call the `AddAzureRedis` extension method in your app host project: +In your app host project, call on the `builder` instance to add an Azure Cache for Redis resource, as shown in the following example: ```csharp var builder = DistributedApplication.CreateBuilder(args); -var cache = builder.AddAzureRedis("azcache") +var cache = builder.AddAzureRedis("azcache"); + +builder.AddProject() + .WithReference(cache); -var exampleProject = builder.AddProject() - .WithReference(cache); +// After adding all resources, run the app... ``` The preceding call to `AddAzureRedis` configures the Redis server resource to be deployed as an [Azure Cache for Redis](/azure/azure-cache-for-redis/cache-overview). > [!IMPORTANT] > By default, `AddAzureRedis` configures [Microsoft Entra ID](/azure/azure-cache-for-redis/cache-azure-active-directory-for-authentication) authentication. This requires changes to applications that need to connect to these resources, for example, client integrations. + +> [!TIP] +> When you call , it implicitly calls β€”which adds support for generating Azure resources dynamically during app startup. The app must configure the appropriate subscription and location. For more information, see [Local provisioning: Configuration](../../azure/local-provisioning.md#configuration). + +#### Generated provisioning Bicep + +If you're new to [Bicep](/azure/azure-resource-manager/bicep/overview), it's a domain-specific language for defining Azure resources. With .NET Aspire, you don't need to write Bicep by-hand, instead the provisioning APIs generate Bicep for you. When you publish your app, the generated Bicep is output alongside the manifest file. When you add an Azure Cache for Redis resource, the following Bicep is generated: + + +
+
+Toggle Azure Cache for Redis Bicep. +

+ +:::code language="bicep" source="../../snippets/azure/AppHost/redis.module.bicep"::: + +

+
+ + +The preceding Bicep is a module that provisions an Azure Cache for Redis with the following defaults: + +- `location`: The location of the Azure Cache for Redis resource. The default is the location of the resource group. +- `principalId`: The principal ID of the Azure Cache for Redis resource. +- `principalName`: The principal name of the Azure Cache for Redis resource. +- `sku`: The SKU of the Azure Cache for Redis resource. The default is `Basic` with a capacity of `1`. +- `enableNonSslPort`: The non-SSL port of the Azure Cache for Redis resource. The default is `false`. +- `disableAccessKeyAuthentication`: The access key authentication of the Azure Cache for Redis resource. The default is `true`. +- `minimumTlsVersion`: The minimum TLS version of the Azure Cache for Redis resource. The default is `1.2`. +- `redisConfiguration`: The Redis configuration of the Azure Cache for Redis resource. The default is `aad-enabled` set to `true`. +- `tags`: The tags of the Azure Cache for Redis resource. The default is `aspire-resource-name` set to the name of the Aspire resource, in this case `redis`. +- `redis_contributor`: The contributor of the Azure Cache for Redis resource, with an access policy name of `Data Contributor`. +- `connectionString`: The connection string of the Azure Cache for Redis resource. + +In addition to the Azure Cache for Redis, it also provisions an access policy assignment to the application access to the cache. The generated Bicep is a starting point and can be customized to meet your specific requirements. + +#### Customize provisioning infrastructure + +All .NET Aspire Azure resources are subclasses of the type. This type enables the customization of the generated Bicep by providing a fluent API to configure the Azure resourcesβ€”using the API. For example, you can configure the `kind`, `consistencyPolicy`, `locations`, and more. The following example demonstrates how to customize the Azure Cache for Redis resource: + +:::code language="csharp" source="../../snippets/azure/AppHost/Program.ConfigureRedisInfra.cs" id="configure"::: + +The preceding code: + +- Chains a call to the API: + - The `infra` parameter is an instance of the type. + - The provisionable resources are retrieved by calling the method. + - The single is retrieved. + - The `Sku` is set with a family of `BasicOrStandard`, a name of `Standard`, and a capacity of `1`. + - A tag is added to the Redis resource with a key of `ExampleKey` and a value of `Example value`. + +There are many more configuration options available to customize the Azure Cache for Redis resource. For more information, see . For more information, see [Azure.Provisioning customization](../../azure/integrations-overview.md#azureprovisioning-customization). + +### Connect to an existing Azure Cache for Redis + +You might have an existing Azure Cache for Redis that you want to connect to. Instead of representing a new Azure Cache for Redis resource, you can add a connection string to the app host. To add a connection to an existing Azure Cache for Redis, call the method: + +```csharp +var builder = DistributedApplication.CreateBuilder(args); + +var cache = builder.AddConnectionString("azure-redis"); + +builder.AddProject("web") + .WithReference(cache); + +// After adding all resources, run the app... +``` + +[!INCLUDE [connection-strings-alert](../../includes/connection-strings-alert.md)] + +The connection string is configured in the app host's configuration, typically under [User Secrets](/aspnet/core/security/app-secrets), under the `ConnectionStrings` section. The app host injects this connection string as an environment variable into all dependent resources, for example: + +```json +{ + "ConnectionStrings": { + "azure-redis": ".redis.cache.windows.net:6380,ssl=true,abortConnect=False" + } +} +``` + +The dependent resource can access the injected connection string by calling the method, and passing the connection name as the parameter, in this case `"azure-redis"`. The `GetConnectionString` API is shorthand for `IConfiguration.GetSection("ConnectionStrings")[name]`. + +### Run Azure Cache for Redis resource as a container + +The Azure Cache for Redis hosting integration supports running the Redis server as a local container. This is beneficial for situations where you want to run the Redis server locally for development and testing purposes, avoiding the need to provision an Azure resource or connect to an existing Azure Cache for Redis server. + +To make use of the [`docker.io/library/redis`](https://hub.docker.com/_/redis/) container image, and run the Azure Cache for Redis instance as a container locally, chain a call to , as shown in the following example: + +```csharp +var builder = DistributedApplication.CreateBuilder(args); + +var cache = builder.AddAzureRedis("azcache") + .RunAsContainer(); + +builder.AddProject() + .WithReference(cache); + +// After adding all resources, run the app... +``` + +The preceding code configures the Redis resource to run locally in a container. + +> [!TIP] +> The `RunAsContainer` method is useful for local development and testing. The API exposes an optional delegate that enables you to customize the underlying configuration, such adding [Redis Insights](https://redis.io/insight/), [Redis Commander](https://joeferner.github.io/redis-commander/), adding a data volume or data bind mount. For more information, see the [.NET Aspire Redis hosting integration](../stackexchange-redis-integration.md#add-redis-resource-with-redis-insights). + +### Configure the Azure Cache for Redis resource to use access key authentication + +By default, the Azure Cache for Redis resource is configured to use [Microsoft Entra ID](/azure/postgresql/flexible-server/concepts-azure-ad-authentication) authentication. If you want to use password authentication (not recommended), you can configure the server to use password authentication by calling the method: + +```csharp +var builder = DistributedApplication.CreateBuilder(args); + +var cache = builder.AddAzureRedis("azcache") + .WithAccessKeyAuthentication(); + +builder.AddProject() + .WithReference(cache); + +// After adding all resources, run the app... +``` + +The preceding code configures the Azure Cache for Redis resource to use access key authentication. This alters the generated Bicep to use access key authentication instead of Microsoft Entra ID authentication. In other words, the connection string will contain a password, and will be added to an Azure Key Vault secret. diff --git a/docs/caching/includes/azure-redis-client.md b/docs/caching/includes/azure-redis-client.md index 1bc347da83..27c2eb6672 100644 --- a/docs/caching/includes/azure-redis-client.md +++ b/docs/caching/includes/azure-redis-client.md @@ -2,9 +2,9 @@ ms.topic: include --- -### Add Azure Cache for Redis client +### Add Azure Cache for Redis authenticated client -By default, when you call `AddAzureRedis` in your Redis hosting integration, it configures [πŸ“¦ Microsoft.Azure.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) NuGet package to enable authentication: +By default, when you call in your Redis hosting integration, it configures Microsoft Entra ID. Install the [πŸ“¦ Microsoft.Azure.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) NuGet package to enable authentication: ### [.NET CLI](#tab/dotnet-cli) diff --git a/docs/caching/includes/azure-redis-distributed-client.md b/docs/caching/includes/azure-redis-distributed-client.md index 3d766bfd86..4c2c36f50c 100644 --- a/docs/caching/includes/azure-redis-distributed-client.md +++ b/docs/caching/includes/azure-redis-distributed-client.md @@ -2,9 +2,9 @@ ms.topic: include --- -### Add Azure Cache for Redis distributed client +### Add Azure Cache for Redis authenticated distributed client -By default, when you call `AddAzureRedis` in your Redis hosting integration, it configures [πŸ“¦ Microsoft.Azure.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) NuGet package to enable authentication: +By default, when you call in your app host project, the Redis hosting integration configures [πŸ“¦ Microsoft.Azure.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) NuGet package to enable authentication: ### [.NET CLI](#tab/dotnet-cli) diff --git a/docs/caching/includes/azure-redis-intro.md b/docs/caching/includes/azure-redis-intro.md new file mode 100644 index 0000000000..6c7233395d --- /dev/null +++ b/docs/caching/includes/azure-redis-intro.md @@ -0,0 +1,7 @@ +--- +ms.topic: include +--- + +[Azure Cache for Redis](/azure/azure-cache-for-redis/cache-overview) provides an in-memory data store based on the [Redis](https://redis.io/) software. Redis improves the performance and scalability of an application that uses backend data stores heavily. It's able to process large volumes of application requests by keeping frequently accessed data in the server memory, which can be written to and read from quickly. Redis brings a critical low-latency and high-throughput data storage solution to modern applications. + +Azure Cache for Redis offers both the Redis open-source (OSS Redis) and a commercial product from Redis Inc. (Redis Enterprise) as a managed service. It provides secure and dedicated Redis server instances and full Redis API compatibility. Microsoft operates the service, hosted on Azure, and usable by any application within or outside of Azure. diff --git a/docs/caching/includes/azure-redis-output-client.md b/docs/caching/includes/azure-redis-output-client.md index 91def31fa4..8a27ca241a 100644 --- a/docs/caching/includes/azure-redis-output-client.md +++ b/docs/caching/includes/azure-redis-output-client.md @@ -2,9 +2,9 @@ ms.topic: include --- -### Add Azure Cache for Redis output client +### Add Azure Cache for Redis authenticated output client -By default, when you call `AddAzureRedis` in your Redis hosting integration, it configures [πŸ“¦ Microsoft.Azure.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) NuGet package to enable authentication: +By default, when you call in your Redis hosting integration, it configures [πŸ“¦ Microsoft.Azure.StackExchangeRedis](https://www.nuget.org/packages/Microsoft.Azure.StackExchangeRedis) NuGet package to enable authentication: ### [.NET CLI](#tab/dotnet-cli) diff --git a/docs/caching/includes/redis-app-host.md b/docs/caching/includes/redis-app-host.md index 88d5a1fbf5..16c52caac1 100644 --- a/docs/caching/includes/redis-app-host.md +++ b/docs/caching/includes/redis-app-host.md @@ -2,7 +2,7 @@ ms.topic: include --- -The Redis hosting integration models a Redis resource as the type. To access this type and APIs that allow you to add it to your [πŸ“¦ Aspire.Hosting.Redis](https://www.nuget.org/packages/Aspire.Hosting.Redis) NuGet package in the [app host](xref:dotnet/aspire/app-host) project. +The Redis hosting integration models a Redis resource as the type. To access this type and APIs for expressing them as resources in your [app host](xref:dotnet/aspire/app-host) project, add the [πŸ“¦ Aspire.Hosting.Redis](https://www.nuget.org/packages/Aspire.Hosting.Redis) NuGet package: ### [.NET CLI](#tab/dotnet-cli) diff --git a/docs/caching/includes/redis-client-health-checks-and-diagnostics.md b/docs/caching/includes/redis-client-health-checks-and-diagnostics.md new file mode 100644 index 0000000000..032f82dd4a --- /dev/null +++ b/docs/caching/includes/redis-client-health-checks-and-diagnostics.md @@ -0,0 +1,28 @@ +--- +ms.topic: include +--- + +[!INCLUDE [client-integration-health-checks](../../includes/client-integration-health-checks.md)] + +The .NET Aspire Stack Exchange Redis integration handles the following: + +- Adds the health check when is `false`, which attempts to connect to the container instance. +- Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic. + +[!INCLUDE [integration-observability-and-telemetry](../../includes/integration-observability-and-telemetry.md)] + +#### Logging + +The .NET Aspire Stack Exchange Redis integration uses the following log categories: + +- `Aspire.StackExchange.Redis` + +#### Tracing + +The .NET Aspire Stack Exchange Redis integration will emit the following tracing activities using OpenTelemetry: + +- `OpenTelemetry.Instrumentation.StackExchangeRedis` + +#### Metrics + +The .NET Aspire Stack Exchange Redis integration currently doesn't support metrics by default due to limitations with the `StackExchange.Redis` library. diff --git a/docs/caching/includes/redis-client-json-settings.md b/docs/caching/includes/redis-client-json-settings.md index c17354d0ae..579f54bb17 100644 --- a/docs/caching/includes/redis-client-json-settings.md +++ b/docs/caching/includes/redis-client-json-settings.md @@ -9,7 +9,10 @@ The .NET Aspire Stack Exchange Redis integration supports +``` + +--- diff --git a/docs/caching/includes/redis-distributed-client-health-checks-and-diagnostics.md b/docs/caching/includes/redis-distributed-client-health-checks-and-diagnostics.md new file mode 100644 index 0000000000..6ceed112cc --- /dev/null +++ b/docs/caching/includes/redis-distributed-client-health-checks-and-diagnostics.md @@ -0,0 +1,29 @@ +--- +ms.topic: include +--- + +[!INCLUDE [client-integration-health-checks](../../includes/client-integration-health-checks.md)] + +The .NET Aspire Redis distributed caching integration handles the following: + +- Adds the health check when is `false`, which attempts to connect to the container instance. +- Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic. + +[!INCLUDE [integration-observability-and-telemetry](../../includes/integration-observability-and-telemetry.md)] + +#### Logging + +The .NET Aspire Redis distributed caching integration uses the following Log categories: + +- `Aspire.StackExchange.Redis` +- `Microsoft.Extensions.Caching.StackExchangeRedis` + +#### Tracing + +The .NET Aspire Redis distributed caching integration will emit the following Tracing activities using OpenTelemetry: + +- `OpenTelemetry.Instrumentation.StackExchangeRedis` + +#### Metrics + +The .NET Aspire Redis Distributed caching integration currently doesn't support metrics by default due to limitations with the `StackExchange.Redis` library. diff --git a/docs/caching/includes/redis-distributed-client-json-settings.md b/docs/caching/includes/redis-distributed-client-json-settings.md new file mode 100644 index 0000000000..a58f65609c --- /dev/null +++ b/docs/caching/includes/redis-distributed-client-json-settings.md @@ -0,0 +1,24 @@ +--- +ms.topic: include +--- + +The .NET Aspire Stack Exchange Redis distributed caching integration supports . It loads the from configuration by using the `Aspire:StackExchange:Redis` key. Example _:::no-loc text="appsettings.json":::_ that configures some of the options: + +```json +{ + "Aspire": { + "StackExchange": { + "Redis": { + "ConfigurationOptions": { + "ConnectTimeout": 3000, + "ConnectRetry": 2 + }, + "DisableHealthChecks": true, + "DisableTracing": false + } + } + } +} +``` + +For the complete Redis distributed caching client integration JSON schema, see [Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json). diff --git a/docs/caching/includes/redis-distributed-client-nuget.md b/docs/caching/includes/redis-distributed-client-nuget.md new file mode 100644 index 0000000000..9db64ff763 --- /dev/null +++ b/docs/caching/includes/redis-distributed-client-nuget.md @@ -0,0 +1,20 @@ +--- +ms.topic: include +--- + +To get started with the .NET Aspire Redis distributed caching integration, install the [πŸ“¦ Aspire.StackExchange.Redis.DistributedCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.DistributedCaching) NuGet package in the client-consuming project, i.e., the project for the application that uses the Redis distributed caching client. The Redis client integration registers an instance that you can use to interact with Redis. + +### [.NET CLI](#tab/dotnet-cli) + +```dotnetcli +dotnet add package Aspire.StackExchange.Redis.DistributedCaching +``` + +### [PackageReference](#tab/package-reference) + +```xml + +``` + +--- diff --git a/docs/caching/includes/redis-output-client-health-checks-and-diagnostics.md b/docs/caching/includes/redis-output-client-health-checks-and-diagnostics.md new file mode 100644 index 0000000000..3cfb8f2325 --- /dev/null +++ b/docs/caching/includes/redis-output-client-health-checks-and-diagnostics.md @@ -0,0 +1,29 @@ +--- +ms.topic: include +--- + +[!INCLUDE [client-integration-health-checks](../../includes/client-integration-health-checks.md)] + +The .NET Aspire Stack Exchange Redis output caching integration handles the following: + +- Adds the health check when is `false`, which attempts to connect to the container instance. +- Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic. + +[!INCLUDE [integration-observability-and-telemetry](../../includes/integration-observability-and-telemetry.md)] + +#### Logging + +The .NET Aspire Stack Exchange Redis output caching integration uses the following Log categories: + +- `Aspire.StackExchange.Redis` +- `Microsoft.AspNetCore.OutputCaching.StackExchangeRedis` + +#### Tracing + +The .NET Aspire Stack Exchange Redis output caching integration will emit the following Tracing activities using OpenTelemetry: + +- `OpenTelemetry.Instrumentation.StackExchangeRedis` + +#### Metrics + +The .NET Aspire Stack Exchange Redis output caching integration currently doesn't support metrics by default due to limitations with the `StackExchange.Redis` library. diff --git a/docs/caching/includes/redis-output-client-json-settings.md b/docs/caching/includes/redis-output-client-json-settings.md new file mode 100644 index 0000000000..af2ec24492 --- /dev/null +++ b/docs/caching/includes/redis-output-client-json-settings.md @@ -0,0 +1,24 @@ +--- +ms.topic: include +--- + +The .NET Aspire Stack Exchange Redis output caching integration supports . It loads the from configuration by using the `Aspire:StackExchange:Redis` key. Example _:::no-loc text="appsettings.json":::_ that configures some of the options: + +```json +{ + "Aspire": { + "StackExchange": { + "Redis": { + "ConfigurationOptions": { + "ConnectTimeout": 3000, + "ConnectRetry": 2 + }, + "DisableHealthChecks": true, + "DisableTracing": false + } + } + } +} +``` + +For the complete Redis output caching client integration JSON schema, see [Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json](https://github.com/dotnet/aspire/blob/v9.0.0/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json). diff --git a/docs/caching/includes/redis-output-client-nuget.md b/docs/caching/includes/redis-output-client-nuget.md new file mode 100644 index 0000000000..d167b97086 --- /dev/null +++ b/docs/caching/includes/redis-output-client-nuget.md @@ -0,0 +1,20 @@ +--- +ms.topic: include +--- + +To get started with the .NET Aspire Stack Exchange Redis output caching client integration, install the [πŸ“¦ Aspire.StackExchange.Redis.OutputCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.OutputCaching) NuGet package in the client-consuming project, that is, the project for the application that uses the output caching client. The Redis output caching client integration registers services required for enabling method calls and [[OutputCache]](xref:Microsoft.AspNetCore.OutputCaching.OutputCacheAttribute) attribute usage to rely on Redis as its caching mechanism. + +### [.NET CLI](#tab/dotnet-cli) + +```dotnetcli +dotnet add package Aspire.StackExchange.Redis.OutputCaching +``` + +### [PackageReference](#tab/package-reference) + +```xml + +``` + +--- diff --git a/docs/caching/stackexchange-redis-caching-overview.md b/docs/caching/stackexchange-redis-caching-overview.md index d5e2f85222..e4577145df 100644 --- a/docs/caching/stackexchange-redis-caching-overview.md +++ b/docs/caching/stackexchange-redis-caching-overview.md @@ -1,7 +1,7 @@ --- title: Stack Exchange Redis caching overview description: Learn about Stack Exchange Redis caching and how to use it in your applications. -ms.date: 11/05/2024 +ms.date: 02/05/2025 --- # Stack Exchange Redis®**[*](#registered)** caching overview @@ -21,11 +21,11 @@ In addition to Redis itself, there are two well-maintained implementations of RE - [Garnet](https://github.com/microsoft/Garnet): Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients. - [Valkey](https://github.com/valkey-io/valkey): A flexible distributed key-value datastore that supports both caching and beyond caching workloads. -.NET Aspire lets you easily model either the Redis, Garnet, or Valkey RESP protocol in your applications and you can choose which one to use based on your requirements. All of the .NET Aspire Redis integrations can be used with either the Redis, Garnet, or Valkey RESP protocol. +.NET Aspire lets you easily choose either the Redis, Garnet, or Valkey RESP protocol in your applications based on your requirements. All of the .NET Aspire Redis client integrations can be used with either the Redis, Garnet, or Valkey RESP protocol. ## Caching -Caching is a technique used to store frequently accessed data in memory. This helps to reduce the time it takes to retrieve the data from the original source, such as a database or a web service. Caching can significantly improve the performance of an application by reducing the number of requests made to the original source. To access the Redis `IConnectionMultiplexer` object, you use the `Aspire.StackExchange.Redis` NuGet package: +Caching is a technique used to store frequently accessed data in memory. This helps to reduce the time it takes to retrieve the data from the original source, such as a database or a web service. Caching can significantly improve the performance of an application by reducing the number of requests made to the original source. To access the Redis [IConnectionMultiplexer](https://stackexchange.github.io/StackExchange.Redis/Basics.html) object, you use the [πŸ“¦ Aspire.StackExchange.Redis](https://www.nuget.org/packages/Aspire.StackExchange.Redis) NuGet package: > [!div class="nextstepaction"] > [.NET Aspire Stack Exchange Redis integration](stackexchange-redis-integration.md) @@ -38,7 +38,7 @@ Caching is a technique used to store frequently accessed data in memory. This he ## Distributed caching -Distributed caching is a type of caching that stores data across multiple servers. This allows the data to be shared between multiple instances of an application, which can help to improve scalability and performance. Distributed caching can be used to store a wide variety of data, such as session state, user profiles, and frequently accessed data. To use Redis distributed caching in your application (the `IDistributedCache` interface), use the `Aspire.StackExchange.Redis.DistributedCaching` NuGet package: +Distributed caching is a type of caching that stores data across multiple servers. This allows the data to be shared between multiple instances of an application, which can help to improve scalability and performance. Distributed caching can be used to store a wide variety of data, such as session state, user profiles, and frequently accessed data. To use Redis distributed caching in your application (the interface), use the [πŸ“¦ Aspire.StackExchange.Redis.DistributedCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.DistributedCaching) NuGet package: > [!div class="nextstepaction"] > [.NET Aspire Stack Exchange Redis distributed caching integration](stackexchange-redis-distributed-caching-integration.md) @@ -51,7 +51,7 @@ Distributed caching is a type of caching that stores data across multiple server ## Output caching -Output caching is a type of caching that stores the output of a web page or API response. This allows the response to be served directly from the cache, rather than generating it from scratch each time. Output caching can help to improve the performance of a web application by reducing the time it takes to generate a response. To use declarative Redis output caching with either the `OutputCache` attribute or the `CacheOutput` method in your application, use the `Aspire.StackExchange.Redis.OutputCaching` NuGet package: +Output caching is a type of caching that stores the output of a web page or API response. This allows the response to be served directly from the cache, rather than generating it from scratch each time. Output caching can help to improve the performance of a web application by reducing the time it takes to generate a response. To use declarative Redis output caching with either the or the method in your application, use the [πŸ“¦ Aspire.StackExchange.Redis.OutputCaching`](https://www.nuget.org/packages/Aspire.StackExchange.Redis.OutputCaching`) NuGet package: > [!div class="nextstepaction"] > [.NET Aspire Stack Exchange Redis output caching integration](stackexchange-redis-output-caching-integration.md) diff --git a/docs/caching/stackexchange-redis-distributed-caching-integration.md b/docs/caching/stackexchange-redis-distributed-caching-integration.md index 48c8e98787..fada24401f 100644 --- a/docs/caching/stackexchange-redis-distributed-caching-integration.md +++ b/docs/caching/stackexchange-redis-distributed-caching-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire Redis distributed caching integration description: Learn how to use the .NET Aspire Redis distributed caching integration, which includes both hosting and client integrations. -ms.date: 11/05/2024 +ms.date: 02/05/2025 zone_pivot_groups: resp-host --- @@ -51,22 +51,7 @@ Learn how to use the .NET Aspire Redis distributed caching integration. The `Asp ## Client integration -To get started with the .NET Aspire Redis distributed caching integration, install the [πŸ“¦ Aspire.StackExchange.Redis.DistributedCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.DistributedCaching) NuGet package in the client-consuming project, i.e., the project for the application that uses the Redis distributed caching client. - -### [.NET CLI](#tab/dotnet-cli) - -```dotnetcli -dotnet add package Aspire.StackExchange.Redis.DistributedCaching -``` - -### [PackageReference](#tab/package-reference) - -```xml - -``` - ---- +[!INCLUDE [redis-distributed-client-nuget](includes/redis-distributed-client-nuget.md)] ### Add Redis client @@ -154,7 +139,7 @@ For more information on how to format this connection string, see the [Stack Exc #### Use configuration providers -[!INCLUDE [redis-client-json-settings](includes/redis-client-json-settings.md)] +[!INCLUDE [redis-distributed-client-json-settings](includes/redis-distributed-client-json-settings.md)] #### Use inline delegates @@ -174,39 +159,7 @@ builder.AddRedisDistributedCache( static settings => settings.ConnectTimeout = 3_000); ``` -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] - -The .NET Aspire Redis distributed caching integration handles the following: - -- Adds the `StackExchange.Redis` health check, tries to open the connection and throws when it fails. -- Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic - -[!INCLUDE [integration-observability-and-telemetry](../includes/integration-observability-and-telemetry.md)] - -#### Logging - -The .NET Aspire Redis Distributed Caching integration uses the following Log categories: - -- `Aspire.StackExchange.Redis` -- `Microsoft.Extensions.Caching.StackExchangeRedis` - -#### Tracing - -The .NET Aspire Redis Distributed Caching integration will emit the following Tracing activities using OpenTelemetry: - -- `OpenTelemetry.Instrumentation.StackExchangeRedis` - -#### Metrics - -The .NET Aspire Redis Distributed Caching integration currently doesn't support metrics by default due to limitations with the `StackExchange.Redis` library. - -:::zone pivot="redis" - -[!INCLUDE [azure-redis-app-host](includes/azure-redis-app-host.md)] - -[!INCLUDE [azure-redis-distributed-client](includes/azure-redis-distributed-client.md)] - -:::zone-end +[!INCLUDE [redis-distributed-client-health-checks-and-diagnostics](includes/redis-distributed-client-health-checks-and-diagnostics.md)] ## See also diff --git a/docs/caching/stackexchange-redis-integration.md b/docs/caching/stackexchange-redis-integration.md index 3272d0cbdf..d7f0077160 100644 --- a/docs/caching/stackexchange-redis-integration.md +++ b/docs/caching/stackexchange-redis-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire Redis integration description: Learn how to use the .NET Aspire Redis integration, which includes both hosting and client integrations. -ms.date: 11/05/2024 +ms.date: 02/05/2025 zone_pivot_groups: resp-host --- @@ -51,22 +51,7 @@ zone_pivot_groups: resp-host ## Client integration -To get started with the .NET Aspire Stack Exchange Redis client integration, install the [πŸ“¦ Aspire.StackExchange.Redis](https://www.nuget.org/packages/Aspire.StackExchange.Redis) NuGet package in the client-consuming project, that is, the project for the application that uses the Redis client. The Redis client integration registers an an [IConnectionMultiplexer](https://stackexchange.github.io/StackExchange.Redis/Basics) instance that you can use to interact with Redis. - -### [.NET CLI](#tab/dotnet-cli) - -```dotnetcli -dotnet add package Aspire.StackExchange.Redis -``` - -### [PackageReference](#tab/package-reference) - -```xml - -``` - ---- +[!INCLUDE [redis-client-nuget](includes/redis-client-nuget.md)] ### Add Redis client @@ -188,42 +173,7 @@ builder.AddRedisClient( static settings => settings.DisableTracing = true); ``` -### Client integration health checks - -By default, .NET Aspire integrations enable [health checks](../fundamentals/health-checks.md) for all services. For more information, see [.NET Aspire integrations overview](../fundamentals/integrations-overview.md). - -The .NET Aspire Stack Exchange Redis integration handles the following: - -- Adds the health check when is `false`, which attempts to connect to the container instance. -- Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic. - -### Observability and telemetry - -.NET Aspire integrations automatically set up Logging, Tracing, and Metrics configurations, which are sometimes known as *the pillars of observability*. For more information about integration observability and telemetry, see [.NET Aspire integrations overview](../fundamentals/integrations-overview.md). Depending on the backing service, some integrations might only support some of these features. For example, some integrations support logging and tracing, but not metrics. Telemetry features can also be disabled using the techniques presented in the [Configuration](#configuration) section. - -#### Logging - -The .NET Aspire Stack Exchange Redis integration uses the following log categories: - -- `Aspire.StackExchange.Redis` - -#### Tracing - -The .NET Aspire Stack Exchange Redis integration will emit the following tracing activities using OpenTelemetry: - -- `OpenTelemetry.Instrumentation.StackExchangeRedis` - -#### Metrics - -The .NET Aspire Stack Exchange Redis integration currently doesn't support metrics by default due to limitations with the `StackExchange.Redis` library. - -:::zone pivot="redis" - -[!INCLUDE [azure-redis-app-host](includes/azure-redis-app-host.md)] - -[!INCLUDE [azure-redis-client](includes/azure-redis-client.md)] - -:::zone-end +[!INCLUDE [redis-client-health-checks-and-diagnostics](includes/redis-client-health-checks-and-diagnostics.md)] ## See also diff --git a/docs/caching/stackexchange-redis-output-caching-integration.md b/docs/caching/stackexchange-redis-output-caching-integration.md index c372c42422..ca75dba798 100644 --- a/docs/caching/stackexchange-redis-output-caching-integration.md +++ b/docs/caching/stackexchange-redis-output-caching-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire Redis output caching integration description: Learn how to use the .NET Aspire Redis output caching integration to register an ASP.NET Core Output Caching provider backed by a Redis server. -ms.date: 11/05/2024 +ms.date: 02/05/2025 zone_pivot_groups: resp-host --- @@ -51,22 +51,7 @@ Learn how to use the .NET Aspire Redis output caching integration. The `Aspire.S ## Client integration -To get started with the .NET Aspire Stack Exchange Redis output caching client integration, install the [πŸ“¦ Aspire.StackExchange.Redis.OutputCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.OutputCaching) NuGet package in the client-consuming project, that is, the project for the application that uses the output caching client. - -### [.NET CLI](#tab/dotnet-cli) - -```dotnetcli -dotnet add package Aspire.StackExchange.Redis.OutputCaching -``` - -### [PackageReference](#tab/package-reference) - -```xml - -``` - ---- +[!INCLUDE [redis-output-client-nuget](includes/redis-output-client-nuget.md)] ### Add output caching @@ -142,7 +127,7 @@ For more information on how to format this connection string, see the [Stack Exc #### Use configuration providers -[!INCLUDE [redis-client-json-settings](includes/redis-client-json-settings.md)] +[!INCLUDE [redis-output-client-json-settings](includes/redis-output-client-json-settings.md)] #### Use inline delegates @@ -162,39 +147,7 @@ builder.AddRedisOutputCache( static settings => settings.ConnectTimeout = 3_000); ``` -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] - -The .NET Aspire Stack Exchange Redis output caching integration handles the following: - -- Adds the `StackExchange.Redis` health check, tries to open the connection and throws when it fails. -- Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic. - -[!INCLUDE [integration-observability-and-telemetry](../includes/integration-observability-and-telemetry.md)] - -#### Logging - -The .NET Aspire Stack Exchange Redis output caching integration uses the following Log categories: - -- `Aspire.StackExchange.Redis` -- `Microsoft.AspNetCore.OutputCaching.StackExchangeRedis` - -#### Tracing - -The .NET Aspire Stack Exchange Redis output caching integration will emit the following Tracing activities using OpenTelemetry: - -- `OpenTelemetry.Instrumentation.StackExchangeRedis` - -#### Metrics - -The .NET Aspire Stack Exchange Redis output caching integration currently doesn't support metrics by default due to limitations with the `StackExchange.Redis` library. - -:::zone pivot="redis" - -[!INCLUDE [azure-redis-app-host](includes/azure-redis-app-host.md)] - -[!INCLUDE [azure-redis-output-client](includes/azure-redis-output-client.md)] - -:::zone-end +[!INCLUDE [redis-output-client-health-checks-and-diagnostics](includes/redis-output-client-health-checks-and-diagnostics.md)] ## See also diff --git a/docs/database/includes/media/ads-connect-details.png b/docs/database/includes/media/ads-connect-details.png deleted file mode 100644 index 2fbe24b1eb..0000000000 Binary files a/docs/database/includes/media/ads-connect-details.png and /dev/null differ diff --git a/docs/database/includes/media/ads-connected.png b/docs/database/includes/media/ads-connected.png deleted file mode 100644 index 2a726f2e7c..0000000000 Binary files a/docs/database/includes/media/ads-connected.png and /dev/null differ diff --git a/docs/database/includes/media/ads-new-connection.png b/docs/database/includes/media/ads-new-connection.png deleted file mode 100644 index 7427011a5f..0000000000 Binary files a/docs/database/includes/media/ads-new-connection.png and /dev/null differ diff --git a/docs/database/includes/media/mssql-vscode-add-connection.png b/docs/database/includes/media/mssql-vscode-add-connection.png new file mode 100644 index 0000000000..0104b14b79 Binary files /dev/null and b/docs/database/includes/media/mssql-vscode-add-connection.png differ diff --git a/docs/database/includes/media/mssql-vscode-connected.png b/docs/database/includes/media/mssql-vscode-connected.png new file mode 100644 index 0000000000..2491427141 Binary files /dev/null and b/docs/database/includes/media/mssql-vscode-connected.png differ diff --git a/docs/database/includes/media/mssql-vscode-connection-details.png b/docs/database/includes/media/mssql-vscode-connection-details.png new file mode 100644 index 0000000000..5d8e75c9b0 Binary files /dev/null and b/docs/database/includes/media/mssql-vscode-connection-details.png differ diff --git a/docs/database/includes/postgresql-client.md b/docs/database/includes/postgresql-client.md index 6dd96118cd..878314a75b 100644 --- a/docs/database/includes/postgresql-client.md +++ b/docs/database/includes/postgresql-client.md @@ -117,7 +117,7 @@ builder.AddNpgsqlDataSource( static settings => settings.DisableHealthChecks = true); ``` -[!INCLUDE [integration-health-checks](../../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../../includes/client-integration-health-checks.md)] - Adds the [`NpgSqlHealthCheck`](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/src/HealthChecks.NpgSql/NpgSqlHealthCheck.cs), which verifies that commands can be successfully executed against the underlying Postgres database. - Integrates with the `/health` HTTP endpoint, which specifies all registered health checks must pass for app to be considered ready to accept traffic diff --git a/docs/database/includes/postgresql-ef-client.md b/docs/database/includes/postgresql-ef-client.md index a2625df091..8e0aae585a 100644 --- a/docs/database/includes/postgresql-ef-client.md +++ b/docs/database/includes/postgresql-ef-client.md @@ -41,13 +41,29 @@ public class ExampleService(YourDbContext context) For more information on dependency injection, see [.NET dependency injection](/dotnet/core/extensions/dependency-injection). -### Add Npgsql database context with enrichment +### Enrich an Npgsql database context -To enrich the `DbContext` with additional services, such as automatic retries, health checks, logging and telemetry, call the method: +You may prefer to use the standard Entity Framework method to obtain a database context and add it to the dependency injection container: + +```csharp +builder.Services.AddDbContext(options => + options.UseNpgsql(builder.Configuration.GetConnectionString("postgresdb") + ?? throw new InvalidOperationException("Connection string 'postgresdb' not found."))); +``` + +> [!NOTE] +> The connection string name that you pass to the method must match the name used when adding the PostgreSQL server resource in the app host project. For more information, see [Add PostgreSQL server resource](#add-postgresql-server-resource). + +You have more flexibility when you create the database context in this way, for example: + +- You can reuse existing configuration code for the database context without rewriting it for .NET Aspire. +- You can use Entity Framework Core interceptors to modify database operations. +- You can choose not to use Entity Framework Core context pooling, which may perform better in some circumstances. + +If you use this method, you can enhance the database context with .NET Aspire-style retries, health checks, logging, and telemetry features by calling the method: ```csharp builder.EnrichNpgsqlDbContext( - connectionName: "postgresdb", configureSettings: settings => { settings.DisableRetry = false; @@ -147,7 +163,7 @@ Then calling the (); ``` -[!INCLUDE [integration-health-checks](../../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../../includes/client-integration-health-checks.md)] By default, the .NET Aspire PostgreSQL Entity Framework Core integrations handles the following: @@ -205,4 +221,3 @@ The .NET Aspire PostgreSQL Entity Framework Core integration will emit the follo - `ec_Npgsql_connection_pools` - `ec_Npgsql_multiplexing_average_commands_per_batch` - `ec_Npgsql_multiplexing_average_write_time_per_batch` - \ No newline at end of file diff --git a/docs/database/includes/postgresql-flexible-server.md b/docs/database/includes/postgresql-flexible-server.md index dc356c79fa..8a101852a1 100644 --- a/docs/database/includes/postgresql-flexible-server.md +++ b/docs/database/includes/postgresql-flexible-server.md @@ -55,123 +55,3 @@ The preceding call to `AddAzurePostgresFlexibleServer` configures the PostgresSQ > [!TIP] > When you call , it implicitly calls β€”which adds support for generating Azure resources dynamically during app startup. The app must configure the appropriate subscription and location. For more information, see [Local provisioning: Configuration](../../azure/local-provisioning.md#configuration). - -#### Generated provisioning Bicep - -If you're new to [Bicep](/azure/azure-resource-manager/bicep/overview), it's a domain-specific language for defining Azure resources. With .NET Aspire, you don't need to write Bicep by-hand, instead the provisioning APIs generate Bicep for you. When you publish your app, the generated Bicep is output alongside the manifest file. When you add an Azure PostgreSQL resource, the following Bicep is generated: - - -
-
-Toggle Azure PostgreSQL Bicep. -

- -:::code language="bicep" source="../../snippets/azure/AppHost/postgres-flexible.module.bicep"::: - -

-
- - -The preceding Bicep is a module that provisions an Azure PostgreSQL flexible server with the following defaults: - -- `authConfig`: The authentication configuration of the PostgreSQL server. The default is `ActiveDirectoryAuth` enabled and `PasswordAuth` disabled. -- `availabilityZone`: The availability zone of the PostgreSQL server. The default is `1`. -- `backup`: The backup configuration of the PostgreSQL server. The default is `BackupRetentionDays` set to `7` and `GeoRedundantBackup` set to `Disabled`. -- `highAvailability`: The high availability configuration of the PostgreSQL server. The default is `Disabled`. -- `storage`: The storage configuration of the PostgreSQL server. The default is `StorageSizeGB` set to `32`. -- `version`: The version of the PostgreSQL server. The default is `16`. -- `sku`: The SKU of the PostgreSQL server. The default is `Standard_B1ms`. -- `tags`: The tags of the PostgreSQL server. The default is `aspire-resource-name` set to the name of the Aspire resource, in this case `postgres-flexible`. - -In addition to the PostgreSQL flexible server, it also provisions an Azure Firewall rule to allow all Azure IP addresses. Finally, an administrator is created for the PostgreSQL server, and the connection string is outputted as an output variable. The generated Bicep is a starting point and can be customized to meet your specific requirements. - -#### Customize provisioning infrastructure - -All .NET Aspire Azure resources are subclasses of the type. This type enables the customization of the generated Bicep by providing a fluent API to configure the Azure resourcesβ€”using the API. For example, you can configure the `kind`, `consistencyPolicy`, `locations`, and more. The following example demonstrates how to customize the Azure Cosmos DB resource: - -:::code language="csharp" source="../../snippets/azure/AppHost/Program.ConfigurePostgresSQLInfra.cs" id="configure"::: - -The preceding code: - -- Chains a call to the API: - - The `infra` parameter is an instance of the type. - - The provisionable resources are retrieved by calling the method. - - The single is retrieved. - - The `sku` is set with . - - The high availability properties are set with in standby availability zone `"2"`. - - A tag is added to the flexible server with a key of `ExampleKey` and a value of `Example value`. - -There are many more configuration options available to customize the PostgreSQL flexible server resource. For more information, see . For more information, see [Azure.Provisioning customization](../../azure/integrations-overview.md#azureprovisioning-customization). - -### Connect to an existing Azure PostgreSQL flexible server - -You might have an existing Azure PostgreSQL flexible server that you want to connect to. Instead of representing a new Azure PostgreSQL flexible server resource, you can add a connection string to the app host. To add a connection to an existing Azure PostgreSQL flexible server, call the method: - -```csharp -var builder = DistributedApplication.CreateBuilder(args); - -var postgres = builder.AddConnectionString("postgres"); - -builder.AddProject("web") - .WithReference(postgres); - -// After adding all resources, run the app... -``` - -[!INCLUDE [connection-strings-alert](../../includes/connection-strings-alert.md)] - -The connection string is configured in the app host's configuration, typically under [User Secrets](/aspnet/core/security/app-secrets), under the `ConnectionStrings` section. The app host injects this connection string as an environment variable into all dependent resources, for example: - -```json -{ - "ConnectionStrings": { - "postgres": "Server=.postgres.database.azure.com;Database=;Port=5432;Ssl Mode=Require;User Id=;" - } -} -``` - -The dependent resource can access the injected connection string by calling the method, and passing the connection name as the parameter, in this case `"postgres"`. The `GetConnectionString` API is shorthand for `IConfiguration.GetSection("ConnectionStrings")[name]`. - -### Run Azure PostgreSQL resource as a container - -The Azure PostgreSQL hosting integration supports running the PostgreSQL server as a local container. This is beneficial for situations where you want to run the PostgreSQL server locally for development and testing purposes, avoiding the need to provision an Azure resource or connect to an existing Azure PostgreSQL server. - -To run the PostgreSQL server as a container, call the method: - -```csharp -var builder = DistributedApplication.CreateBuilder(args); - -var postgres = builder.AddAzurePostgresFlexibleServer("postgres") - .RunAsContainer(); - -var postgresdb = postgres.AddDatabase("postgresdb"); - -var exampleProject = builder.AddProject() - .WithReference(postgresdb); -``` - -The preceding code configures an Azure PostgreSQL Flexible Server resource to run locally in a container. - -> [!TIP] -> The `RunAsContainer` method is useful for local development and testing. The API exposes an optional delegate that enables you to customize the underlying configuration, such adding pgAdmin, pgWeb, adding a data volume or data bind mount, and adding an init bind mount. For more information, see the [.NET Aspire PostgreSQL hosting integration](../postgresql-integration.md#add-postgresql-pgadmin-resource) section. - -### Configure the Azure PostgreSQL server to use password authentication - -By default, the Azure PostgreSQL server is configured to use [Microsoft Entra ID](/azure/postgresql/flexible-server/concepts-azure-ad-authentication) authentication. If you want to use password authentication, you can configure the server to use password authentication by calling the method: - -```csharp -var builder = DistributedApplication.CreateBuilder(args); - -var username = builder.AddParameter("username", secret: true); -var password = builder.AddParameter("password", secret: true); - -var postgres = builder.AddAzurePostgresFlexibleServer("postgres") - .WithPasswordAuthentication(username, password); - -var postgresdb = postgres.AddDatabase("postgresdb"); - -var exampleProject = builder.AddProject() - .WithReference(postgresdb); -``` - -The preceding code configures the Azure PostgreSQL server to use password authentication. The `username` and `password` parameters are added to the app host as parameters, and the `WithPasswordAuthentication` method is called to configure the Azure PostgreSQL server to use password authentication. For more information, see [External parameters](../../fundamentals/external-parameters.md). diff --git a/docs/database/includes/sql-app-host.md b/docs/database/includes/sql-app-host.md index bb6b934952..29942842bf 100644 --- a/docs/database/includes/sql-app-host.md +++ b/docs/database/includes/sql-app-host.md @@ -130,7 +130,7 @@ For more information on providing parameters, see [External parameters](../../fu ### Connect to database resources -When the .NET Aspire app host runs, the server's database resources can be accessed from external tools, such as [SQL Server Management Studio (SSMS)](/sql/ssms/download-sql-server-management-studio-ssms) or [Azure Data Studio](/azure-data-studio/download-azure-data-studio). The connection string for the database resource is available in the dependent resources environment variables and is accessed using the [.NET Aspire dashboard: Resource details](../../fundamentals/dashboard/explore.md#resource-details) pane. The environment variable is named `ConnectionStrings__{name}` where `{name}` is the name of the database resource, in this example it's `database`. Use the connection string to connect to the database resource from external tools. Imagine that you have a database named `todos` with a single `dbo.Todos` table. +When the .NET Aspire app host runs, the server's database resources can be accessed from external tools, such as [SQL Server Management Studio (SSMS)](/sql/ssms/download-sql-server-management-studio-ssms) or [MSSQL for Visual Studio Code](/sql/tools/visual-studio-code-extensions/mssql/mssql-extension-visual-studio-code). The connection string for the database resource is available in the dependent resources environment variables and is accessed using the [.NET Aspire dashboard: Resource details](../../fundamentals/dashboard/explore.md#resource-details) pane. The environment variable is named `ConnectionStrings__{name}` where `{name}` is the name of the database resource, in this example it's `database`. Use the connection string to connect to the database resource from external tools. Imagine that you have a database named `todos` with a single `dbo.Todos` table. #### [SQL Server Management Studio](#tab/ssms) @@ -148,24 +148,24 @@ To connect to the database resource from SQL Server Management Studio, follow th For more information, see [SQL Server Management Studio: Connect to a server](/sql/ssms/quickstarts/ssms-connect-query-sql-server). -#### [Azure Data Studio](#tab/azure-data-studio) +#### [MSSQL for Visual Studio Code](#tab/mssql-vscode) -To connect to the database resource from Azure Data Studio, follow these steps: +To connect to the database resource from MSSQL for Visual Studio Code, follow these steps: -1. Open Azure Data Studio. -1. Select the **New** dropdown and choose **New connection**. +1. Open the **SQL SERVER** extension. +1. Select the **Add Connection** option under **CONNECTIONS**. - :::image type="content" source="media/ads-new-connection.png" lightbox="media/ads-new-connection.png" alt-text="Azure Data Studio: New / New connection screen capture."::: + :::image type="content" source="media/mssql-vscode-add-connection.png" lightbox="media/mssql-vscode-add-connection.png" alt-text="MSSQL for Visual Studio Code: Connections / add connection screen capture."::: 1. Change the **Input type** to **Connection string** and paste the connection string into the **Connection string** field. 1. Select **Connect**. - :::image type="content" source="media/ads-connect-details.png" lightbox="media/ads-connect-details.png" alt-text="Azure Data Studio: Connection string input details."::: + :::image type="content" source="media/mssql-vscode-connection-details.png" lightbox="media/mssql-vscode-connection-details.png" alt-text="MSSQL for Visual Studio Code: Connection string input details."::: -1. If you're connected, you can see the database resource in the active tab: +1. Once you're connected, you can see the database resource in the active tab and run queries against it: - :::image type="content" source="media/ads-connected.png" lightbox="media/ads-connected.png" alt-text="Azure Data Studio: Connected to database."::: + :::image type="content" source="media/mssql-vscode-connected.png" lightbox="media/mssql-vscode-connected.png" alt-text="MSSQL for Visual Studio Code: Connected to database."::: -For more information, see [Azure Data Studio: Connect to SQL Server](/azure-data-studio/quickstart-sql-server). +For more information, see [MSSQL for Visual Studio Code](/sql/tools/visual-studio-code-extensions/mssql/mssql-extension-visual-studio-code). --- diff --git a/docs/database/mongodb-integration.md b/docs/database/mongodb-integration.md index b329ff2600..bf3097138c 100644 --- a/docs/database/mongodb-integration.md +++ b/docs/database/mongodb-integration.md @@ -340,7 +340,7 @@ Here are the configurable options with corresponding default values: | `HealthCheckTimeout` | An `int?` value that indicates the MongoDB health check timeout in milliseconds. | | `DisableTracing` | A boolean value that indicates whether the OpenTelemetry tracing is disabled or not. | -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] By default, the .NET Aspire MongoDB client integration handles the following scenarios: diff --git a/docs/database/mysql-entity-framework-integration.md b/docs/database/mysql-entity-framework-integration.md index 061f5ee780..1512b35696 100644 --- a/docs/database/mysql-entity-framework-integration.md +++ b/docs/database/mysql-entity-framework-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire Pomelo MySQL Entity Framework Core integration description: Learn how to use the .NET Aspire MySQL Entity Framework integration, which includes both hosting and client integrations. -ms.date: 12/09/2024 +ms.date: 02/07/2025 --- # .NET Aspire Pomelo MySQL Entity Framework Core integration @@ -140,7 +140,7 @@ builder.EnrichMySqlDbContext( static settings => settings.DisableHealthChecks = true); ``` -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] The .NET Aspire Pomelo MySQL Entity Framework Core integration: diff --git a/docs/database/mysql-integration.md b/docs/database/mysql-integration.md index fd01bd3dfb..d31b7f9572 100644 --- a/docs/database/mysql-integration.md +++ b/docs/database/mysql-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire MySQL database integration description: Learn how to use the .NET Aspire MySQL database integration, which includes both hosting and client integrations. -ms.date: 12/09/2024 +ms.date: 02/07/2025 uid: storage/mysql-integration --- diff --git a/docs/database/oracle-entity-framework-integration.md b/docs/database/oracle-entity-framework-integration.md index 5f4a211fb5..a787e02c61 100644 --- a/docs/database/oracle-entity-framework-integration.md +++ b/docs/database/oracle-entity-framework-integration.md @@ -280,7 +280,7 @@ Here are the configurable options with corresponding default values: | `DisableRetry` | A boolean value that indicates whether command retries should be disabled or not. | | `CommandTimeout` | The time in seconds to wait for the command to execute. | -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] By default, the .NET Aspire Oracle Entity Framework Core integration handles the following: diff --git a/docs/database/postgresql-entity-framework-integration.md b/docs/database/postgresql-entity-framework-integration.md index 58b7f8348a..f5629a030f 100644 --- a/docs/database/postgresql-entity-framework-integration.md +++ b/docs/database/postgresql-entity-framework-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire PostgreSQL Entity Framework Core integration description: Learn how to integrate PostgreSQL with .NET Aspire applications using Entity Framework Core, using both hosting and client integrations. -ms.date: 11/05/2024 +ms.date: 02/07/2025 uid: database/postgresql-ef-core-integration --- diff --git a/docs/database/postgresql-integration.md b/docs/database/postgresql-integration.md index 97ef9277ce..9682101bf8 100644 --- a/docs/database/postgresql-integration.md +++ b/docs/database/postgresql-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire PostgreSQL integration description: Learn how to integrate PostgreSQL with .NET Aspire applications, using both hosting and client integrations. -ms.date: 11/05/2024 +ms.date: 02/07/2025 uid: database/postgresql-integration --- diff --git a/docs/database/sql-server-entity-framework-integration.md b/docs/database/sql-server-entity-framework-integration.md index c570125d41..c172376aab 100644 --- a/docs/database/sql-server-entity-framework-integration.md +++ b/docs/database/sql-server-entity-framework-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire SQL Server Entity Framework Core integration description: Learn how to use the .NET Aspire SQL Server Entity Framework integration, which includes both hosting and client integrations. -ms.date: 12/02/2024 +ms.date: 02/07/2025 uid: database/sql-server-ef-core-integration --- @@ -187,7 +187,7 @@ Here are the configurable options with corresponding default values: | `DisableMetrics` | A boolean value that indicates whether the OpenTelemetry metrics are disabled or not. | | `Timeout` | The time in seconds to wait for the command to execute. | -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] By default, the .NET Aspire Sql Server Entity Framework Core integration handles the following: diff --git a/docs/database/sql-server-integration.md b/docs/database/sql-server-integration.md index db71c2dba3..ef68ce8572 100644 --- a/docs/database/sql-server-integration.md +++ b/docs/database/sql-server-integration.md @@ -1,7 +1,7 @@ --- title: .NET Aspire SQL Server integration description: Learn how to use the .NET Aspire SQL Server integration, which includes both hosting and client integrations. -ms.date: 11/20/2024 +ms.date: 02/07/2025 uid: database/sql-server-integration --- diff --git a/docs/fundamentals/integrations-overview.md b/docs/fundamentals/integrations-overview.md index 16dec58b44..69405e3bc3 100644 --- a/docs/fundamentals/integrations-overview.md +++ b/docs/fundamentals/integrations-overview.md @@ -1,7 +1,7 @@ --- title: .NET Aspire integrations overview description: Explore the fundamental concepts of .NET Aspire integrations and learn how to integrate them into your apps. -ms.date: 12/09/2024 +ms.date: 02/06/2025 ms.topic: conceptual uid: dotnet/aspire/integrations --- @@ -103,25 +103,26 @@ For more information on working with .NET Aspire integrations in Visual Studio, Azure integrations configure applications to use Azure resources. These hosting integrations are available in the `Aspire.Hosting.Azure.*` NuGet packages, while their client integrations are available in the `Aspire.*` NuGet packages: -| Integration docs and NuGet packages | Description | -|--|--| -| - **Learn more**: [πŸ“„ Azure App Configuration](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.AppConfiguration/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.AppConfiguration](https://www.nuget.org/packages/Aspire.Hosting.Azure.AppConfiguration)
- **Client**: N/A | A library for interacting with [Azure App Configuration](/azure/azure-app-configuration/). | -| - **Learn more**: [πŸ“„ Azure Application Insights](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.ApplicationInsights/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.ApplicationInsights](https://www.nuget.org/packages/Aspire.Hosting.Azure.ApplicationInsights)
- **Client**: N/A | A library for interacting with [Azure Application Insights](/azure/azure-monitor/app/app-insights-overview). | -| - **Learn more**: [πŸ“„ Azure Cosmos DB - EF Core](../database/azure-cosmos-db-entity-framework-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.CosmosDB](https://www.nuget.org/packages/Aspire.Hosting.Azure.CosmosDB)
- **Client**: [πŸ“¦ Aspire.Microsoft.EntityFrameworkCore.Cosmos](https://www.nuget.org/packages/Aspire.Microsoft.EntityFrameworkCore.Cosmos) | A library for accessing Azure Cosmos DB databases with [Entity Framework Core](/ef/core/providers/cosmos/). | -| - **Learn more**: [πŸ“„ Azure Cosmos DB](../database/azure-cosmos-db-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.CosmosDB](https://www.nuget.org/packages/Aspire.Hosting.Azure.CosmosDB)
- **Client**: [πŸ“¦ Aspire.Microsoft.Azure.Cosmos](https://www.nuget.org/packages/Aspire.Microsoft.Azure.Cosmos) | A library for accessing [Azure Cosmos DB](/azure/cosmos-db/introduction) databases. | -| - **Learn more**: [πŸ“„ Azure Event Hubs](../messaging/azure-event-hubs-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.EventHubs](https://www.nuget.org/packages/Aspire.Hosting.Azure.EventHubs)
- **Client**: [πŸ“¦ Aspire.Azure.Messaging.EventHubs](https://www.nuget.org/packages/Aspire.Azure.Messaging.EventHubs) | A library for accessing [Azure Event Hubs](/azure/event-hubs/event-hubs-about). | -| - **Learn more**: [πŸ“„ Azure Functions](../serverless/functions.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Functions](https://www.nuget.org/packages/Aspire.Hosting.Azure.Functions)
- **Client**: N/A | A library for integrating with [Azure Functions](/azure/azure-functions/). | -| - **Learn more**: [πŸ“„ Azure Key Vault](../security/azure-security-key-vault-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.KeyVault](https://www.nuget.org/packages/Aspire.Hosting.Azure.KeyVault)
- **Client**: [πŸ“¦ Aspire.Azure.Security.KeyVault](https://www.nuget.org/packages/Aspire.Azure.Security.KeyVault) | A library for accessing [Azure Key Vault](/azure/key-vault/general/overview). | -| - **Learn more**: [πŸ“„ Azure Operational Insights](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.OperationalInsights/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.OperationalInsights](https://www.nuget.org/packages/Aspire.Hosting.Azure.OperationalInsights)
- **Client**: N/A | A library for interacting with [Azure Operational Insights](/azure/azure-monitor/logs/log-analytics-workspace-overview). | -| - **Learn more**: [πŸ“„ Azure AI OpenAI](../azureai/azureai-openai-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.CognitiveServices](https://www.nuget.org/packages/Aspire.Hosting.Azure.CognitiveServices)
- **Client**: [πŸ“¦ Aspire.Azure.AI.OpenAI](https://www.nuget.org/packages/Aspire.Azure.AI.OpenAI) | A library for accessing [Azure AI OpenAI](/azure/ai-services/openai/overview) or OpenAI functionality. | -| - **Learn more**: [πŸ“„ Azure PostgreSQL](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.PostgreSQL/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.PostgreSQL](https://www.nuget.org/packages/Aspire.Hosting.Azure.PostgreSQL)
- **Client**: N/A | A library for interacting with [Azure Database for PostgreSQL](/azure/postgresql/). | -| - **Learn more**: [πŸ“„ Azure AI Search](../azureai/azureai-search-document-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Search](https://www.nuget.org/packages/Aspire.Hosting.Azure.Search)
- **Client**: [πŸ“¦ Aspire.Azure.Search.Documents](https://www.nuget.org/packages/Aspire.Azure.Search.Documents) | A library for accessing [Azure AI Search](/azure/search/search-what-is-azure-search) functionality. | -| - **Learn more**: [πŸ“„ Azure Service Bus](../messaging/azure-service-bus-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.ServiceBus](https://www.nuget.org/packages/Aspire.Hosting.Azure.ServiceBus)
- **Client**: [πŸ“¦ Aspire.Azure.Messaging.ServiceBus](https://www.nuget.org/packages/Aspire.Azure.Messaging.ServiceBus) | A library for accessing [Azure Service Bus](/azure/service-bus-messaging/service-bus-messaging-overview). | -| - **Learn more**: [πŸ“„ Azure SignalR Service](../real-time/azure-signalr-scenario.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.SignalR](https://www.nuget.org/packages/Aspire.Hosting.Azure.SignalR)
- **Client**: [Microsoft.Azure.SignalR](https://www.nuget.org/packages/Microsoft.Azure.SignalR) | A library for accessing [Azure SignalR Service](/azure/azure-signalr/signalr-overview). | -| - **Learn more**: [πŸ“„ Azure Blob Storage](../storage/azure-storage-blobs-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Storage](https://www.nuget.org/packages/Aspire.Hosting.Azure.Storage)
- **Client**: [πŸ“¦ Aspire.Azure.Storage.Blobs](https://www.nuget.org/packages/Aspire.Azure.Storage.Blobs) | A library for accessing [Azure Blob Storage](/azure/storage/blobs/storage-blobs-introduction). | -| - **Learn more**: [πŸ“„ Azure Storage Queues](../storage/azure-storage-queues-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Storage](https://www.nuget.org/packages/Aspire.Hosting.Azure.Storage)
- **Client**: [πŸ“¦ Aspire.Azure.Storage.Queues](https://www.nuget.org/packages/Aspire.Azure.Storage.Queues) | A library for accessing [Azure Storage Queues](/azure/storage/queues/storage-queues-introduction). | -| - **Learn more**: [πŸ“„ Azure Table Storage](../storage/azure-storage-tables-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Storage](https://www.nuget.org/packages/Aspire.Hosting.Azure.Storage)
- **Client**: [πŸ“¦ Aspire.Azure.Data.Tables](https://www.nuget.org/packages/Aspire.Azure.Data.Tables) | A library for accessing the [Azure Table](/azure/storage/tables/table-storage-overview) service. | -| - **Learn more**: [πŸ“„ Azure Web PubSub](../messaging/azure-web-pubsub-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.WebPubSub](https://www.nuget.org/packages/Aspire.Hosting.Azure.WebPubSub)
- **Client**: [πŸ“¦ Aspire.Azure.Messaging.WebPubSub](https://www.nuget.org/packages/Aspire.Azure.Messaging.WebPubSub) | A library for accessing the [Azure Web PubSub](/azure/azure-web-pubsub/) service. | +| Integration | Docs and NuGet packages | Description | +|--|--|--| +| Azure App Configuration logo. | - **Learn more**: [πŸ“„ Azure App Configuration](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.AppConfiguration/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.AppConfiguration](https://www.nuget.org/packages/Aspire.Hosting.Azure.AppConfiguration)
- **Client**: N/A | A library for interacting with [Azure App Configuration](/azure/azure-app-configuration/). | +| Azure Application Insights logo. | - **Learn more**: [πŸ“„ Azure Application Insights](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.ApplicationInsights/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.ApplicationInsights](https://www.nuget.org/packages/Aspire.Hosting.Azure.ApplicationInsights)
- **Client**: N/A | A library for interacting with [Azure Application Insights](/azure/azure-monitor/app/app-insights-overview). | +| Azure Cache for Redis logo | - **Learn more**: [πŸ“„ Azure Cache for Redis](../caching/azure-cache-for-redis-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Redis](https://www.nuget.org/packages/Aspire.Hosting.Azure.Redis)
- **Client**: [πŸ“¦ Aspire.StackExchange.Redis](https://www.nuget.org/packages/Aspire.StackExchange.Redis) or [πŸ“¦ Aspire.StackExchange.Redis.DistributedCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.DistributedCaching) or [πŸ“¦ Aspire.StackExchange.Redis.OutputCaching](https://www.nuget.org/packages/Aspire.StackExchange.Redis.OutputCaching) | A library for accessing [Azure Cache for Redis](/azure/azure-cache-for-redis/). | +| Azure Cosmos DB EF logo. | - **Learn more**: [πŸ“„ Azure Cosmos DB - EF Core](../database/azure-cosmos-db-entity-framework-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.CosmosDB](https://www.nuget.org/packages/Aspire.Hosting.Azure.CosmosDB)
- **Client**: [πŸ“¦ Aspire.Microsoft.EntityFrameworkCore.Cosmos](https://www.nuget.org/packages/Aspire.Microsoft.EntityFrameworkCore.Cosmos) | A library for accessing Azure Cosmos DB databases with [Entity Framework Core](/ef/core/providers/cosmos/). | +| Azure Cosmos DB logo.| - **Learn more**: [πŸ“„ Azure Cosmos DB](../database/azure-cosmos-db-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.CosmosDB](https://www.nuget.org/packages/Aspire.Hosting.Azure.CosmosDB)
- **Client**: [πŸ“¦ Aspire.Microsoft.Azure.Cosmos](https://www.nuget.org/packages/Aspire.Microsoft.Azure.Cosmos) | A library for accessing [Azure Cosmos DB](/azure/cosmos-db/introduction) databases. | +| Azure Event Hubs logo. | - **Learn more**: [πŸ“„ Azure Event Hubs](../messaging/azure-event-hubs-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.EventHubs](https://www.nuget.org/packages/Aspire.Hosting.Azure.EventHubs)
- **Client**: [πŸ“¦ Aspire.Azure.Messaging.EventHubs](https://www.nuget.org/packages/Aspire.Azure.Messaging.EventHubs) | A library for accessing [Azure Event Hubs](/azure/event-hubs/event-hubs-about). | +| Azure Functions logo. | - **Learn more**: [πŸ“„ Azure Functions](../serverless/functions.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Functions](https://www.nuget.org/packages/Aspire.Hosting.Azure.Functions)
- **Client**: N/A | A library for integrating with [Azure Functions](/azure/azure-functions/). | +| Azure Key Vault logo. | - **Learn more**: [πŸ“„ Azure Key Vault](../security/azure-security-key-vault-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.KeyVault](https://www.nuget.org/packages/Aspire.Hosting.Azure.KeyVault)
- **Client**: [πŸ“¦ Aspire.Azure.Security.KeyVault](https://www.nuget.org/packages/Aspire.Azure.Security.KeyVault) | A library for accessing [Azure Key Vault](/azure/key-vault/general/overview). | +| Azure Operational Insights logo. | - **Learn more**: [πŸ“„ Azure Operational Insights](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.OperationalInsights/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.OperationalInsights](https://www.nuget.org/packages/Aspire.Hosting.Azure.OperationalInsights)
- **Client**: N/A | A library for interacting with [Azure Operational Insights](/azure/azure-monitor/logs/log-analytics-workspace-overview). | +| Azure OpenAI logo. | - **Learn more**: [πŸ“„ Azure AI OpenAI](../azureai/azureai-openai-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.CognitiveServices](https://www.nuget.org/packages/Aspire.Hosting.Azure.CognitiveServices)
- **Client**: [πŸ“¦ Aspire.Azure.AI.OpenAI](https://www.nuget.org/packages/Aspire.Azure.AI.OpenAI) | A library for accessing [Azure AI OpenAI](/azure/ai-services/openai/overview) or OpenAI functionality. | +| Azure PostgreSQL logo. | - **Learn more**: [πŸ“„ Azure PostgreSQL](https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.PostgreSQL/README.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.PostgreSQL](https://www.nuget.org/packages/Aspire.Hosting.Azure.PostgreSQL)
- **Client**: N/A | A library for interacting with [Azure Database for PostgreSQL](/azure/postgresql/). | +| Azure AI Search logo. | - **Learn more**: [πŸ“„ Azure AI Search](../azureai/azureai-search-document-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Search](https://www.nuget.org/packages/Aspire.Hosting.Azure.Search)
- **Client**: [πŸ“¦ Aspire.Azure.Search.Documents](https://www.nuget.org/packages/Aspire.Azure.Search.Documents) | A library for accessing [Azure AI Search](/azure/search/search-what-is-azure-search) functionality. | +| Azure Service Bus logo. | - **Learn more**: [πŸ“„ Azure Service Bus](../messaging/azure-service-bus-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.ServiceBus](https://www.nuget.org/packages/Aspire.Hosting.Azure.ServiceBus)
- **Client**: [πŸ“¦ Aspire.Azure.Messaging.ServiceBus](https://www.nuget.org/packages/Aspire.Azure.Messaging.ServiceBus) | A library for accessing [Azure Service Bus](/azure/service-bus-messaging/service-bus-messaging-overview). | +| Azure SignalR Service logo. | - **Learn more**: [πŸ“„ Azure SignalR Service](../real-time/azure-signalr-scenario.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.SignalR](https://www.nuget.org/packages/Aspire.Hosting.Azure.SignalR)
- **Client**: [Microsoft.Azure.SignalR](https://www.nuget.org/packages/Microsoft.Azure.SignalR) | A library for accessing [Azure SignalR Service](/azure/azure-signalr/signalr-overview). | +| Azure Blob Storage logo. | - **Learn more**: [πŸ“„ Azure Blob Storage](../storage/azure-storage-blobs-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Storage](https://www.nuget.org/packages/Aspire.Hosting.Azure.Storage)
- **Client**: [πŸ“¦ Aspire.Azure.Storage.Blobs](https://www.nuget.org/packages/Aspire.Azure.Storage.Blobs) | A library for accessing [Azure Blob Storage](/azure/storage/blobs/storage-blobs-introduction). | +| Azure Storage Queues logo. | - **Learn more**: [πŸ“„ Azure Storage Queues](../storage/azure-storage-queues-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Storage](https://www.nuget.org/packages/Aspire.Hosting.Azure.Storage)
- **Client**: [πŸ“¦ Aspire.Azure.Storage.Queues](https://www.nuget.org/packages/Aspire.Azure.Storage.Queues) | A library for accessing [Azure Storage Queues](/azure/storage/queues/storage-queues-introduction). | +| Azure Table Storage logo. | - **Learn more**: [πŸ“„ Azure Table Storage](../storage/azure-storage-tables-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.Storage](https://www.nuget.org/packages/Aspire.Hosting.Azure.Storage)
- **Client**: [πŸ“¦ Aspire.Azure.Data.Tables](https://www.nuget.org/packages/Aspire.Azure.Data.Tables) | A library for accessing the [Azure Table](/azure/storage/tables/table-storage-overview) service. | +| Azure Web PubSub logo. | - **Learn more**: [πŸ“„ Azure Web PubSub](../messaging/azure-web-pubsub-integration.md)
- **Hosting**: [πŸ“¦ Aspire.Hosting.Azure.WebPubSub](https://www.nuget.org/packages/Aspire.Hosting.Azure.WebPubSub)
- **Client**: [πŸ“¦ Aspire.Azure.Messaging.WebPubSub](https://www.nuget.org/packages/Aspire.Azure.Messaging.WebPubSub) | A library for accessing the [Azure Web PubSub](/azure/azure-web-pubsub/) service. | ### Amazon Web Services (AWS) hosting integrations diff --git a/docs/fundamentals/media/icons/AzureBlobPageStorage_256x.png b/docs/fundamentals/media/icons/AzureBlobPageStorage_256x.png new file mode 100644 index 0000000000..607d346e9e Binary files /dev/null and b/docs/fundamentals/media/icons/AzureBlobPageStorage_256x.png differ diff --git a/docs/fundamentals/media/icons/AzureFunctionApps_256x.png b/docs/fundamentals/media/icons/AzureFunctionApps_256x.png new file mode 100644 index 0000000000..ecba6661e3 Binary files /dev/null and b/docs/fundamentals/media/icons/AzureFunctionApps_256x.png differ diff --git a/docs/fundamentals/media/integrations-thumb.png b/docs/fundamentals/media/integrations-thumb.png index eef466a45b..94c4fe4d2f 100644 Binary files a/docs/fundamentals/media/integrations-thumb.png and b/docs/fundamentals/media/integrations-thumb.png differ diff --git a/docs/fundamentals/media/integrations.excalidraw b/docs/fundamentals/media/integrations.excalidraw index 0c8f8c2159..ba048b9fba 100644 --- a/docs/fundamentals/media/integrations.excalidraw +++ b/docs/fundamentals/media/integrations.excalidraw @@ -12,7 +12,7 @@ "height": 116.44586233380028, "angle": 0, "strokeColor": "#ffffff", - "backgroundColor": "#ffffff", + "backgroundColor": "transparent", "fillStyle": "solid", "strokeWidth": 1, "strokeStyle": "solid", @@ -23,128 +23,11 @@ "index": "aZ", "roundness": null, "seed": 40654804, - "version": 159, - "versionNonce": 1951460564, - "isDeleted": false, - "boundElements": null, - "updated": 1730826467413, - "link": null, - "locked": false - }, - { - "id": "UkozcL4XOrVG4uvpyQ9w5", - "type": "rectangle", - "x": 885.6078841774183, - "y": -437.2527943418964, - "width": 14.919749773649656, - "height": 445.79477627376747, - "angle": 0, - "strokeColor": "#ffffff", - "backgroundColor": "#ffffff", - "fillStyle": "solid", - "strokeWidth": 2, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "frameId": null, - "index": "aa", - "roundness": null, - "seed": 561198804, - "version": 685, - "versionNonce": 381964756, - "isDeleted": false, - "boundElements": [], - "updated": 1730826454403, - "link": null, - "locked": false - }, - { - "id": "opfoDtnlzhhC7YVQGwH-5", - "type": "rectangle", - "x": 345.6356856652692, - "y": -238.6158629493345, - "width": 555.2969156775546, - "height": 19.159126212637148, - "angle": 0, - "strokeColor": "#ffffff", - "backgroundColor": "#ffffff", - "fillStyle": "solid", - "strokeWidth": 2, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "frameId": null, - "index": "ab", - "roundness": null, - "seed": 328352084, - "version": 586, - "versionNonce": 1557540332, - "isDeleted": false, - "boundElements": [], - "updated": 1730826448835, - "link": null, - "locked": false - }, - { - "id": "Pl2zT-c6qlEGgpGtHcKbJ", - "type": "rectangle", - "x": 885.3580537429135, - "y": -10.487504732911361, - "width": 129.281709964706, - "height": 19.511245863037402, - "angle": 0, - "strokeColor": "#ffffff", - "backgroundColor": "#ffffff", - "fillStyle": "solid", - "strokeWidth": 2, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "frameId": null, - "index": "ac", - "roundness": null, - "seed": 1799961452, - "version": 287, - "versionNonce": 2055935956, + "version": 160, + "versionNonce": 62395714, "isDeleted": false, "boundElements": [], - "updated": 1730826358800, - "link": null, - "locked": false - }, - { - "id": "D8jpaFlfGHbtpatXXCZhR", - "type": "rectangle", - "x": 885.8929981634673, - "y": -437.1241557312922, - "width": 132.73147003668407, - "height": 19.197629679658178, - "angle": 0, - "strokeColor": "#ffffff", - "backgroundColor": "#ffffff", - "fillStyle": "solid", - "strokeWidth": 2, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "frameId": null, - "index": "ad", - "roundness": null, - "seed": 1122434028, - "version": 146, - "versionNonce": 1447338452, - "isDeleted": false, - "boundElements": [ - { - "id": "_KdUqv10orMLk7dx8GmgM", - "type": "arrow" - } - ], - "updated": 1730826355565, + "updated": 1738876377614, "link": null, "locked": false }, @@ -654,11 +537,11 @@ "index": "av", "roundness": null, "seed": 1150112789, - "version": 196, - "versionNonce": 1811758292, + "version": 197, + "versionNonce": 1276753630, "isDeleted": false, "boundElements": [], - "updated": 1730826356286, + "updated": 1738876365661, "link": null, "locked": false, "points": [ @@ -672,12 +555,7 @@ ] ], "lastCommittedPoint": null, - "startBinding": { - "elementId": "D8jpaFlfGHbtpatXXCZhR", - "focus": -0.0006845855370267234, - "gap": 1, - "fixedPoint": null - }, + "startBinding": null, "endBinding": { "elementId": "owpYWG6M3ugkY8Kq2doze", "focus": -0.0843023241681942, diff --git a/docs/fundamentals/media/integrations.png b/docs/fundamentals/media/integrations.png index f86e33996f..2ba3f75bf3 100644 Binary files a/docs/fundamentals/media/integrations.png and b/docs/fundamentals/media/integrations.png differ diff --git a/docs/includes/client-integration-health-checks.md b/docs/includes/client-integration-health-checks.md new file mode 100644 index 0000000000..7e10b2feeb --- /dev/null +++ b/docs/includes/client-integration-health-checks.md @@ -0,0 +1,12 @@ +--- +title: .NET Aspire integrations health checks +description: Learn how to use health checks with .NET Aspire integrations. +ms.topic: include +--- + +### Client integration health checks + +By default, .NET Aspire _client integrations_ have [health checks](../fundamentals/health-checks.md) enabled for all services. Similarly, many .NET Aspire _hosting integrations_ also enable health check endpoints. For more information, see: + +- [.NET app health checks in C#](/dotnet/core/diagnostics/diagnostic-health-checks) +- [Health checks in ASP.NET Core](/aspnet/core/host-and-deploy/health-checks) diff --git a/docs/includes/integration-health-checks.md b/docs/includes/integration-health-checks.md deleted file mode 100644 index f52632eb8b..0000000000 --- a/docs/includes/integration-health-checks.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: .NET Aspire integrations health checks -description: Learn how to use health checks with .NET Aspire integrations. -ms.topic: include ---- - -### Health checks - -By default, .NET Aspire integrations enable [health checks](../fundamentals/health-checks.md) for all services. For more information, see [.NET Aspire integrations overview](../fundamentals/integrations-overview.md). diff --git a/docs/logging/seq-integration.md b/docs/logging/seq-integration.md index cadb4f07f7..b412d8a399 100644 --- a/docs/logging/seq-integration.md +++ b/docs/logging/seq-integration.md @@ -180,7 +180,7 @@ builder.AddSeqEndpoint("seq", static settings => }); ``` -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] The .NET Aspire Seq integration handles the following: diff --git a/docs/messaging/azure-web-pubsub-integration.md b/docs/messaging/azure-web-pubsub-integration.md index 32fa44df1e..064fd1c991 100644 --- a/docs/messaging/azure-web-pubsub-integration.md +++ b/docs/messaging/azure-web-pubsub-integration.md @@ -166,7 +166,7 @@ builder.AddAzureWebPubSubServiceClient( clientBuilder.ConfigureOptions(options => options.Retry.MaxRetries = 5)); ``` -[!INCLUDE [integration-health-checks](../includes/integration-health-checks.md)] +[!INCLUDE [client-integration-health-checks](../includes/client-integration-health-checks.md)] The .NET Aspire Azure Web PubSub integration handles exposes a configurable health check that reports as _healthy_, when the client can successfully connect to the Azure Web PubSub service. diff --git a/docs/security/azure-security-key-vault-integration.md b/docs/security/azure-security-key-vault-integration.md index f79dbd1c5b..180446a232 100644 --- a/docs/security/azure-security-key-vault-integration.md +++ b/docs/security/azure-security-key-vault-integration.md @@ -166,7 +166,7 @@ The following configurable options are exposed through the + builder.AddAzureRedis("redis") + .WithAccessKeyAuthentication() + .ConfigureInfrastructure(infra => + { + var redis = infra.GetProvisionableResources() + .OfType() + .Single(); + + redis.Sku = new() + { + Family = RedisSkuFamily.BasicOrStandard, + Name = RedisSkuName.Standard, + Capacity = 1, + }; + redis.Tags.Add("ExampleKey", "Example value"); + }); + // + } +} diff --git a/docs/snippets/azure/AppHost/postgres-flexible.module.bicep b/docs/snippets/azure/AppHost/postgres-flexible.module.bicep index 21fbde0af9..4e879a5de0 100644 --- a/docs/snippets/azure/AppHost/postgres-flexible.module.bicep +++ b/docs/snippets/azure/AppHost/postgres-flexible.module.bicep @@ -59,4 +59,4 @@ resource postgres_flexible_admin 'Microsoft.DBforPostgreSQL/flexibleServers/admi ] } -output connectionString string = 'Host=${postgres_flexible.properties.fullyQualifiedDomainName};Username=${principalName}' +output connectionString string = 'Host=${postgres_flexible.properties.fullyQualifiedDomainName};Username=${principalName}' \ No newline at end of file diff --git a/docs/storage/azure-storage-blobs-integration.md b/docs/storage/azure-storage-blobs-integration.md index 5b30af7650..04650226a2 100644 --- a/docs/storage/azure-storage-blobs-integration.md +++ b/docs/storage/azure-storage-blobs-integration.md @@ -23,7 +23,7 @@ In your app host project, register the Azure Blob Storage integration by chainin var builder = DistributedApplication.CreateBuilder(args); var blobs = builder.AddAzureStorage("storage") - .RunAsEmulator(); + .RunAsEmulator() .AddBlobs("blobs"); builder.AddProject() diff --git a/docs/storage/includes/storage-app-host.md b/docs/storage/includes/storage-app-host.md index 64a840f6f0..83d4410539 100644 --- a/docs/storage/includes/storage-app-host.md +++ b/docs/storage/includes/storage-app-host.md @@ -176,9 +176,9 @@ var builder = DistributedApplication.CreateBuilder(args); var storage = builder.AddAzureStorage("storage").RunAsEmulator( azurite => { - azurite.WithBlobPort("blob", 27000) - .WithQueuePort("queue", 27001) - .WithTablePort("table", 27002); + azurite.WithBlobPort(27000) + .WithQueuePort(27001) + .WithTablePort(27002); }); // After adding all resources, run the app... diff --git a/docs/toc.yml b/docs/toc.yml index df4a7933ff..60c2dea8a2 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -135,6 +135,14 @@ items: href: azure/integrations-overview.md - name: Local Azure provisioning href: azure/local-provisioning.md + - name: Azure Cache for Redis + items: + - name: Azure Cache for Redis + href: caching/azure-cache-for-redis-integration.md + - name: Azure Cache for Redis distributed cache + href: caching/azure-cache-for-redis-distributed-caching-integration.md + - name: Azure Cache for Redis output caching + href: caching/azure-cache-for-redis-output-caching-integration.md - name: Azure Cosmos DB items: - name: Azure Cosmos DB - EF Core @@ -152,12 +160,14 @@ items: - name: Azure Key Vault displayName: key vault,security href: security/azure-security-key-vault-integration.md - - name: Azure PostgreSQL - EF Core - displayName: postgres,postgresql,database,flexible server,ef core,azure for database - href: database/azure-postgresql-entity-framework-integration.md - name: Azure PostgreSQL - displayName: postgres,postgresql,database,flexible server,azure for database - href: database/azure-postgresql-integration.md + items: + - name: Azure PostgreSQL - EF Core + displayName: postgres,postgresql,database,flexible server,ef core,azure for database + href: database/azure-postgresql-entity-framework-integration.md + - name: Azure PostgreSQL + displayName: postgres,postgresql,database,flexible server,azure for database + href: database/azure-postgresql-integration.md - name: Azure OpenAI displayName: azure ai,openai href: azureai/azureai-openai-integration.md diff --git a/docs/whats-new/dotnet-aspire-9.md b/docs/whats-new/dotnet-aspire-9.md index 01593dda90..e4b072f3ec 100644 --- a/docs/whats-new/dotnet-aspire-9.md +++ b/docs/whats-new/dotnet-aspire-9.md @@ -375,7 +375,7 @@ In order to make .NET Aspire applications more secure, Azure Database for Postgr The following examples demonstrate how to configure your application to connect to the Azure resources using Microsoft Entra ID: - [.NET Aspire: Azure PostgreSQL hosting integration](../database/azure-postgresql-integration.md). -- [.NET Aspire: Azure Redis hosting integration](../caching/stackexchange-redis-integration.md#azure-redis-hosting-integration). +- [.NET Aspire: Azure Redis hosting integration](../caching/azure-cache-for-redis-integration.md#hosting-integration). If you need to use password or access key authentication (not recommended), you can opt-in with the following code: