Skip to content
StackPractices
beginner By Mathias Paulenko

Azure Basics — Core Services for Developers

A practical guide to Microsoft Azure core services for developers: compute, storage, databases, networking, and identity with hands-on examples.

Note: This guide follows English-language naming conventions and terminology standards common in international development teams. Examples use English identifiers and comments to maximize compatibility across codebases and tooling.

Overview

Microsoft Azure is the second-largest cloud platform, deeply integrated with enterprise tools like Microsoft 365, Active Directory, and .NET. For developers, Azure offers a thorough set of services for compute, storage, databases, networking, and identity management. Below is a practical guide to the services you will use most frequently and how they connect in a typical application architecture.

When to Use

  • For alternatives, see AWS Basics — Core Services for Developers.

  • Your organization uses Microsoft technologies (.NET, Office 365, Active Directory)

  • You need hybrid cloud capabilities

  • You want tight integration with CI/CD pipelines (Azure DevOps, GitHub Actions)

  • You are building enterprise applications with strong identity requirements

Compute — VMs, App Service, and Functions

Azure Virtual Machines

IaaS with full control over the OS and environment.

# Create a VM with Azure CLI
az vm create \
  --resource-group myResourceGroup \
  --name myVM \
  --image Ubuntu2204 \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys
VM SeriesUse Case
B-seriesBurstable, cost-effective dev/test
D-seriesGeneral purpose production
F-seriesCompute-optimized
E-seriesMemory-optimized

App Service

PaaS for web apps, APIs, and mobile backends. Supports .NET, Java, Node.js, Python, and PHP.

# Create a web app
az webapp create \
  --resource-group myResourceGroup \
  --plan myAppPlan \
  --name my-webapp-123 \
  --runtime "NODE|18-lts"

Capabilities: auto-scaling, deployment slots, custom domains, managed certificates, and built-in CI/CD.

Azure Functions

Serverless compute that runs code in response to triggers.

[FunctionName("HttpTrigger")]
public static IActionResult Run(
    [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req)
{
    return new OkObjectResult("Hello from Azure Functions");
}

Storage — Blob, Queue, and Table

Blob Storage

Object storage for unstructured data: files, images, backups, and logs.

# Create a storage account and container
az storage account create --name mystorage123 --sku Standard_LRS
az storage container create --name uploads --account-name mystorage123

# Upload a file
az storage blob upload --container-name uploads --file report.pdf --name report.pdf
TierUse Case
HotFrequently accessed data
CoolInfrequently accessed, stored ≥ 30 days
ArchiveRarely accessed, stored ≥ 180 days

Queue Storage

Simple message queuing for decoupling components.

from azure.storage.queue import QueueServiceClient

queue = QueueServiceClient.from_connection_string(conn_str).get_queue_client("tasks")
queue.send_message("process-order-123")
message = queue.receive_message()

Databases — Azure SQL and Cosmos DB

Azure SQL

Managed SQL Server with auto-scaling, backups, and high availability.

# Create a server and database
az sql server create --name myserver --admin-user sqladmin --admin-password Password123!
az sql db create --server myserver --name mydb --service-objective S0

Cosmos DB

Globally distributed NoSQL database with multiple APIs (SQL, MongoDB, Cassandra, Gremlin, Table).

from azure.cosmos import CosmosClient

client = CosmosClient(url, credential=key)
database = client.create_database_if_not_exists("mydb")
container = database.create_container_if_not_exists("users", partition_key="/id")
container.upsert_item({"id": "user-1", "name": "Alice"})

Networking — VNet

Virtual Network isolates and secures your Azure resources.

┌─────────────────────────────────────────────┐
│                   VNet                        │
│  ┌─────────────┐    ┌─────────────────────┐ │
│  │  Subnet A   │    │     Subnet B        │ │
│  │  ┌───────┐  │    │  ┌───────┐ ┌─────┐ │ │
│  │  │  VM   │  │    │  │ VM    │ │ SQL │ │ │
│  │  └───┬───┘  │    │  └───┬───┘ └──┬──┘ │ │
│  │      │      │    │      │        │    │ │
│  │  Public IP   │    │   Private Link     │ │
│  │  (inbound)   │    │   (no inbound)     │ │
│  └──────────────┘    └────────────────────┘ │
└─────────────────────────────────────────────┘

Key networking services:

  • VNet Peering: Connect networks across regions
  • Private Link: Securely access PaaS services over private IP
  • Application Gateway: Layer 7 load balancer with WAF
  • Azure Firewall: Managed network and application-level protection

Identity — Azure AD

Azure Active Directory (now Entra ID) provides authentication and authorization.

{
  "issuer": "https://login.microsoftonline.com/{tenant}/v2.0",
  "audience": "{client-id}",
  "claims": {
    "roles": ["Reader", "Contributor"]
  }
}

What works:

  • Use Managed Identity for service-to-service authentication
  • Enable Conditional Access policies
  • Use RBAC at the resource group level
  • Integrate with GitHub for OIDC-based deployments

Common Mistakes

  • Using a single region — deploy across availability zones for resilience
  • Not using managed identities — service principals with secrets expire and leak
  • Ignoring cost management — Azure Cost Management + budgets are essential
  • Over-provisioning VMs — right-size with Azure Advisor recommendations
  • Exposing databases publicly — always use Private Link or firewall rules

Troubleshooting

  • Pipeline fails silently: enable verbose logging and store pipeline artifacts between stages so you can inspect the exact state that failed.
  • Container crashes on startup: check that environment variables, secrets, and config files are mounted correctly. Read the first 50 lines of logs before scaling replicas.
  • Deployment rolls back repeatedly: verify health checks, resource limits, and startup probes. A failing readiness probe is a common cause of rolling restarts.
  • Slow CI builds: cache dependencies and docker layers. Split large test suites into parallel jobs to reduce wall-clock time.
  • Drift between environments: use infrastructure-as-code and immutable artifacts. Compare deployed versions with the declared source of truth before debugging behavior differences.

FAQ

Is Azure free? Azure offers a Free Tier: 12 months of select services + 200 USD credit for 30 days. Some services are always free within limits.

Azure vs AWS vs GCP?

  • Azure: Best for Microsoft-centric enterprises, hybrid cloud
  • AWS: Broadest service catalog, largest market share
  • GCP: Best for data analytics, AI/ML, Kubernetes

How do I deploy from GitHub? Use Azure App Service deployment center or GitHub Actions with azure/login and azure/webapps-deploy actions.

How do I get started with this in an existing project?

Start with a small, isolated part of your codebase. Apply the concepts from this guide to one module or service. Measure the impact, then expand to other areas.

What tools do I need?

The tools mentioned throughout this guide are listed in each section. Most are open-source and widely adopted. Check the related resources for setup instructions.

How do I measure success after implementing this?

Define clear metrics before starting: performance benchmarks, error rates, or maintainability indicators. Compare before and after. Iterate based on the data, not on assumptions.

Advanced Topics

Scenario: Web Architecture on Azure

System: Scalable web app, multi-region
Requirements: 99.95% availability, auto-scaling, DR

Architecture:
  Front Door (WAF + routing) -> App Service (multi-region)
    Region 1: East US
    Region 2: West Europe

  App Service -> Azure SQL (Active Geo-Replication)
  App Service -> Cosmos DB (multi-master)
  App Service -> Redis Cache
  App Service -> Blob Storage (static assets)

Key services:
  | Layer | Service | Configuration |
  |-------|---------|---------------|
  | DNS/Routing | Front Door | Priority routing, WAF |
  | Compute | App Service | P1v3, auto-scale 2-10 |
  | DB | Azure SQL | Business Critical, 4 vCores |
  | NoSQL | Cosmos DB | 10K RU/s, multi-master |
  | Cache | Azure Cache for Redis | Standard C1 |
  | Storage | Blob Storage | GRS, hot tier |
  | Monitoring | App Insights + Log Analytics | |
  | Secrets | Key Vault | |
  | CDN | Azure CDN | Edge nodes global |

Auto-scaling rules:
  - CPU > 70% for 5 min -> scale out (+1 instance)
  - CPU < 30% for 10 min -> scale in (-1 instance)
  - Min: 2 instances, Max: 10 instances
  - Queue length > 100 -> scale out
  - HTTP 5xx > 1% -> scale out + alert

Disaster Recovery:
  | Component | RPO | RTO | Strategy |
  |-----------|-----|-----|----------|
  | Azure SQL | < 5s | < 1min | Active Geo-Replication |
  | Cosmos DB | 0 | 0 | Multi-master |
  | Blob Storage | < 15min | < 15min | GRS + async copy |
  | App Service | 0 | < 5min | Front Door failover |
  | Redis | < 1min | < 5min | Geo-replica + warm-up |

Estimated costs (monthly):
  | Service | Cost |
  |---------|------|
  | App Service (2x P1v3) | $1,000 |
  | Azure SQL (BC, 4 vCores) | $1,800 |
  | Cosmos DB (10K RU/s) | $600 |
  | Redis (C1) | $300 |
  | Storage (1TB GRS) | $50 |
  | Front Door | $200 |
  | Bandwidth (1TB) | $50 |
  | Total | ~$4,000/month |

Lessons:
  - Front Door unifies WAF, routing, and health checks
  - Active Geo-Replication gives RPO < 5s for SQL
  - Cosmos DB multi-master eliminates write conflicts
  - App Service auto-scaling responds in 3-5 min
  - Key Vault centralizes secrets with automatic rotation

How do I choose between Azure SQL and Cosmos DB?

Use Azure SQL for relational data with stable schema, complex queries, and ACID transactions. Use Cosmos DB for semi-structured data, automatic horizontal scaling, global low latency, and when you need multi-master. If you need both, use SQL for transactional data and Cosmos for catalog/user profile data.

Common Production Pitfalls

  • Treating the guide as a checklist to complete once rather than a practice to evolve.
  • Adopting every recommendation at once instead of starting with one measured change.
  • Skipping the maturity assessment and forcing advanced practices on an unprepared team.
  • Not updating runbooks and on-call expectations as new practices are introduced.
  • Ignoring real incident data when prioritizing which parts of the guide to apply first.
  • Failing to assign an owner who reviews decisions quarterly.
  • Copying examples without adapting them to the team’s actual tooling and constraints.
  • Forgetting to measure outcomes before adding the next improvement.