Skip to main content
← Blog

My Instagram Bot Had a Serverless Glow-Up (RIP Azure Credits)

Oct 29, 2024

3 min read

View on GitHub

Remember that Instagram DP bot I built to avoid manually updating my profile picture like a functional human being? Well, plot twist: it got a serverless makeover, and now it's running on GitHub Actions instead of slowly draining my Azure student credits like some kind of digital vampire.

It's 3 AM, I'm checking my Azure dashboard, and I see my $100 student credits going poof faster than my motivation to study for finals. Apparently, keeping a bot alive 24/7 just to change my Instagram DP every few hours is... expensive? Who could have seen that coming. 🤡

Moving In With GitHub

Moving from Azure to GitHub Actions is like moving from a fancy apartment to your friend's couch — except the couch is more comfortable, doesn't charge rent, and actually wants you there.

Azure made me feel like a real developer. Professional dashboard, cloud architecture diagrams, the whole thing. It also made me feel like a broke developer, which technically I was. GitHub Actions just lives in the repo, runs every 3 hours, and costs $0.00. It also somehow makes me look like I know what DevOps is, which is a bonus.

The Python + instagrapi core stayed the same — if it ain't broke, etc. — but hosting, scheduling, and secrets all moved over. Azure Key Vault became GitHub Secrets (two fields, fight me). Azure Container Instances became GitHub runners. The cron trigger that used to cost me real money now costs me nothing.

Instagram DP Bot Demo

^ still doing this, but now with 100% more GitHub energy

The YAML That Runs My Aesthetic

The workflow is basically a fancy cron job with better documentation:

yaml
name: Update Instagram DPon:  schedule:    - cron: '30 1,4,7,10,13,16 * * *'  # Every 3 hours, 6:30 AM - 10:30 PM IST  workflow_dispatch:    inputs:      force_run:        description: 'Force run (ignore cooldown)'        default: 'false'

Translation: "Hey GitHub, change my DP every 3 hours during reasonable human hours, and let me force it if I'm feeling impatient."

Pro tip: The workflow_dispatch trigger is clutch when you want to test your bot at 2 AM because you can't sleep and need immediate validation that your code works.

Setting It Up (No PhD Required)

The Azure setup required resource groups, container registries, and a lot of praying. The GitHub Actions setup is: fork the repo, drop your photos in assets/images/, add two secrets, done. It runs itself.

Other people can actually fork it now without needing a cloud computing degree or a trust fund — which was a completely accidental win. Making something simpler to run accidentally made it more useful. Revolutionary concept.

The bot is currently running smoother than my brain at 8 AM lectures — changing every 3 hours, sleeping from 11:30 PM to 6:30 AM (better than me), costing exactly $0.00. My friends still ask how my profile picture is always different, and now I can answer without having to explain what Azure is.

The code is on GitHub. Fork it. Join the "my Instagram aesthetic is automated" club.


Built with GitHub Actions, powered by free tier energy, and the eternal quest to avoid manual labor...