SMB 3 Implementation in .net core

Aniesha Razdan 20 Reputation points
2024-08-20T13:50:11.1766667+00:00

There isn't any library available to implement network file sharing using SMB3 protocol in .net core. The existing SMBLibrary only supports SMB1 and SMB2. Which library to use for SMB3 implementation?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,277 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,890 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,515 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,566 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,843 questions
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 64,161 Reputation points
    2024-08-21T16:10:10.4533333+00:00

    azure function and apps don't support on premise SMB because the ports are blocked in the hosting sandbox.

    You will need to use an azure virtual machine and configure point to point access:

    https://video2.skills-academy.com/en-us/azure/vpn-gateway/vpn-gateway-howto-point-to-site-resource-manager-portal

    or an azure logic app using on-premise data connectors:

    https://video2.skills-academy.com/en-us/azure/connectors/file-system?tabs=consumption

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nehruji R 7,306 Reputation points Microsoft Vendor
    2024-08-22T06:39:31.38+00:00

    Hello Aniesha Razdan,

    Greetings! Welcome to Microsoft Q&A Platform.

    P/Invoke is a technology that allows you to access structs, callbacks, and functions in unmanaged libraries from your managed code. Most of the P/Invoke API is contained in two namespaces: System and System.Runtime.InteropServices. Using these two namespaces give you the tools to describe how you want to communicate with the native component and to use P/Invoke for implementing SMB3 protocol-related functions, you would typically import the Mpr.dll library, which contains the necessary functions for network resource management, including SMB.

    refer - https://video2.skills-academy.com/en-us/dotnet/standard/native-interop/pinvoke, https://github.com/dotnet/pinvoke,https://video2.skills-academy.com/en-us/dotnet/api/overview/azure/storage.files.shares-readme?view=azure-dotnet for more details.

    You can mount the file share on your local machine by using the SMB 3.0 protocol, or you can use tools like Storage Explorer to access files in your file share. From your application, you can use storage client libraries, REST APIs, PowerShell, or Azure CLI to access your files in the Azure file share.

    More information here: https://video2.skills-academy.com/en-us/azure/storage/files/storage-files-faq

    Hope the above information helps! Please let us know if you have any further queries. I’m happy to assist you further.


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

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