IoT hub policies - az iot hub policy

Manage shared access policies of an IoT Hub.

These commands are in preview.

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 all shared access policies of an IoT Hub.
az iot hub policy show Get 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=.

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

az iot hub policy list

List all 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=.

az iot hub policy show

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