How to code: Serverless Instagram Bot using Docker and Azure Functions.

I learned about serverless architecture and decided to build a bot. I use Azure Functions, Containers, Cosmos DB and TensorFlow.js to build this.

Michael Rhema
Another DIY Javascript Experiment
2 min readApr 10, 2019

--

Photo by Arno Smit on Unsplash

In this post, I’ll write about how I learnt to create the serverless component of an Instagram Bot using Azure Functions, Cosmos DB and Machine Learning using TensorFlow.js . The bot will like the first 10 photos on a timeline and also post a comment or reply comments and post photos. I am hoping this will help any one reading this to build apps that automate social media interaction like these ones on the Android Play Store. At least build the backend of the app.

In technical summary, I will —

  1. Use Azure Functions to handle requests which will determine what automated actions the bot will have to take.
  2. Deploy Browserless to an Azure Container Instance.
  3. Using Browserless to execute headless browser operations all inside of Docker containers.
  4. Azure Functions Bindings and Triggers.
  5. Deploy Azure functions using Continuous Integration for faster deployments using git. (coming soon)
  6. Secure data transfer of credentials and Browserless access.
  7. Use TensorFlow.js to detect HTML elements properly.

Right now, I don’t even know if all that is possible. So, I have broken this post into parts which are short enough to contain one task and expressive enough to understand what was acheived.

  1. Part One: How to run Headless Chrome Remotely using Browserless.
  2. Part Two: Web Automation & Headless browsing using Puppeteer.
  3. Part Three: Using Cosmos DB Bindings to save browser state / cookies.

👏Please clap. Please share this post. 👏

I appreciate claps if you ❤️ this post. Stay with me for Another DIY Javascript Experiment and dope coding topics including Machine Learning, React ecosystem, Linux and anything Javascript does.

--

--

Michael Rhema
Another DIY Javascript Experiment

Like those before me, I think therefore I am. These are my Javascript, Tech & Personal development notes. tohju.com