How to fix Error 5152 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 5152 – “This Operation Is Not Supported for URL”

Why This Error Happens

Error 5152 occurs when SQL Server 2025 attempts to perform a BACKUP or RESTORE operation against a URL (Azure Blob Storage) target using an unsupported method, such as attempting to append to an existing backup file or using WITH FORMAT on a URL destination. This typically stems from a mismatch between the backup command syntax and the restrictions imposed by URL-based backups, which do not support all the legacy options available for local disk or network share backups. It can also occur due to an outdated or misconfigured SQL Credential tied to the storage account, causing SQL Server to misinterpret the operation type being requested against the blob endpoint.

Step-by-Step Resolution Guide

Step 1: Review and Correct the T-SQL Backup/Restore Syntax

  • Confirm your script does not use WITH APPEND, WITH FORMAT, or SKIP options, as these are explicitly unsupported for URL backup destinations.
  • Ensure every backup to a URL uses the WITH FORMAT, INIT only on the first backup to a blob, and subsequent backups use a new, uniquely named file rather than appending to an existing one.
  • Example of corrected syntax:
  BACKUP DATABASE [YourDB] 
  TO URL = 'https://youraccount.blob.core.windows.net/container/YourDB_20250615.bak'
  WITH CREDENTIAL = 'YourCredentialName', COMPRESSION, STATS = 10;

Step 2: Validate the SQL Server Credential and Shared Access Signature (SAS)

  • Navigate to Object Explorer > Security > Credentials in SQL Server Management Studio (SSMS) 21.
  • Verify the credential mapped to your storage container uses a valid, non-expired Shared Access Signature (SAS) token or Storage Account Key.
  • Re-create the credential if necessary using the following syntax:
  CREATE CREDENTIAL [https://youraccount.blob.core.windows.net/container]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = 'sv=2025-01-01&ss=b&srt=sco...';
  • Ensure the SAS token has Read, Write, Create, and List permissions enabled on the Storage Account.

Step 3: Check Blob Storage Tier and File Existence

  • Verify that the target blob container is set to Hot or Cool access tier; Archive tier blobs will throw unsupported operation errors because they cannot be written to directly.
  • In the Azure Portal, check if a blob with the exact same name already exists in the container. If it does, delete it or rename your target file, since SQL Server cannot overwrite a page blob with a block blob (or vice versa).
  • Confirm the blob storage account has not been configured with immutability policies or WORM (Write Once, Read Many) locks that restrict overwrite operations.

Step 4: Update SQL Server 2025 Cumulative Update (CU)

  • Open SQL Server Configuration Manager and verify the current build number via SELECT @@VERSION;.
  • Download and apply the latest Cumulative Update (CU) from the Microsoft Update Catalog, as early builds of SQL Server 2025 had a known bug mishandling URL backup validation logic.
  • Restart the SQL Server (MSSQLSERVER) service via Windows Services (services.msc) after patching.

Alternative or Verification Steps

  • Run a test backup to a local disk path (e.g., C:\Temp\test.bak) to confirm the database and syntax are otherwise healthy; if the local backup succeeds, the issue is isolated to the URL/credential configuration.
  • As an alternative, use Azure Storage Explorer to manually verify connectivity and write permissions to the target container using the same SAS token configured in the SQL Credential.