Incident
The 'Get file metadata' action in the Microsoft made FTP connector does not retrieve information for a folder when provided the Id of a folder.
Error
The response given when a folder Id is provided is:
The requested action could not be completed as the specified resource (file/folder) does not exist or is busy.
More Details
I recognise that the name of the action is implicitly 'file' based, however there is a need to utilise an immutable Id when you are running programmatical operations on data, particularly when file based.
Additionally, the 'file' only implication is inferred, not specifically related to just files. I am pretty sure that there are other file related connectors will return details on folders in such an instance. But this inference should not form the basis of any response designed to mean that this should not be looked at. I am merely indicating that I am aware of the situation.
Documentation
The issue that I am reporting is actually in Logic Apps:
https://learn.microsoft.com/en-us/azure/connectors/connectors-create-api-ftp
However, I don't know that the situation would be any different using the managed connector:
https://learn.microsoft.com/en-us/connectors/ftp/#get-file-metadata
I only state this as the docs for the managed connector do indicate that there are differences.
Microsoft FTP Connector Configuration
As far as I can see there's no endpoint in this API which would provide that data:
API PathPurpose/datasets/default/filesWorks with an Id to provide file metadata/datasets/default/foldersWorks with an Id to provide listings of internal files or without to show root folders#### The 'Create file' action
In addition to which, the create file cannot be run with a folder Id, and must be run using a folder path.
Whilst valid, this is an inherently insecure (not related to security) operation as the name of a folder can change between the time that you have located it and the time that you are trying to create a file within it.
As clear as the requirement is for retrieving metadata by folder Id, you must also be able to perform other actions based upon that.
Possible Situations
This action would be expected to be used by users when iterating details for what is contained in a given folder and not utilising select/filter methods (remembering that not all users are potentially as savvy as others - eg with the knowledge to perform isFolder checks) and then being given errors when that folder contains subfolders.
Equally, one may just wish to get the metadata for a folder.