az iot hub connection-string
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.46.0 or higher). The extension will automatically install the first time you run an az iot hub connection-string command. Learn more about extensions.
Manage IoT Hub connection strings.
Commands
Name | Description | Type | Status |
---|---|---|---|
az iot hub connection-string show |
Show the connection strings for the specified IoT Hubs using the given policy name and key. |
Extension | GA |
az iot hub connection-string show
Show the connection strings for the specified IoT Hubs using the given policy name and key.
az iot hub connection-string show [--all]
[--default-eventhub {false, true}]
[--hub-name]
[--key-type {primary, secondary}]
[--pn]
[--resource-group]
Examples
Show the connection strings for all active state IoT Hubs in a subscription using the default policy and primary key.
az iot hub connection-string show
Show the connection strings for all active state IoT Hubs in a resource group using the default policy and primary key.
az iot hub connection-string show --resource-group MyResourceGroup
Show all connection strings of the given IoT Hub using primary key.
az iot hub connection-string show -n MyIotHub --all
Show the connection string of the given IoT Hub using the default policy and primary key.
az iot hub connection-string show -n MyIotHub
Show the connection string of the given IoT Hub using policy 'service' and secondary key.
az iot hub connection-string show -n MyIotHub --policy-name service --key-type secondary
Show the eventhub compatible connection string of the given IoT Hub's default eventhub.
az iot hub connection-string show -n MyIotHub --default-eventhub
Optional Parameters
Show all shared access policies for the respective IoT Hub.
Flag indicating the connection string returned is for the default EventHub endpoint. Default: false.
IoT Hub name or hostname. Required if --login is not provided.
Shared access policy key type for authentication.
Shared access policy with operation permissions for target IoT Hub entity.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.