CmdID / az / az webpubsub / az webpubsub hub
az webpubsub hub create
Create hub settings for WebPubSub Service or Web PubSub for Socket.IO in Serverless Mode. Azure CLI extensions reference
2 examples 4 options Its page in the Azure CLI extensions reference
Examples
Create a hub setting with two event handler settings
az webpubsub hub create -n MyWebPubSub -g MyResourceGroup --hub-name MyHub --event-handler url-template="http://host.com" user-event-pattern="MyEvent" --event-handler url-template="http://host2.com" system-event="connected" system-event="disconnected" auth-type="ManagedIdentity" auth-resource="uri://myUri"Identify-nName of the webpubsub.-gName of resource group.--hub-nameThe hub to manage--event-handlerTemplate item for event handler settings.Create a hub setting with anonymous connection allowed
az webpubsub hub create -n MyWebPubSub -g MyResourceGroup --hub-name MyHub --allow-anonymous trueIdentify-nName of the webpubsub.-gName of resource group.--hub-nameThe hub to manage--allow-anonymousSet if anonymous connections are allowed for this hub.Options
--allow-anonymousSet if anonymous connections are allowed for this hub.--event-handlerTemplate item for event handler settings.--hub-nameThe hub to manage--websocket-keepaliveThe WebSocket keep-alive interval in seconds for all clients in the hub.