DEV Community

Cristian Sifuentes
Cristian Sifuentes

Posted on

Deploying a Full PaaS Architecture in Azure with Just a Bash Script

Deploying a Full PaaS Architecture in Azure with Just a Bash Script

Deploying a Full PaaS Architecture in Azure with Just a Bash Script

In modern cloud development, time is of the essence. Whether you're launching APIs, scaling SaaS platforms, or building microservices, Platform as a Service (PaaS) simplifies the infrastructure layer so you can focus on what matters most—your application.

In this post, we’ll walk through a real-world Azure PaaS use case using just a few lines of Azure CLI and Bash scripting. We'll provision a resource group, a Cosmos DB instance, a SQL Server, and deploy a Web App—all automated and production-ready.


Real-World Use Case: Rapid Prototyping for Multi-Tier Cloud Apps

Imagine a full-stack developer is building a modern app with a NoSQL document store (Cosmos DB), a relational backend (SQL Server), and a front-end running on Azure Web Apps. The goal: set it up in under 5 minutes using PaaS building blocks.


The Azure CLI Automation Script

#!/bin/bash

# Create a resource group
az group create -l eastus2 -n GrupoRecursosPaaS

# Create a Cosmos DB instance
az cosmosdb create --name cosmospaas123 --resource-group GrupoRecursosPaaS

# Deploy an Azure SQL Server
az sql server create -l eastus2 -g GrupoRecursosPaaS -n serverPaas006 -u aminespinoza -p Am0_Apr3nd3r$

# Create an App Service Plan
az appservice plan create -g GrupoRecursosPaaS -n aminWebPlan --sku B1 --is-linux

# Deploy a Web App
az webapp create -g GrupoRecursosPaaS -p aminWebPlan -n aminespinozaweb --runtime "NODE|18-lts"

# Optional Cleanup
az group delete -n GrupoRecursosPaaS
Enter fullscreen mode Exit fullscreen mode

Key Components Explained

Azure Service Purpose
Resource Group Logical container for all app components
Cosmos DB Globally distributed NoSQL database
SQL Server Managed relational database backend
App Service Plan Determines compute size and pricing tier
Web App Host the front-end or API logic

Benefits of Using PaaS

No server management

Auto-scaling & high availability

Built-in security & patching

Easy integration with Azure DevOps/GitHub

Cost-effective for prototypes and microservices


Extend This Use Case

Take your automation to the next level:

  • Deploy from GitHub: Add az webapp deployment source config
  • Secure with Managed Identities
  • Use Bicep for declarative deployments
  • Integrate Azure Cognitive Search or OpenAI

Security & DevOps Best Practices

Practice Description
Strong passwords Use Azure Key Vault or environment variables
Source control Store scripts in Git repositories
CI/CD integration Use Azure Pipelines or GitHub Actions
Role-based access Apply least-privilege principle with RBAC
Resource cleanup Automate teardown for ephemeral workloads

Final Thoughts

This script turns you from cloud operator to cloud orchestrator. With just a few CLI commands, you've built a scalable, modular, production-aligned architecture using Azure PaaS services. No infrastructure headaches. No over-engineering.

Azure PaaS + Bash = Maximum Impact with Minimal Effort 💥


✍️ Written by: Cristian Sifuentes – Full-stack dev crafting scalable apps with [NET - Azure], [Angular - React], Git, SQL & extensions. Clean code, dark themes, atomic commits

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.