az iot hub policy

Manage shared access policies of an IoT hub.

Commands

az iot hub policy create Create a new shared access policy in an IoT hub.
az iot hub policy delete Delete a shared access policy from an IoT hub.
az iot hub policy list List shared access policies of an IoT hub.
az iot hub policy show Get the details of a shared access policy of an IoT hub.

az iot hub policy create

Create a new shared access policy in an IoT hub.

az iot hub policy create --hub-name
--name
--permissions
[--resource-group]
[--subscription]

Examples

Create a new shared access policy.

az iot hub policy create --hub-name MyIotHub --name new-policy --permissions RegistryWrite ServiceConnect DeviceConnect

Required Parameters

--hub-name

IoT Hub name.

--name -n

Shared access policy name.

--permissions

Permissions of shared access policy. Use space-separated list for multiple permissions. Possible values: RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect.

Optional Parameters

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

az iot hub policy delete

Delete a shared access policy from an IoT hub.

az iot hub policy delete [--hub-name]
[--ids]
[--name]
[--resource-group]
[--subscription]

Optional Parameters

--hub-name

IoT Hub name.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Shared access policy 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.

az iot hub policy list

List shared access policies of an IoT hub.

az iot hub policy list [--hub-name]
[--ids]
[--resource-group]
[--subscription]

Examples

List shared access policies of an IoT hub. (autogenerated)

az iot hub policy list --hub-name MyHub --resource-group MyResourceGroup

Optional Parameters

--hub-name

IoT Hub name.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

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

az iot hub policy show

Get the details of a shared access policy of an IoT hub.

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

Examples

Get the details of a shared access policy of an IoT hub. (autogenerated)

az iot hub policy show --hub-name MyHub --name MySharedAccessPolicy

Optional Parameters

--hub-name

IoT Hub name.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Shared access policy 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.