Azure IoT Hub に az-cli で pub/sub
sas トークンで接続する場合です。
publish.sh
HubName=iot-aa
deviceId=pansy
#
ddx=`date`
az iot device c2d-message send -d ${deviceId} \
--data "Hello World $ddx" \
--props "key0=value0;key1=value1" -n ${HubName}
#
こちらのプログラムで subscribe した結果
Azure IoT Hub に paho で pub/sub
***on_message ***
devices/pansy/messages/devicebound/%24.mid=31e11faf-385d-4ff2-a10d-ff4ed0d90205&%24.to=%2Fdevices%2Fiwata%2Fmessages%2Fdevicebound&%24.ce=utf-8&key0=value0&key1=value1&iothub-ack=none Hello World 2021年 1月 16日 土曜日 15:50:02 JST
次のようなメッセージが出たら、az login を行って下さい。
AADSTS50132: The session is not valid due the following reasons: password expiration or recent password change, SSO Artifact is invalid or expired, session is not fresh enough for application, or a silent sign-in request was sent but the user's session with Azure AD is invalid or has expired.
$ az login
You have logged in. Now let us find all the subscriptions to which you have access...
subscribe.sh
#
HubName=iot-aa
deviceId=pansy
#
az iot device simulate -d ${deviceId} -n ${HubName}
#
az iot hub monitor-events --output table --hub-name ${HubName}
#
Author And Source
この問題について(Azure IoT Hub に az-cli で pub/sub), 我々は、より多くの情報をここで見つけました https://qiita.com/ekzemplaro/items/ae20abf486f1f0b2b038著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .