Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

az webpubsub hub

Note

This reference is part of the webpubsub extension for the Azure CLI (version 2.56.0 or higher). The extension will automatically install the first time you run an az webpubsub hub command. Learn more about extensions.

Commands to manage Webpubsub hub settings.

Commands

Name Description Type Status
az webpubsub hub create

Create hub settings for WebPubSub Service or Web PubSub for Socket.IO in Serverless Mode.

Extension GA
az webpubsub hub delete

Delete hub settings for WebPubSub Service.

Extension GA
az webpubsub hub list

List all hub settings for WebPubSub Service.

Extension GA
az webpubsub hub show

Show hub settings for WebPubSub Service.

Extension GA
az webpubsub hub update

Update hub settings for WebPubSub Service or Web PubSub for Socket.IO in Serverless Mode.

Extension GA

az webpubsub hub create

Create hub settings for WebPubSub Service or Web PubSub for Socket.IO in Serverless Mode.

az webpubsub hub create --hub-name
 --name
 --resource-group
 [--acquire-policy-token]
 [--allow-anonymous {false, true}]
 [--change-reference]
 [--event-handler]
 [--websocket-keepalive]

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"

Create a hub setting with anonymous connection allowed

az webpubsub hub create -n MyWebPubSub -g MyResourceGroup --hub-name MyHub --allow-anonymous true

Required Parameters

--hub-name

The hub to manage.

--name -n

Name of the webpubsub.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--allow-anonymous

Set if anonymous connections are allowed for this hub. True means allow and False means deny.

Property Value
Default value: False
Accepted values: false, true
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--event-handler

Template item for event handler settings. Use key=value pattern to set properties. Supported keys are "url-template", "user-event-pattern", "system-event", "auth-type" and "auth-resource". Setting multiple "system-event" results in an array and for other properties, only last set takes active.

--websocket-keepalive

The WebSocket keep-alive interval in seconds for all clients in the hub. Valid range: 1 to 120. Default to 20 seconds.

Property Value
Default value: 20

az webpubsub hub delete

Delete hub settings for WebPubSub Service.

az webpubsub hub delete [--acquire-policy-token]
 [--change-reference]
 [--hub-name]
 [--ids]
 [--name]
 [--resource-group]
 [--subscription]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--hub-name

Name of the hub.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the webpubsub.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments

az webpubsub hub list

List all hub settings for WebPubSub Service.

az webpubsub hub list --name
 --resource-group

Required Parameters

--name -n

Name of the webpubsub.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az webpubsub hub show

Show hub settings for WebPubSub Service.

az webpubsub hub show [--hub-name]
 [--ids]
 [--name]
 [--resource-group]
 [--subscription]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--hub-name

Name of the hub.

Property Value
Parameter group: Resource Id Arguments
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the webpubsub.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments

az webpubsub hub update

Update hub settings for WebPubSub Service or Web PubSub for Socket.IO in Serverless Mode.

az webpubsub hub update --hub-name
 [--acquire-policy-token]
 [--add]
 [--allow-anonymous {false, true}]
 [--change-reference]
 [--event-handler]
 [--force-string]
 [--ids]
 [--name]
 [--remove]
 [--resource-group]
 [--set]
 [--subscription]
 [--websocket-keepalive]

Examples

Update event handler settings of a hub

az webpubsub hub update -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"

Update to allow anonymous connection

az webpubsub hub update -n MyWebPubSub -g MyResourceGroup --hub-name MyHub --allow-anonymous true

Update to web socket keep alive interval in seconds (default is 20 seconds, minimum is 1, maximum is 120)

az webpubsub hub update -n MyWebPubSub -g MyResourceGroup --hub-name MyHub --websocket-keepalive 30

Required Parameters

--hub-name

The hub to manage.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--allow-anonymous

Set if anonymous connections are allowed for this hub. True means allow and False means deny.

Property Value
Accepted values: false, true
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--event-handler

Template item for event handler settings. Use key=value pattern to set properties. Supported keys are "url-template", "user-event-pattern", "system-event", "auth-type" and "auth-resource". Setting multiple "system-event" results in an array and for other properties, only last set takes active.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Property Value
Parameter group: Generic Update Arguments
Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the webpubsub.

Property Value
Parameter group: Resource Id Arguments
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--websocket-keepalive

The WebSocket keep-alive interval in seconds for all clients in the hub. Valid range: 1 to 120. Default to 20 seconds.


Feedback

Was this page helpful?