Troubleshooting Guide: Error 3073 – WITH FILE_SNAPSHOT Restriction in SQL Server 2025
Why This Error Happens
This error occurs because the WITH FILE_SNAPSHOT option for BACKUP or RESTORE operations requires that every single database file (data and log files) reside in Azure Blob Storage. SQL Server performs a validation check prior to execution, and if even one file in the database resides on local disk, a UNC path, or a non-Azure storage account, the engine rejects the entire operation and throws Error 3073. This commonly happens during hybrid migrations where a database has a mix of local .mdf/.ldf files and Azure-based .ndf files, or when a backup script is copy-pasted from an Azure-only environment into an on-premises instance.
Step-by-Step Resolution Guide
Step 1: Verify File Locations for the Target Database
- Run the following query to inspect all file paths associated with the database:
SELECT name, physical_name, type_desc
FROM sys.master_files
WHERE database_id = DB_ID('YourDatabaseName');
- Check the
physical_namecolumn for any path that does not start withhttps://<storageaccount>.blob.core.windows.net/. - Flag any paths pointing to local drives (e.g.,
C:\,D:\) or on-premises UNC shares (e.g.,\\FileServer\SQLData\).
Step 2: Migrate Remaining Local Files to Azure Storage
- If local files were found in Step 1, you must move them to Azure Blob Storage before using
FILE_SNAPSHOT. - Create a SQL Server Credential for the Azure Storage Account:
CREATE CREDENTIAL [https://yourstorageaccount.blob.core.windows.net/yourcontainer]
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'sv=2025-01-01&ss=b&srt=sco&sp=rwdlac...';
- Use a standard
BACKUP/RESTORE(withoutFILE_SNAPSHOT) to move the database file-by-file, or useALTER DATABASE ... MODIFY FILEto relocate the physical file to a new Azure URL, followed by taking the file offline and copying the data viaAzCopy.
Step 3: Remove the FILE_SNAPSHOT Clause for Hybrid Backups
- If migrating the file to Azure is not immediately feasible, modify your T-SQL script to remove the incompatible option.
- Update your backup command to use a standard backup syntax instead:
BACKUP DATABASE [YourDatabaseName]
TO URL = 'https://yourstorageaccount.blob.core.windows.net/yourcontainer/backup.bak';
- Note that standard backups to a URL do not support instantaneous snapshot restores but will bypass the Error 3073 validation check entirely.
Step 4: Check for Orphaned or Stale File Metadata
- Sometimes a file is moved to Azure, but the SQL Server metadata catalog retains an old local cache reference.
- Restart the SQL Server service to clear the metadata cache:
Restart-Service -Name 'MSSQLSERVER' -Force
- Re-run the query from Step 1 to ensure the
sys.master_filescatalog reflects the updated Azure URL paths accurately.
Alternative or Verification Steps
- Verification: Once all files are confirmed to be in Azure Storage via
sys.master_files, re-attempt theBACKUP DATABASE ... WITH FILE_SNAPSHOTcommand; it should now complete without throwing Error 3073. - Alternative: If a fully Azure-based architecture isn’t required, use Storage Spaces Direct (S2D) or local VSS-based snapshots via a third-party agent instead of the native
FILE_SNAPSHOTT-SQL option to achieve similar fast-restore capabilities on-premises.