az iot hub policy

(PREVIEW) 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]

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

az iot hub policy delete

Delete a shared access policy from an IoT hub.

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

Required Parameters

--hub-name
IoT Hub name.
--name -n
Shared access policy name.

Optional Parameters

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

az iot hub policy list

List shared access policies of an IoT hub.

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

Required Parameters

--hub-name
IoT Hub name.

Optional Parameters

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

az iot hub policy show

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

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

Required Parameters

--hub-name
IoT Hub name.
--name -n
Shared access policy name.

Optional Parameters

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