Agent message code 21118. Failed to connect to Azure Storage '\\filestorage.file.core.windows.net\replshare' with OS error: 67.

Devulacheruvu Venkatesh 0 Reputation points
2026-01-15T12:13:28.83+00:00

We are trying to mount Aure file storage account file share with SQL Managed instance and getting below error:

		-XCancelEventHandle Global\Distribution-{999CD062-8A3C-4697-9A2A-B241BB5852ED}

2026-01-15 08:28:21.258 Startup Delay: 2800 (msecs)

2026-01-15 08:28:24.114 Connecting to Distributor 'msql-eastus2.a92729a7b260.database.windows.net'

2026-01-15 08:28:24.309 Obtained Azure Storage Connection String for filestoragetp2uat

2026-01-15 08:28:24.317 Connecting to Azure Files Storage '\filestorage.file.core.windows.net\replshare'

2026-01-15 08:28:45.474 Agent message code 21118. Failed to connect to Azure Storage '\filestorage.file.core.windows.net\replshare' with OS error: 67.

From a VM in the same VNet:

  • DNS resolution:
    • filestorage.file.core.windows.net resolves to the private endpoint IP
  • Connectivity test:
    • Test-NetConnection filestorage.file.core.windows.net -Port 445
    • TcpTestSucceeded : True

From SQL Managed Instance:

DNS resolution works correctly and resolves to the same private IP

  • However, running a PowerShell job via SQL Agent using:
    • Test-NetConnection filestorage.file.core.windows.net -Port 445
  • Result:
    • TcpTestSucceeded : False

There are no NSG rules blocking outbound traffic, and the Private Endpoint and DNS configuration have been validated.


Moderator: Moved from SQL Server Database Engine.

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. VRISHABHANATH PATIL 5,250 Reputation points Microsoft External Staff Moderator
    2026-01-15T22:16:18.1333333+00:00

    Hi @Devulacheruvu Venkatesh

    Thank you for contacting to Microsoft QA. Following our investigation, I wanted to share a clear summary of the root cause and the supported path forward regarding the Azure File Share mounting issue from SQL Managed Instance.

    The error occurs because SQL Managed Instance does not support outbound SMB (port 445) connectivity, which is required to mount Azure File Shares. Even though DNS and Private Endpoint are configured correctly, SQL Agent jobs run in a restricted sandbox that cannot establish SMB connections. This is why:

    • Port 445 works from the VM
    • The same test fails from SQL MI
    • The agent returns OS Error 67: network name cannot be found

    SQL Managed Instance cannot mount Azure Files using SMB, and this scenario is not supported by the platform.

    Supported Alternatives

    To access storage from SQL MI, use one of the following:

    1. Azure Blob Storage via REST API (Supported) Use CREATE EXTERNAL DATA SOURCE with TYPE = BLOB_STORAGE.
    2. Use Azure Data Factory or Synapse pipelines for file movement between MI and Azure Storage.
    3. Use a VM or container as an intermediary If SMB-based workflow is mandatory.

  2. Q&A Assist
    2026-01-15T12:13:40.4333333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you are encountering, "Failed to connect to Azure Storage '\filestorage.file.core.windows.net\replshare' with OS error: 67," typically indicates that there is an issue with the network connectivity or configuration when trying to access the Azure file share from your SQL Managed Instance.

    Here are some troubleshooting steps you can consider:

    1. Check SMB Protocol Support: Ensure that the SQL Managed Instance supports SMB protocol and that it is configured correctly to use SMB 3.0 or later, which is required for Azure Files.
    2. Verify Network Configuration: Since you mentioned that DNS resolution works correctly and resolves to the private IP, ensure that there are no firewall rules or network security group (NSG) rules that might be blocking outbound traffic on port 445 from the SQL Managed Instance. Even if there are no explicit rules blocking it, double-check the effective security rules.
    3. Private Endpoint Configuration: Since you are using a private endpoint, ensure that the private endpoint is correctly configured and associated with the correct virtual network and subnet. Verify that the DNS settings for the private endpoint are correctly set up to resolve to the private IP.
    4. Test Connectivity from SQL Managed Instance: Since Test-NetConnection returns TcpTestSucceeded : False, this indicates that the SQL Managed Instance cannot reach the Azure file share on port 445. You may want to check if there are any restrictions on the SQL Managed Instance's outbound connectivity.
    5. Use Azure File Sync: If port 445 is blocked, consider using Azure File Sync as a workaround to access Azure Files from your SQL Managed Instance, as it can use port 443 instead.
    6. Check for Other Issues: Review any logs or additional error messages that may provide more context about the failure. Sometimes, additional configuration or permissions may be required for the SQL Managed Instance to access Azure Files.

    If the issue persists after these checks, consider reaching out to Azure support for more detailed assistance specific to your environment.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.