Azure Supported Services
NightOps supports automated start/stop management for the following Microsoft Azure services. These services can be safely turned off and restored without requiring manual reconfiguration.
Supported Services Overview
| Service | Stop Method | Start Method | Data Preserved | Config Preserved |
|---|---|---|---|---|
| Virtual Machines | Deallocate | Start | ✅ | ✅ |
| Azure SQL Database | Pause | Resume | ✅ | ✅ |
| Container Apps | Scale to 0 | Restore Replicas | N/A | ✅ |
| AKS Node Pools | Scale to 0 | Restore Count | ✅ (with PV) | ✅ |
| VM Scale Sets | Scale to 0 | Restore Capacity | N/A | ✅ |
| Synapse SQL Pools | Pause | Resume | ✅ | ✅ |
Virtual Machines
Azure Virtual Machines can be deallocated and started without losing configuration or managed disk data.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | VirtualMachines.ListAll | List all VMs in subscription |
| Stop | VirtualMachines.Deallocate | Deallocate a running VM |
| Start | VirtualMachines.Start | Start a deallocated VM |
| Status | VirtualMachines.InstanceView | Check VM power state |
What's Preserved
- ✅ Managed disks and data
- ✅ Network interfaces
- ✅ Managed identity
- ✅ Private IP address (static)
- ✅ Tags and metadata
- ✅ VM size configuration
Caveats
Dynamic public IPs are released on deallocation. Use static public IPs if a fixed IP is required.
Temporary disk (D: drive on Windows, /dev/sdb on Linux) data is lost on deallocation.
Spot VMs can be deallocated but may not restart if capacity is unavailable.
Always use Deallocate (not Stop) to avoid compute charges. Stop keeps the VM allocated and still incurs costs.
Azure SQL Database
Azure SQL Database serverless tier can be auto-paused, or databases can be exported/deleted for complete cost savings.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | Databases.ListByServer | List all databases on a server |
| Stop | Databases.Pause | Pause a serverless database |
| Start | Databases.Resume | Resume a paused database |
| Status | Databases.Get | Check database status |
What's Preserved
- ✅ All data
- ✅ Database configuration
- ✅ Connection strings
- ✅ Firewall rules (server-level)
- ✅ Auditing configuration
Caveats
Manual pause/resume is only available for Serverless compute tier. Provisioned databases cannot be paused.
Paused databases auto-resume on any connection attempt. Ensure applications don't accidentally wake the database.
DTU-based databases (Basic, Standard, Premium) cannot be paused. Consider serverless for dev/staging.
Container Apps
Azure Container Apps can be scaled to zero replicas and restored to their previous configuration.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | ContainerApps.ListByResourceGroup | List all container apps |
| Stop | ContainerApps.Update (minReplicas: 0, maxReplicas: 0) | Scale to zero |
| Start | ContainerApps.Update (restore min/max) | Restore replica count |
| Status | ContainerApps.Get | Check app status |
What's Preserved
- ✅ Container configuration
- ✅ Environment variables
- ✅ Secrets
- ✅ Ingress configuration
- ✅ Managed identity
- ✅ Dapr configuration
Caveats
When scaled to zero, the first request after restoration will experience a cold start delay.
NightOps stores the original scaling configuration before setting to zero.
AKS Node Pools
AKS user node pools can be scaled to zero nodes while preserving cluster configuration.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | AgentPools.List | List all node pools in a cluster |
| Stop | AgentPools.CreateOrUpdate (count: 0) | Scale to zero nodes |
| Start | AgentPools.CreateOrUpdate (restore count) | Restore node count |
| Status | AgentPools.Get | Check node pool status |
What's Preserved
- ✅ Node pool configuration
- ✅ VM size
- ✅ Node labels and taints
- ✅ Autoscaler configuration
- ✅ OS configuration
Caveats
The system node pool cannot be scaled to zero. At least one system pool must have nodes.
AKS control plane is free, but you still pay for the system node pool.
Scale-up takes 3-5 minutes for nodes to become ready and pods to be scheduled.
VM Scale Sets
Virtual Machine Scale Sets can be scaled to zero instances and restored to previous capacity.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | VirtualMachineScaleSets.ListAll | List all VMSS |
| Stop | VirtualMachineScaleSets.Update (capacity: 0) | Scale to zero |
| Start | VirtualMachineScaleSets.Update (restore capacity) | Restore capacity |
| Status | VirtualMachineScaleSets.Get | Check VMSS status |
What's Preserved
- ✅ Scale set configuration
- ✅ VM image
- ✅ Network configuration
- ✅ Load balancer rules
- ✅ Autoscale settings
- ✅ Extensions
Caveats
All instances are deleted on scale to zero. New instances are created on scale-up.
NightOps stores original capacity for accurate restoration.
Synapse SQL Pools
Azure Synapse dedicated SQL pools can be paused and resumed, preserving all data.
API Operations
| Operation | API Call | Description |
|---|---|---|
| List | SqlPools.ListByWorkspace | List all SQL pools |
| Stop | SqlPools.Pause | Pause a SQL pool |
| Start | SqlPools.Resume | Resume a SQL pool |
| Status | SqlPools.Get | Check pool status |
What's Preserved
- ✅ All data
- ✅ Pool configuration
- ✅ Security settings
- ✅ Workload management
Caveats
Resume typically takes 5-10 minutes depending on pool size.
Pause waits for active queries to complete or times out after a period.
Unsupported Services
The following services cannot be safely automated without manual intervention:
| Service | Reason |
|---|---|
| Azure Cache for Redis | No pause functionality; delete loses data |
| Cosmos DB | No pause; minimum throughput still costs |
| Azure Functions (Dedicated) | App Service Plan cannot be paused |
| HDInsight | Cluster must be deleted and recreated |
| Azure Databricks | Workspace always on; only clusters can stop |
Resource Tagging
For NightOps to manage resources, apply these tags:
nightops-managed: true
nightops-schedule: <schedule-id>
nightops-environment: staging | development | testing
Tag-Based Filtering Example
// List only NightOps-managed VMs
const vms = await vmService.list({
managedOnly: true,
scheduleId: "schedule-123"
});
Multi-Subscription Support
NightOps supports managing resources across multiple Azure subscriptions using service principal authentication.
Architecture
┌─────────────────┐ ┌─────────────────┐
│ Hub Subscription│ │ Spoke Subscription│
│ (NightOps) │────────▶│ (Customer) │
│ │ RBAC │ │
└─────────────────┘ └─────────────────┘
Setup Requirements
- Register the NightOps application in Azure AD
- Create a service principal
- Assign required RBAC roles in each subscription (see Azure RBAC Reference)
// Cross-subscription access
const vmService = new VMService({
subscriptionId: "spoke-subscription-id",
credentials: defaultAzureCredential
});
Next Steps
- Azure RBAC Reference - Required permissions for NightOps