locally iothub

Preview

During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in

locally iothub

This page is part of the CLI Reference and is generated from the CLI's own help output, so it matches what locally iothub --help prints.

For more information see IoT Hub Emulator.

locally iothub

Interact with IoT Hubs within Locally.

Usage

locally iothub [flags]
  locally iothub [command]

Flags

-h, --help[=true|false]   help for iothub

Subcommands

locally iothub connection-string

Print the primary connection string for an IoT Hub.

Prints the connection string for the Hub's iothubowner policy, for the IoT Hub service SDKs and az iot hub.

HostName includes the Hub's port (5662 on the default instance, <base-port> + 662 otherwise). Without it, clients connect to 443 and are refused.

Pass it to az iot hub as --login for commands on Devices, Device Twins and direct methods. Managing the Hub itself (az iot hub create, Terraform, locally iothub) goes through ARM and doesn't need it.

AMQP (5671) and MQTT (5883) use their own ports, which clients on those transports must set separately.

Examples:
locally iothub connection-string --hub hub1

Usage

locally iothub connection-string [flags]

Flags

-h, --help[=true|false]   help for connection-string
      --hub string          Name of the IoT Hub

locally iothub dashboard

Open the Data Plane Emulator UI for an IoT Hub in your browser.

Open the Data Plane Emulator UI for an IoT Hub in your browser.

Examples:
locally iothub dashboard --hub hub1

Usage

locally iothub dashboard [flags]

Flags

-h, --help[=true|false]   help for dashboard
      --hub string          Name of the IoT Hub

locally iothub device

Manage Devices in an IoT Hub within Locally.

Usage

locally iothub device [flags]
  locally iothub device [command]

Flags

-h, --help[=true|false]   help for device

Subcommands

locally iothub device create

Create a Device in an IoT Hub.

Create a Device in an IoT Hub.

Examples:
locally iothub device create --hub hub1 --device sensor-01

Usage

locally iothub device create [flags]

Flags

--device string       Device ID
  -h, --help[=true|false]   help for create
      --hub string          Name of the IoT Hub

locally iothub device delete

Delete a Device from an IoT Hub.

Delete a Device from an IoT Hub.

Examples:
locally iothub device delete --hub hub1 --device sensor-01

Usage

locally iothub device delete [flags]

Flags

--device string       Device ID
  -h, --help[=true|false]   help for delete
      --hub string          Name of the IoT Hub

locally iothub device list

List Devices in an IoT Hub.

List Devices in an IoT Hub.

Examples:
locally iothub device list --hub hub1

Usage

locally iothub device list [flags]

Flags

-h, --help[=true|false]   help for list
      --hub string          Name of the IoT Hub

locally iothub device peek

Peek at device-to-cloud (D2C) telemetry events for a Device.

Peek at device-to-cloud (D2C) telemetry events for a Device.

Examples:
locally iothub device peek --hub hub1 --device sensor-01 --limit 5

Usage

locally iothub device peek [flags]

Flags

--device string       Device ID
  -h, --help[=true|false]   help for peek
      --hub string          Name of the IoT Hub
      --limit int           Maximum number of events to peek (default 10)

locally iothub device send

Send a device-to-cloud (D2C) telemetry message for a Device.

Send a device-to-cloud (D2C) telemetry message for a Device.

Examples:
locally iothub device send --hub hub1 --device sensor-01 --body '{"temperature": 21.5}' --content-type application/json

Usage

locally iothub device send [flags]

Flags

--body string            Inline telemetry body
      --body-file string       Path to a file containing the telemetry body
      --content-type string    Content-Type of the telemetry body
      --count int              Number of copies of the telemetry message to send (default 1)
      --device string          Device ID
  -h, --help[=true|false]      help for send
      --hub string             Name of the IoT Hub
      --property stringArray   Custom telemetry property as key=value (repeatable)

locally iothub device show

Show details for a Device in an IoT Hub.

Show details for a Device in an IoT Hub.

Examples:
locally iothub device show --hub hub1 --device sensor-01

Usage

locally iothub device show [flags]

Flags

--device string       Device ID
  -h, --help[=true|false]   help for show
      --hub string          Name of the IoT Hub

locally iothub twin

Manage Device Twins in an IoT Hub within Locally.

Usage

locally iothub twin [flags]
  locally iothub twin [command]

Flags

-h, --help[=true|false]   help for twin

Subcommands

locally iothub twin show

Show the Device Twin for a Device in an IoT Hub.

Show the Device Twin for a Device in an IoT Hub.

Examples:
locally iothub twin show --hub hub1 --device sensor-01

Usage

locally iothub twin show [flags]

Flags

--device string       Device ID
  -h, --help[=true|false]   help for show
      --hub string          Name of the IoT Hub

locally iothub twin update

Update the desired properties of a Device Twin.

Update the desired properties of a Device Twin.

Examples:
locally iothub twin update --hub hub1 --device sensor-01 --desired '{"interval": 30}'

Usage

locally iothub twin update [flags]

Flags

--desired string      Desired properties JSON string
      --device string       Device ID
  -h, --help[=true|false]   help for update
      --hub string          Name of the IoT Hub
Preview

During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in

A local cloud for you and your AI agents.

Your Azure infrastructure, running on your machine. Deploy in seconds, break things freely, and ship to Azure when you're ready.