az iot hub identity

Manage identities of an Azure IoT hub.

Commands

Name Description Type Status
az iot hub identity assign

Assign managed identities to an IoT Hub.

Core GA
az iot hub identity remove

Remove managed identities from an IoT Hub.

Core GA
az iot hub identity show

Show the identity properties of an IoT Hub.

Core GA

az iot hub identity assign

Assign managed identities to an IoT Hub.

az iot hub identity assign [--ids]
                           [--name]
                           [--resource-group]
                           [--role]
                           [--scopes]
                           [--subscription]
                           [--system {false, true}]
                           [--user]

Examples

Assign user-assigned managed identities to an IoT Hub

az iot hub identity assign --name MyIoTHub --resource-group MyResourceGroup --user-assigned {resourceId1} {resourceId2}

Assign a system-assigned managed identity to an IoT Hub and assign a role to that identity.

az iot hub identity assign --name MyIoTHub --resource-group MyResourceGroup --system-assigned --role "Storage Blob Data Contributor" --scopes {resourceId}

Optional Parameters

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

IoT Hub name.

--resource-group -g

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

--role

Role to assign to the hub's system-assigned managed identity.

--scopes

Space separated list of scopes to assign the role (--role) for the system-assigned managed identity.

--subscription

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

--system --system-assigned

Assign a system-assigned managed identity to this hub.

accepted values: false, true
--user --user-assigned

Assign user-assigned managed identities to this hub. Accept space-separated list of identity resource IDs.

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 iot hub identity remove

Remove managed identities from an IoT Hub.

az iot hub identity remove [--ids]
                           [--name]
                           [--resource-group]
                           [--subscription]
                           [--system {false, true}]
                           [--user]

Examples

Remove a user-assigned managed identity from an IoT Hub

az iot hub identity remove --name MyIoTHub --resource-group MyResourceGroup --user-assigned {resourceId}

Remove a system-assigned managed identity from an IoT Hub.

az iot hub identity remove --name MyIoTHub --resource-group MyResourceGroup --system-assigned

Remove all identities from an IoT Hub.

az iot hub identity remove --name MyIoTHub --resource-group MyResourceGroup --system-assigned --user-assigned

Optional Parameters

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

IoT Hub name.

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

--system --system-assigned

Remove a system-assigned managed identity from this hub.

accepted values: false, true
--user --user-assigned

Remove user-assigned managed identities from this hub. Accept space-separated list of identity resource IDs.

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 iot hub identity show

Show the identity properties of an IoT Hub.

az iot hub identity show [--ids]
                         [--name]
                         [--resource-group]
                         [--subscription]

Examples

Show identity properties of an IoT Hub

az iot hub identity show --name MyIoTHub --resource-group MyResourceGroup

Optional Parameters

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

IoT Hub name.

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