Install
| Product | Versions |
|---|---|
| .NET |
README
Azure Web PubSub hosting integration
Use this integration to model, configure, and orchestrate Azure Web PubSub in an Aspire solution.
Getting started
Prerequisites
- Azure subscription - create one for free
Add the integration
From your AppHost directory, add the Aspire.Hosting.Azure.WebPubSub integration with the Aspire CLI:
aspire add Aspire.Hosting.Azure.WebPubSub
Usage example
In the AppHost, add a WebPubSub connection and reference it from another resource with either C# or TypeScript:
C#
var wps = builder.AddAzureWebPubSub("wps1");
var web = builder.AddProject<Projects.WebPubSubWeb>("webfrontend")
.WithReference(wps);
TypeScript
const wps = await builder.addAzureWebPubSub("wps1");
const web = await builder.addNodeApp("webfrontend", "../web-frontend", "server.js")
.withReference(wps);
Connection Properties
When you reference an Azure Web PubSub resource using WithReference, the following connection properties are made available to the consuming project:
| Property Name | Description |
|---|---|
Uri |
The HTTPS endpoint for the Web PubSub service, typically https://<resource-name>.webpubsub.azure.com/ |
Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called wps1 becomes WPS1_URI.
Additional documentation
- https://aspire.dev/integrations/gallery/
- https://aspire.dev/integrations/cloud/azure/azure-web-pubsub/azure-web-pubsub-host/
- https://learn.microsoft.com/azure/azure-web-pubsub/overview
Feedback & contributing
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.