File Share adapter
Two adapters over one file share abstraction. The Listener picks files up from a share and publishes a message per file; the Caller writes one file per message. The Authentication decides the protocol.
File Share is not one adapter with two modes. It is two adapters that share a path model and a set of Authentications: the File Share Listener goes on a receive port, the File Share Caller on a send port. Neither holds a host name or a credential: that belongs to the Authentication, and the Definition chosen there is what decides which protocol the port speaks.
Each adapter offers the same two Definitions. The adapter configuration says nothing about where the server is, so moving an integration from a file server to an Azure file share is a change of Authentication and nothing else.
| Definition | Target | What it carries |
|---|---|---|
| File Share Connection String | An Azure file share | Connection String, required. The share itself is named by the adapter's Share Name, so one Authentication serves any number of shares in the same storage account. |
| SMB File Share Connection | A file server, SMB 2 or 3 with NTLM | Host required, Port default 445, Domain optional, Username and Password required, Auth Protocol NTLM. |
The full Authentication dialog, both Definitions, field by field
| Setting | Value |
|---|---|
| Name | Your name for the Authentication, no spaces or punctuation |
| Adapter | File Share Listener, or File Share Caller |
| Definition | File Share Connection String |
| Application | Preset, the Application you are working in |
| Connection String | Required. For example DefaultEndpointsProtocol=https;AccountName=…;AccountKey=…;EndpointSuffix=core.windows.net. It is not validated when you save, so a blank or malformed one is not reported until a port tries to use it. |
| Setting | Value |
|---|---|
| Name | Your name for the Authentication, no spaces or punctuation |
| Adapter | File Share Listener, or File Share Caller |
| Definition | SMB File Share Connection |
| Application | Preset, the Application you are working in |
| Host | Required. The file server, by name or address. Every address the name resolves to is tried. |
| Port | Defaults to 445. Any value from 1 to 65535 is accepted. |
| Domain | Optional. Leave it empty for a workgroup or local account. |
| Username | Required. |
| Password | Required. |
| Auth Protocol | NTLM. It is the only protocol implemented, and the field exists so that a Kerberos option can be added without reshaping the Authentication. |
SMB1 and CIFS are not supported. Rotating a password on either Definition takes effect when the credential is refreshed, which happens on change and after an authentication failure, so editing the Authentication is what makes a new password live.
Auth Config Type is Static on the Listener and Static or Dynamic on the Caller. A receive port has no message to resolve a credential from, so every receive adapter offers Static alone. That is true across the platform, not a File Share quirk.
Share Name names the share and is never part of a path. Path is always relative to it, and an empty Path means the share root.
| Rule | Behaviour |
|---|---|
| Separators | Backslashes become forward slashes, and leading and trailing slashes are trimmed. /inbox/a.xml, inbox/a.xml and \inbox\a.xml are one path. A leading slash does not mean the root of the server. |
| Wildcards | * and ? only. No character classes, no regular expressions. Everything else in the mask is matched literally. |
| What a mask matches | The entry name, never the full path, and case is ignored. *.xml matches Order.XML; inbox/*.xml matches nothing, because no entry is named with a slash in it. |
The Listener is event based on an SMB share. It watches the folder and picks a file up about a second after its writer closes it. Files already in the folder when the port starts are picked up at start, and a file still held open by its writer waits until it is closed while other files keep flowing. Each file is read, removed from the share, and published to the bus as a separate message.
The polling settings are the Fallback Schedule. An Azure file share has no file events, so there the Listener polls every Polling Interval and takes as many files as Max Files Per Poll and Max Batch Size allow, and the rest wait for the next poll. On SMB, events are not throttled by Max Files Per Poll.
| Field | Default | What it does |
|---|---|---|
| Auth Config Type | Static | The only option on a receive port. |
| Auth Config | Required | The Authentication that supplies the protocol and the credentials. |
| Polling Interval (sec) | 60 | Fallback Schedule. How long to wait between polls; on Azure Files this is how often files are picked up. One second is the floor. The next poll is scheduled from the moment the current one starts, so a slow poll does not push the following one further out. |
| Max Files Per Poll | 20 | Fallback Schedule. A hard stop for one poll. Once this many files are published the pass ends and the remainder waits. |
| Max Batch Size (KB) | 100000 | Fallback Schedule. Total kilobytes one poll may deliver. There is no unlimited setting. |
| Share Name | Required | The share to poll. |
| Path | Empty | The folder inside the share. Empty means the share root. |
| File Mask | *.json | Which file names to take. Change it to match your files, or * for all. |
| Include Subfolders | Off | Watch one folder level only. Turn it on to include every subfolder under Path. |
| Encoding | UTF-8 | UTF-8, Windows-1252, ISO-8859-1 or UTF-16. The code page a text file is read in. Ignored when the port’s message type has the BIN format. |
The Listener lists files only, so a folder whose name happens to match the mask is never picked up as if it were a file. The port’s Adapter Message Type decides how the content is read. With a type of the BIN format the file is published byte for byte, whatever it contains. With any other format it is read as text in the chosen Encoding, and bytes that are not valid in that encoding become replacement characters, so binary files belong under a BIN type. Each message carries FileName, FilePath, FileSize and ShareName as context properties, and FilePath is how you tell two files of the same name in different subfolders apart when subfolders are included.
How the byte budget behaves on a poll, and the two log shapes it produces
Max Batch Size (KB) is checked against the size the folder listing reports, before anything is downloaded. A file that would push the pass over its remaining budget is skipped and the pass carries on, so a smaller file later in the same listing can still be delivered in that pass. That produces two situations worth telling apart.
| Situation | What it means |
|---|---|
| Deferred | The file fits the budget on its own, but not in what is left of this pass. It is left alone and picked up on a later poll. Logged for information. |
| Never fits | The file on its own is larger than Max Batch Size (KB), so no poll can ever deliver it. Logged as a warning on every pass until the budget is raised or the file is removed. A repeating warning here means a stuck file, not a busy share. |
The budget trusts the size the listing reports, and a poll against a folder that does not exist returns nothing and says nothing. It is not an error, so a Listener pointed at a mistyped Path looks exactly like a Listener pointed at an empty one.
The Caller does one thing: it writes the message body to the share as a file. Upload is the only operation. The port’s whole job is deciding where the file lands and what happens if a file of that name is already there.
| Field | Default | What it does |
|---|---|---|
| Auth Config Type | Static or Dynamic | Static names one Authentication on the port, Dynamic resolves it per message. |
| Auth Config | Required | The Authentication that supplies the protocol and the credentials. |
| Share Name | Required | The share to write into. |
| Operation Type | Upload | The only operation. |
| Destination path | Empty | The folder to write into, relative to the share. Empty means the share root. |
| File name | {{Message.InstanceId}}.txt | The name of the file to write. Bindings are allowed; a name with characters Windows does not allow fails at run time. |
| Write mode | Create New | Create New fails if the file already exists. Overwrite replaces it. Append adds to the end of it. |
| Create Directory If Not Exists | Off | Creates the folders above the target. When off, a missing folder fails the Upload. |
| Encoding | UTF-8 | UTF-8, Windows-1252, ISO-8859-1 or UTF-16. The code page a text message is written in. A message whose type has the BIN format is always written as its original bytes. |
Upload in detail: the two guards, and why there is no safe partial write
Write mode Create New is a check made before the write, not a lock. It fails the operation if the file is already there, which is what you want for a partner drop where a repeat means a duplicate. It cannot promise that nothing else created the file between the check and the write, so treat it as a guard against your own duplicates rather than as mutual exclusion.
Create Directory If Not Exists builds every missing folder above the target, one level at a time. It does nothing for a file written straight into the share root, because there is no folder above it.
An Upload writes to the destination directly. There is no temporary name and no rename into place, so anything watching the destination can see a partially written file. If the reader on the other side is a poller you do not control, have it wait for a marker file, or write into a staging folder the reader ignores.
What comes back, and what the port promotes
The response body is an echo of the request body, not the stored file. A success means the bytes were accepted by the share, nothing more.
The port promotes Path and FileName, so a later step can name the file it just wrote. The values are attached before the write runs, which means they are there on a failed response too.
Where a problem surfaces decides what the platform does with it, and only failed responses are retried.
| Kind of failure | Retried? | What happens |
|---|---|---|
| Configuration | No | A missing Share Name is rejected outright rather than returned as a failed response. |
| Missing credentials | No | A blank Azure connection string, or an SMB Authentication without a host, username or password. The connection is built before the operation is attempted, so this escapes the retry loop too. |
| Rejected credentials | Once | An Azure 401 or 403, and an SMB logon failure, access denied, disabled or locked account, or expired password. The platform refreshes the credential and tries again, so a password corrected on the Authentication recovers without a restart. This applies to the Caller; a Listener whose logon is rejected stops, see above. |
| Anything the file system refuses | Yes | A missing file, a file that already exists with Write mode Create New, a missing folder with Create Directory If Not Exists off, or any protocol error. |
That is the File Share adapter
A Listener that picks up and consumes, a Caller that uploads and nothing else, and an Authentication that decides whether the target is an Azure file share or an SMB server. Remember the Listener always deletes. Back to Adapters.