@Lee Harper Thanks for the question. Can you please add more details about the use case.
OutFileDatasetConfig is a control plane concept to pass data between pipeline steps. PipelineData was intended to represent "transient" data from one step to the next one, while OutputDatasetConfig was intended for capturing the final state of a dataset. PipelineData always outputs data in a folder structure like {run_id}{output_name}. OutputDatasetConfig allows to decouple the data from the run and hence it allows you to control where to land the data (although by default it will produce similar folder structure). The OutputDatasetConfig allows even to register the output as a Dataset, where getting rid of such folder structure makes sense. From the docs itself: "Represent how to copy the output of a run and be promoted as a FileDataset. The OutputFileDatasetConfig allows you to specify how you want a particular local path on the compute target to be uploaded to the specified destination".
Please follow the below link to use the upload API.
https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.data.dataset_factory.filedatasetfactory?view=azure-ml-py#upload-directory-src-dir--target--pattern-none--overwrite-false--show-progress-true-