Azure PaaS Daily Deep Dive (Day 2)
Learning Azure PaaS — A Daily Deep Dive (Day 2 of 8)
Azure App Services — The Managed Web Platform
Azure App Service hosts web apps, APIs, and mobile backends without you managing servers. Deploy code; Azure handles OS, runtime, patching, and scaling.
Four App Service Types
Type | Best For | Notes |
---|---|---|
Web Apps | Web sites, REST APIs | .NET, Node.js, Python, Java, PHP, static sites. Custom domains & TLS. |
API Apps | REST services | OpenAPI/Swagger friendly, easy integration with Logic Apps/Power Platform. |
Mobile Apps | Mobile backends | Push notifications, auth, offline sync features for iOS/Android clients. |
WebJobs | Background tasks | On-demand or scheduled jobs tied to your App Service (think cron). |
Core Building Blocks
- App Service Plan: The compute pool (size, region, tier) your apps run on. Multiple apps can share one plan.
- Deployment Slots: Create staging and production slots; swap for zero-downtime releases.
- Scaling: Manual or autoscale by CPU/requests/schedule. Scale up (bigger SKU) or out (more instances).
- Networking: VNet integration, Private Endpoints, access restrictions for IP locking.
- Secrets & Identity: Managed Identity + Key Vault for connection strings/credentials.
- Observability: App Insights for logs, traces, metrics, and distributed tracing.
Pricing Tiers (Quick View)
Tier | Use Case | Highlights |
---|---|---|
Free/Shared | Trials, learning | Limited resources; great for demos and sandboxes. |
Basic/Standard | Small–medium prod apps | Multiple instances, custom domains, SSL, deployment slots (Std+). |
Premium | High-performance prod | Faster hardware, more instances, VNet features, better scaling. |
Isolated (ASE v3) | Strict isolation/regulatory | Runs in your VNet for maximum isolation and scale. |
CI/CD — Shipping Without Babysitting
- Hook up GitHub Actions or Azure DevOps; build & deploy on every push.
- Use deployment slots for blue-green or canary releases.
- Keep secrets in Key Vault; apps use Managed Identity to fetch them.
Common Gotchas
- Plan Sizing: Too small = throttling; too large = wasted spend. Start modest → monitor → right-size.
- Cold Starts: For always-on workloads, enable “Always On” (non-Free tiers).
- Networking: Private networking needs the right SKU and setup (VNet integration/Private Endpoint).
- Logs: Turn on App Insights early; add custom telemetry so prod issues aren’t mysteries.
Hands-On (20 min)
-
Create a new Web App on a Basic/Standard plan:
- In the Azure portal, search for App Services and click Create.
- Select your subscription and resource group (or create a new one).
- Enter a globally unique name for your app (e.g.,
my-rag-demo
). - Choose Code as publish option, select runtime stack (e.g., .NET, Node.js), and pick region.
- Under App Service Plan, create a new plan using Basic/Standard tier.
- Review + Create → then hit Create to deploy.
-
Add a staging deployment slot and deploy there first:
- Navigate to your Web App in the Azure portal.
- Under Deployment, select Deployment slots.
- Click Add Slot, name it
staging
, and clone settings from production. - Deploy your code to the staging slot first (via GitHub Actions, ZIP deploy, or VS Code).
- Verify staging is running correctly.
- When ready, use the Swap action to promote staging → production without downtime.
-
Configure GitHub Actions for Azure App Service:
- In your app’s GitHub repo, go to Actions tab → set up a new workflow.
- Choose the Azure App Service deploy workflow template.
- Add your Azure credentials using GitHub secrets (via
AZURE_CREDENTIALS
JSON from Azure portal). - Modify the workflow YAML to point at your app name and slot (e.g., staging).
- Commit changes → workflow runs and deploys code to staging.
- Verify build logs show a successful deploy.
Sample workflow YAML (scrollable):
name: Deploy to Azure Web App (staging) on: push: branches: [ main ] permissions: contents: read id-token: write env: AZURE_WEBAPP_NAME: my-rag-demo AZURE_WEBAPP_PACKAGE_PATH: '.' SLOT_NAME: 'staging' jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 # Example: Node.js app. Swap for dotnet, python, or java as needed. - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Install & build run: | npm ci npm run build --if-present - name: Azure Login uses: azure/login@v2 with: creds: ${{ secrets.AZURE_CREDENTIALS }} - name: Deploy to Web App (staging slot) uses: azure/webapps-deploy@v3 with: app-name: ${{ env.AZURE_WEBAPP_NAME }} slot-name: ${{ env.SLOT_NAME }} package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} - name: Logout run: az logout
Tip: For .NET apps, replace the Node steps with
actions/setup-dotnet
anddotnet publish
. For Python, useactions/setup-python
and yourrequirements.txt
step. -
Skim Azure Application Insights:
- In the portal, open your Web App → Application Insights.
- Enable if not already active (creates a new resource).
- Check Live Metrics Stream for real-time requests and failures.
- Use Search to query logs and traces.
- Explore charts for server response time, dependency calls, and availability tests.
Extra learning: Explore the official Microsoft Learn module: Introduction to Azure App Service for a guided hands-on lab.
Interview soundbite: “App Service is more than ‘host my site’ — it’s a managed platform with plans, slots, autoscale, VNet options, and built-in CI/CD. I deploy code, monitor with App Insights, and let Azure handle the platform work.”