Skip to main content
Azure

How I Built a Fully Functional Blog on Azure for Just $1/Month

Brad Malgas

Brad Malgas

Author

11 July 20243 min read

Discover how I built a cloud-native blog with Azure all while keeping costs under $1 per month.

How I Built a Fully Functional Blog on Azure for Just $1/Month cover image

Building a blog is a great way to document projects and share knowledge, but hosting costs can quickly add up. I challenged myself to build a fully functional, scalable blog while keeping costs as low as possible. The result? AzureBlogify, a serverless blog running on Azure Static Web Apps, Azure Functions, and Cosmos DB, all for less than $1 per month.

In this guide, I'll walk you through my architecture choices, development process, and cost-saving strategies that made this possible.

Why Azure?

I'm passionate about cloud computing and already have several Microsoft certifications, so I wanted hands-on experience deploying a real-world project on Azure. Additionally, Azure's generous free tiers made it the perfect choice for this cost-optimized blog.

Architecture Overview

AzureBlogify is built using a serverless-first approach, meaning there are no virtual machines or long-running services, keeping costs low. Here's how the architecture works:

  • Frontend: Vue.js + Tailwind CSS, hosted on Azure Static Web Apps
  • Backend: Azure Functions for processing requests
  • Database: Azure Cosmos DB for storing blog posts
  • Storage: Azure Blob Storage for images
  • CI/CD: GitHub Actions for automated deployments

Step 1: Setting Up Azure Static Web Apps

Azure Static Web Apps is an ideal hosting solution for modern web applications. It provides built-in authentication, free SSL, and seamless integration with Azure Functions.

Deployment Process:

  1. Created a Vue.js frontend with TailwindCSS.
  2. Set up an Azure Static Web App via the Azure Portal.
  3. Configured GitHub Actions to automate deployments whenever changes are pushed.

Step 2: Building the Serverless Backend with Azure Functions

Instead of using a traditional web server, I leveraged Azure Functions, which only run when needed. This drastically reduces costs since there's no always-on infrastructure.

Key Features Implemented:

  • Fetching blog posts: A function retrieves posts from Cosmos DB.
  • Post caching: Implemented caching using Pinia to reduce API calls.
  • SEO optimizations: Ensuring each page has unique titles and metadata.

Step 3: Using Cosmos DB for Blog Posts

Azure Cosmos DB was the perfect fit for storing blog content due to its schema flexibility and low-cost free tier.

Optimization Strategies:

  • Used pagination to avoid fetching unnecessary data.
  • Leveraged indexing policies to optimize query performance.
  • Cached API responses for better frontend performance.

Step 4: CI/CD with GitHub Actions

To ensure seamless deployments, I set up GitHub Actions to automate:

  • Frontend deployments to Azure Static Web Apps.
  • Backend updates via Azure Functions.
  • Infrastructure provisioning using ARM templates.

Lessons Learned & Challenges

  • Frontend development: Since I'm primarily a backend developer, learning Vue.js and TailwindCSS was a challenge.
  • Cost optimization: Carefully managing API calls and optimizing queries helped keep costs low.
  • Scaling for the future: With more traffic, I'll explore image optimization via a CDN.

Conclusion

AzureBlogify is proof that you can build and run a professional blog on Azure without breaking the bank. By leveraging serverless architecture, free-tier services, and automation, I managed to keep the entire cost under $1 per month while maintaining scalability and performance.

If you're interested in setting up your own cloud-native blog, give Azure Static Web Apps and Functions a try. Let me know if you have any questions or feedback!

The best way to predict the future is to create it.

– Peter Drucker

Loading reactions…

Loading comments…