Ojasa Mirai

Ojasa Mirai

Cloud

Loading...

Learning Level

🟢 Beginner🔵 Advanced
🔧 Azure Account Setup⚙️ Azure Compute Overview🖥️ Virtual Machines🎯 App Service Deployment⚡ Azure Functions📁 Blob Storage🗄️ Azure SQL Database📊 Cosmos DB📊 Azure Monitoring🔑 Azure Identity & Access📈 Azure Scaling & Load Balancing🐳 Azure Containers & AKS🎯 Azure Static Web Apps💰 Azure Cost Optimization
Cloud/Azure Deployment/Azure Sql Database

🗄️ Azure SQL Database

Introduction

Azure SQL Database is a fully managed relational database with automatic backups, scaling, and security.

Key Learning Outcomes

By the end of this lesson, you'll understand:

  • Creating SQL databases and servers
  • Connecting from applications
  • Backups and recovery
  • Scaling and performance
  • Security and access control
  • Monitoring and performance tuning

Creating SQL Database

# Create SQL server
az sql server create \
  --name myserver \
  --resource-group myResourceGroup \
  --location eastus \
  --admin-user sqladmin \
  --admin-password MyPassword123!

# Create database
az sql db create \
  --resource-group myResourceGroup \
  --server myserver \
  --name mydatabase \
  --service-objective S0

Connecting from Applications

Node.js:

const sql = require('mssql');

const config = {
  server: 'myserver.database.windows.net',
  authentication: {
    type: 'default',
    options: {
      userName: 'sqladmin',
      password: 'MyPassword123!'
    }
  },
  options: {
    database: 'mydatabase',
    encrypt: true,
    trustServerCertificate: false,
    connectTimeout: 15000
  }
};

async function getUsers() {
  const pool = new sql.ConnectionPool(config);
  const conn = await pool.connect();
  
  const result = await conn.request()
    .query('SELECT * FROM users');
  
  await pool.close();
  return result.recordset;
}

Backups and Recovery

# List backups
az sql db list-backups \
  --resource-group myResourceGroup \
  --server myserver \
  --database mydatabase

# Restore from backup
az sql db restore \
  --resource-group myResourceGroup \
  --server myserver \
  --name mydatabase \
  --backup-resource-id /subscriptions/.../backups/backup123

Scaling

# Scale database
az sql db update \
  --resource-group myResourceGroup \
  --server myserver \
  --name mydatabase \
  --service-objective S1

Key Takeaways

  • **Fully managed** - no infrastructure management
  • **Automatic backups** - point-in-time recovery
  • **Scaling** - adjust resources as needed
  • **Security** - built-in encryption and access control
  • **Monitoring** - performance insights and recommendations

Next Steps

Learn about Cosmos DB for NoSQL databases, or explore Azure Monitoring.


Resources

Python Docs

Ojasa Mirai

Master AI-powered development skills through structured learning, real projects, and verified credentials. Whether you're upskilling your team or launching your career, we deliver the skills companies actually need.

Learn Deep • Build Real • Verify Skills • Launch Forward

Courses

PythonFastapiReactJSCloud

© 2026 Ojasa Mirai. All rights reserved.

TwitterGitHubLinkedIn