Share via


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
                        [--allow-anonymous {false, true}]
                        [--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

--allow-anonymous

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

Accepted values: false, true
Default value: False
--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.

Default value: 20
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az webpubsub hub delete

Delete hub settings for WebPubSub Service.

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

Optional Parameters

--hub-name

Name of the hub.

--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.

--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>.

--subscription

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az webpubsub hub show

Show hub settings for WebPubSub Service.

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

Optional Parameters

--hub-name

Name of the hub.

--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.

--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>.

--subscription

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

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
                        [--add]
                        [--allow-anonymous {false, true}]
                        [--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

--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>.

Default value: []
--allow-anonymous

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

Accepted values: false, true
--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.

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.

--name -n

Name of the webpubsub.

--remove

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

Default value: []
--resource-group -g

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

--set

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

Default value: []
--subscription

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

--websocket-keepalive

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.