aspire
aspire copied to clipboard
Adding hub settings for Web PubSub
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Checklist
- Is this feature complete?
- [x] Yes. Ready to ship.
- [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if relevant?
- [x] Yes
- [ ] No
- Did you add public API?
- [x] Yes
- If yes, did you have an API Review for it?
- [ ] Yes
- [ ] No
- Did you add
<remarks />and<code />elements on your triple slash comments?- [ ] Yes
- [ ] No
- If yes, did you have an API Review for it?
- [ ] No
- [x] Yes
- Does the change make any security assumptions or guarantees?
- [ ] Yes
- If yes, have you done a threat model and had a security review?
- [ ] Yes
- [ ] No
- If yes, have you done a threat model and had a security review?
- [x] No
- [ ] Yes
- Does the change require an update in our Aspire docs?
- [x] Yes
- Link to aspire-docs issue:
- [ ] No
- [x] Yes
Microsoft Reviewers: Open in CodeFlow
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
I think I'd prefer to see this look more like the other resources with child resources:
var wps = builder.AddAzureWebPubSub("wps1");
var hub = builder.AddHub("chat");
var web = builder.AddProject<Projects.WebPubSubWeb>("webfrontend")
.WithExternalHttpEndpoints()
.WithReference(wps);
// Now only works in production since localhost is not accessible from Azure
if (builder.ExecutionContext.IsPublishMode)
{
hub.AddEventHandler($"{web.GetEndpoint("https")}/eventhandler", systemEvents: ["connected"]);
}