Telegram bot to controll azure vm
Preface
In the organization IM currently work on \ with it takes months to provide permissions to azure resources, meanwhile I thought it will be good practice to develop a Telegram bot who recieve vm operation requests and operate the vms by the allowed users.
Currenly budget mode is enable by default and checks if users are currently using the vm in order to save money.
Configurations. In order to use the bot you need to provide 2 files and token,
- allowed_users.json - in order to filter telegram messages from not authorized users.
- azure_credential_param.json - which contain all the secrets for azure api.
- and ofcurse telegram API token, and set it in telegramlib.
set the bot up.
- boot up a small vm or any thing that can run pythons.
- run: pip install -r requirements.txt
- recommended: set the main.py as system service that startup on boot.
- congratulations: you on the budget now.