Skip to main content
net8.0

Garnet® support for Aspire.

Published
Aug 21, 2026
2mo ago
Total Downloads
127.3K
127,311

Install

dotnet add package Aspire.Hosting.Garnet --version 13.5.2
ProductVersions
.NET
net8.0

README

Garnet hosting integration

Use this integration to model, configure, and orchestrate a Garnet cache resource in an Aspire solution.

Getting started

Add the integration

From your AppHost directory, add the Aspire.Hosting.Garnet integration with the Aspire CLI:

aspire add Aspire.Hosting.Garnet

Usage example

In the AppHost, add a Garnet resource and reference it from another resource with either C# or TypeScript:

C#

var garnet = builder.AddGarnet("cache");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(garnet);

TypeScript

const garnet = await builder.addGarnet("cache");

const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
                       .withReference(garnet);

Connection Properties

When you reference a Garnet resource using WithReference, the following connection properties are made available to the consuming project:

Garnet

The Garnet resource exposes the following connection properties:

Property Name Description
Host The hostname or IP address of the Garnet server
Port The port number the Garnet server is listening on
Password The password for authentication (available when a password parameter is configured)
Uri The connection URI, with the format redis://:{Password}@{Host}:{Port}

Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called cache becomes CACHE_URI.

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

*Garnet MIT License. Copyright (c) Microsoft Corporation..

Changes from Previous Version

No structural changes between v13.5.1 and v13.5.2.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.The published metadata declares 34 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.