Provides extension methods and resource definitions for a .NET Aspire AppHost to configure Azure Web PubSub.
- Azure subscription - create one for free
Install the .NET Aspire Azure Web PubSub Hosting library with NuGet:
dotnet add package Aspire.Hosting.Azure.WebPubSub
In the Program.cs file of AppHost
, add a WebPubSub connection and consume the connection using the following methods:
var wps = builder.AddAzureWebPubSub("wps1");
var web = builder.AddProject<Projects.WebPubSubWeb>("webfrontend")
.WithReference(wps);