az iot hub identity

Manage identities of an Azure IoT hub.

Commands

az iot hub identity assign

Assign managed identities to an IoT Hub.

az iot hub identity remove

Remove managed identities from an IoT Hub.

az iot hub identity show

Show the identity properties of an IoT Hub.

az iot hub identity assign

Assign managed identities to an IoT Hub.

az iot hub identity assign [--ids]
                           [--name]
                           [--resource-group]
                           [--role]
                           [--scopes]
                           [--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.

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

az iot hub identity remove

Remove managed identities from an IoT Hub.

az iot hub identity remove [--ids]
                           [--name]
                           [--resource-group]
                           [--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>.

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

az iot hub identity show

Show the identity properties of an IoT Hub.

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

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