Skip to content

Database Maintenance

Database Maintenance

App Store for Intune runs on Azure SQL Database, which maintains itself. No manual database maintenance is required.

From 1.39.0 you pick the service objective when you deploy, under Database size. Basic (5 DTU, 2 GB) is the default and is what every earlier deployment received; S0 (10 DTU, 250 GB) is the recommended choice for production. This page applies to any of them, and calls out the places where Basic behaves differently. See Deploy to Azure.

Azure SQL Database handles all maintenance tasks automatically, including:

FeatureDescription
Automatic Index TuningAzure monitors query patterns and automatically creates, drops, or rebuilds indexes to optimize performance
Automatic Plan CorrectionDetects and fixes query plan regression issues automatically
Automatic BackupsPoint-in-Time Restore (PITR) with 7-day retention (Basic tier), up to 35 days on higher tiers
Geo-Redundant StorageBackups are stored redundantly across Azure regions for disaster recovery
Automatic UpdatesDatabase engine patches and security updates applied automatically with no downtime
Automatic StatisticsQuery statistics are automatically updated to ensure optimal query plans

You may be familiar with on-premises SQL Server maintenance solutions like Ola Hallengren’s Maintenance Solution that schedule index rebuilds, integrity checks, and backup jobs. These are not needed for Azure SQL Database because:

  1. Index Maintenance: Azure’s automatic tuning handles index optimization. At the sizes this database reaches, index fragmentation has minimal impact on performance.

  2. Integrity Checks (DBCC CHECKDB): Azure runs these automatically. You cannot schedule them yourself on Azure SQL Database.

  3. Backup Jobs: Azure manages all backups automatically. You cannot create your own backup jobs, instead, you use Azure’s built-in Point-in-Time Restore feature.

  4. Statistics Updates: Azure automatically updates statistics as needed. Manual UPDATE STATISTICS commands are rarely necessary.

Azure SQL Database provides built-in backup and recovery capabilities:

TierPITR retentionBackup storage
Basic7 days by default, configurable 1 to 7Geo-redundant (GRS) by default
Standard7 days by default, configurable 1 to 35Geo-redundant (GRS) by default
Premium7 days by default, configurable 1 to 35Geo-redundant (GRS) by default

To restore your database:

  1. Go to Azure Portal > SQL databases > your database
  2. Select Restore in the toolbar
  3. Select a restore point (any time within retention period)
  4. Azure creates a new database with data as of that point in time

Basic (2 GB, 5 DTU) carries the typical workload without difficulty. The reason to move off it is usually the size ceiling rather than the speed: 2 GB is a hard limit, and a database that reaches it starts refusing writes, which means the portal stops recording requests, approvals, and audit entries until somebody resizes it. Watch Data space used as well as DTU.

Scale up if you observe:

  • Data space used approaching the tier’s maximum size
  • Consistent high DTU usage (>80%) in Azure metrics
  • Slow query response times
  • Timeouts during peak usage

To scale up:

  1. Go to Azure Portal > SQL databases > your database
  2. Select Compute + storage
  3. Select a higher tier (Standard, Premium) or increase DTUs
  4. Changes take effect within minutes with minimal downtime

In rare cases where you need to manually optimize, you can:

-- View index fragmentation (informational only)
SELECT
OBJECT_NAME(ips.object_id) AS TableName,
i.name AS IndexName,
ips.avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'LIMITED') ips
JOIN sys.indexes i ON ips.object_id = i.object_id AND ips.index_id = i.index_id
WHERE ips.avg_fragmentation_in_percent > 30
ORDER BY ips.avg_fragmentation_in_percent DESC;
-- Rebuild a specific index if needed (usually not necessary)
ALTER INDEX [IX_AppRequests_UserId] ON [AppRequests] REBUILD;

However, for the App Store for Intune’s typical data volumes (hundreds to thousands of app requests), this manual intervention is almost never necessary.