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

Troubleshooting Guide: SQL Server Error 12705 — Invalid External Data Source Type for Azure Blob Storage

Why This Error Happens

This error occurs when an EXTERNAL DATA SOURCE object has been created with an incorrect TYPE value (such as HADOOP or RDBMS) while its LOCATION string points to an Azure Blob Storage endpoint (e.g., wasbs:// or a blob.core.windows.net URL). SQL Server 2025 enforces strict validation between the location protocol and the data source type, meaning any Blob Storage location must explicitly declare TYPE = BLOB_STORAGE. This mismatch is typically caused by legacy scripts being reused from older environments, migrated PolyBase configurations, or manual typos in T-SQL CREATE EXTERNAL DATA SOURCE statements.

Step-by-Step Resolution Guide

Step 1: Identify the Faulty External Data Source

  • Open SQL Server Management Studio (SSMS) and connect to your Windows Server 2025 instance.
  • Run the following query to inspect current configurations:
SELECT name, location, type_desc FROM sys.external_data_sources;
  • Look for any row where location contains blob.core.windows.net but type_desc is not BLOB_STORAGE.

Step 2: Drop the Incorrectly Configured Data Source

  • Before dropping, ensure no active external tables are currently referencing this source, as this will cause a dependency error.
  • Execute the drop command in a new query window:
DROP EXTERNAL DATA SOURCE [YourDataSourceName];

Step 3: Recreate the Data Source with the Correct Type

  • Use the BLOB_STORAGE type explicitly in the creation script.
  • Ensure you are using a valid Shared Access Signature (SAS) token or Managed Identity credential compatible with Windows Server 2025 security policies.
CREATE EXTERNAL DATA SOURCE [YourDataSourceName]
WITH (
    LOCATION = 'wasbs://yourcontainer@youraccount.blob.core.windows.net',
    CREDENTIAL = [YourDatabaseScopedCredential],
    TYPE = BLOB_STORAGE
);

Step 4: Verify Associated Credentials

  • Check that the DATABASE SCOPED CREDENTIAL used in Step 3 utilizes SHARED ACCESS SIGNATURE as the identity, as standard SQL logins are incompatible with BLOB_STORAGE types.
  • Navigate to Object Explorer > Security > Credentials in SSMS to confirm the credential exists and is mapped correctly.

Alternative or Verification Steps

  • Re-run the SELECT * FROM sys.external_data_sources query to confirm the type_desc column now reads BLOB_STORAGE for the updated row.
  • If the error persists after recreation, verify that the firewall settings on your Azure Storage Account allow traffic from your Windows Server 2025 public IP address, as a blocked connection can sometimes trigger cascading configuration errors.