mosquitto のクライアントのインストール
sudo apt install mosquitto-clients
azure-cli のインストール
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
インストールされたことを確認
$ az --version
azure-cli 2.17.1
core 2.17.1
telemetry 1.0.6
Python location '/opt/az/bin/python3'
Extensions directory '/home/uchida/.azure/cliextensions'
Python (Linux) 3.6.10 (default, Dec 31 2020, 08:28:31)
[GCC 10.2.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Please let us know how we are doing: https://aka.ms/azureclihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
Azure にログイン
$ az login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code H4GVAAAAA to authenticate.
ブラウザーで、https://microsoft.com/devicelogin にアクセスしてコードを入れます。
拡張機能のインストール
az extension add --name azure-iot
SAS トークンの取得
az iot hub generate-sas-token -n iot-first
pip3 のインストール
sudo apt install python3-pip
paho のインストール
sudo pip3 install paho-mqtt