Live is streaming live. Watch now.

SMB Shares

ASP.NET applications deployed to PCF are running on Diego Windows Cells which are not joined to any domain. Typically in a Cloud Foundry environment connecting to an enterprise SMB share requires domain authentication and as a result consuming a SMB share from a Windows cell requires some additional configuration that is usually handled by a Windows server admin.

!UPDATE

Please refer to the updated SMB shares recipe here.

PAS

Pivotal Application Service using an Ubuntu stemcell doesn’t have a native SMB driver by default. Fortunately there’s a cloud native solution to connect an application (.NET Core) to a SMB share using the SMB Volume Service. The SMB Volume Service broker needs to be installed into your Pivotal Cloud Foundry deployment and made available in the marketplace by a PCF platform operator.

PASW

SMB shares requires authentication which can be enabled by using .NET wrapper around the native Windows Networking API via the Steeltoe Common .NET Network library. Note this is an experimental feature and is currently limited to IP address UNC paths

Install-Package Steeltoe.Common.Net

Use Disposable WindowsNetworkFileShare class to enable FileOperations on Shared Drives

using Steeltoe.Common.Net;
...

NetworkCredential credential = new NetworkCredential(user, password, domain);
using (WindowsNetworkFileShare networkPath = new WindowsNetworkFileShare(uncPath, credential))
{
  //File Operations on the files/directories in uncPath inside using block
  File ff = new File();
  ...
}

Open Source for the library - Source Code on GitHub

On This Page