Get a SAS token
- Install the Azure CLI
- Install the Azure IoT Extension
az extension add --name azure-iot
- Copy the connection string of the iothubowner policy In the Azure Portal, navigate to your IoT Hub, then to Security Settings - Shared access policy. CLick on iothubowner and copy the connection sttring.
- Create the token with:
az iot hub generate-sas-token --connection-string '<YOUR CONNECTION STRING>' --query "sas" -o tsv
- Copy the result of that command
Configure Postman
- Create a new request
- Method: PUT
- URL:
https://{your-iothub-name}.azure-devices.net/devices/{device-id}?api-version=2020-05-31-preview
- In the Headers, set the Authorization header to the previously copied SAS token
- The device ID is the device you're creating.
- For the body, most fields are optional. The minimal body you need to add is:
{
"deviceId": "{device-id}"
}
The other values are described in this doc
Hope this helps.