<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pass File list to notebook from copy data in a pipeline in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4724300#M9989</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If your goal is to preserve the file exactly as it was received&amp;nbsp; without interpreting delimiters, encodings, or structure&amp;nbsp; you can simply treat it as a binary file and write it directly to your Lakehouse storage. This avoids any transformation, parsing, or data loss. The file will remain byte-for-byte identical to what was on the SFTP server.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;If this post was helpful, please give us Kudos and consider marking &lt;STRONG&gt;Accept as solution&lt;/STRONG&gt; to assist other members in finding it more easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Menaka.&lt;BR /&gt;Community Support Team&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jun 2025 04:14:07 GMT</pubDate>
    <dc:creator>v-menakakota</dc:creator>
    <dc:date>2025-06-08T04:14:07Z</dc:date>
    <item>
      <title>Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718449#M9857</link>
      <description>&lt;P&gt;I have a copy data activity that copies files that come in via sftp each day to my onelake. I need to be able move those files to another folder once the copy is complete. Since there is no activity for that I have a PySpark notebook that will take paramters (list of files moved, and folder to move to) and perform the operation. My problem is that I cannot figure out how to get the list of files from the copy data activity to pass to the notebook, and if that output exists then what does it look like, how do I get it, parse it in my notebook? co-pilot suggested pass dynamic activity of "@&lt;SPAN&gt;activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Copy data1'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;fileList" however it cannot provide details and I cannot find any official documentation. I have found a post that suggested that it's not possible.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 13:50:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718449#M9857</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-03T13:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718573#M9861</link>
      <description>&lt;DIV&gt;I will admit that I am not a pipeline expert, but from what I can tell; there is no ability to either 1) archive as an option within the copy activity or 2) get the list of files out of the copy activity.&lt;BR /&gt;&lt;BR /&gt;Are you using an on-premise gateway to access said FTP/SFTP?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you are NOT using a on-premise gateway, I have a solution for you using pure notebooks.&amp;nbsp; If you are using an on-premise gateway, I unfortunately do not have a solution for you because pipelines are the only thing in MS Fabric that can use those gateway connections.&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Jun 2025 15:55:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718573#M9861</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T15:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718588#M9862</link>
      <description>&lt;P&gt;I am not using a gateway. I can do it completly with notebooks to do the ftp connection etc. This is really the reason I have never used data factory and pipelines in the past. Just not enough flexability. Now saddled with the same thing in Fabric. Oh well.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 16:06:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718588#M9862</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-03T16:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718653#M9864</link>
      <description>&lt;P&gt;I store the endpoint (including port) in KeyVault along with creds.&amp;nbsp; This function returns the relevant details in a dictionary based on how I store them in KeyVault:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;import notebookutils as nbu&lt;/P&gt;&lt;P&gt;from typing import Optional, Tuple, Any, List, Union, Dict&lt;BR /&gt;import paramiko&lt;BR /&gt;import pandas as pd&lt;BR /&gt;from io import BytesIO&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;def get_ftp_creds (prefix: str)-&amp;gt; dict:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Function that takes a prefix and returns the 4 necessary datapoints from key vault (endpoint - which stores host and port, username, password).&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Returns a dictionary with the endpoint, username, password, and port values&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Paramaters:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prefix &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String that identifies the resources to get values for&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Returns:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dict &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dictionary object with relevant sftp connection values&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Example usage:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ftp_data = get_ftp_creds('ftp-com-ech')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; endpoint = ftp_data['endpoint']&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; username = ftp_data['username']&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; password = ftp_data['password']&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; port = ftp_data['port'] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; host, port = nbu.credentials.getSecret('&lt;A href="https://YOUR_KV_ENDPOINT_HERE/" target="_blank"&gt;https://YOUR_KV_ENDPOINT_HERE/&lt;/A&gt;', f'{prefix}-endpoint').split(":")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ftp_data = {}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ftp_data['endpoint'] = host&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ftp_data['username'] = nbu.credentials.getSecret('YOUR_KV_ENDPOINT_HERE/', f'{prefix}-user')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ftp_data['password'] = nbu.credentials.getSecret('YOUR_KV_ENDPOINT_HERE/', f'{prefix}-pass')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ftp_data['port'] = int(port)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return(ftp_data)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 16:59:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718653#M9864</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T16:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718654#M9865</link>
      <description>&lt;P&gt;This function downloads a single file and puts it into a Pandas dataframe:&lt;BR /&gt;def sftp_download_file(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; sftp&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ,file_path: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ,src_file_delim: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ,src_file_encoding: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ,src_file_head_row: int&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ,trans_object&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ) -&amp;gt; pd.DataFrame:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Download a file from the SFTP server to Microsoft Fabric Lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; @sftp &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Paramiko SFTP object&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/594155"&gt;@src&lt;/a&gt;_file_delim &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Delimiter for source file&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/594155"&gt;@src&lt;/a&gt;_file_encoding &amp;nbsp; &amp;nbsp; &amp;nbsp;= Encoding for source file&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/594155"&gt;@src&lt;/a&gt;_file_head_row &amp;nbsp; &amp;nbsp; &amp;nbsp;= Header row for the source file&lt;BR /&gt;&amp;nbsp; &amp;nbsp; @trans_object &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Paramiko transport object, for closing connection upon error&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Returns: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; with sftp.open(file_path, 'rb') as f:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data = f.read()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df_file_data = pd.read_csv(BytesIO(data), encoding = src_file_encoding, sep = src_file_delim, header = src_file_head_row) &amp;nbsp;# Read into a temporary DataFrame&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return df_file_data&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; except Exception as e:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f'\n---Error in file download with file: {file_path}. &amp;nbsp;Exception: {e}---\n')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trans_object.close() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# if there is an error, close the connection&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return pd.DataFrame()&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 16:59:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718654#M9865</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T16:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718655#M9866</link>
      <description>&lt;P&gt;This function downloads all files in a folder location that meet the specified file mask:&lt;BR /&gt;def sftp_get_files_all(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; creds: dict&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_path: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,filename_mask: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_file_delim: Optional[str] = None&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_file_encoding: Optional[str] = None&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_file_head_row: Optional[int] = 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) -&amp;gt; Tuple [int, int, pd.DataFrame, list]:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Connect to SFTP server, download all files in folder that match the file mask, combine into dataframe using paramiko and upload to lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Parameter:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; creds &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= Dictionary object that contains the endpoint, username, and password for this sftp site&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_path &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Path on sftp to search&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; filename_mask &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= Format of filename&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_file_delim (opt) &amp;nbsp; &amp;nbsp; &amp;nbsp; = Delimiter to use, default is comma&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_file_encoding (opt) &amp;nbsp; &amp;nbsp;= Source file encoding, default is utf-8&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_file_head_row (opt) &amp;nbsp; &amp;nbsp;= Source file header, default is 0 or first row contains headers&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Return:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_touched &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = number of files touched during the process&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_downloaded &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= number of files downloaded during the process&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df_result &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Pandas dataframe that combines all files&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lst_files &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = list of files that met the criteria, for downstream processing&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Example usage:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_touched, files_downloaded, df_result = sftp_get_files_all(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; creds = sftp_creds&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_path = sftp_src_path&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,filename_mask = 'file_name_sample'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_file_delim = '|'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_file_encoding = 'utf-8'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_file_head_row = 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; # Check for default values&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if src_file_delim is None:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_file_delim = ',' &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# csv default&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if src_file_encoding is None:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_file_encoding = 'utf-8' &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # utf-8 default&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if src_file_head_row is not None:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_file_head_row -= 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# subtracting 1, argument for underlying function uses 0 to indicate first row, None = no headers&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; # Connect to the SFTP server using paramiko&lt;BR /&gt;&amp;nbsp; &amp;nbsp; transport = paramiko.Transport((creds['endpoint'],creds['port']))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; transport.connect(username=creds['username'], password=creds['password'])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; files_touched = 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; files_downloaded = 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; lst_df = []&lt;BR /&gt;&amp;nbsp; &amp;nbsp; lst_files = []&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 17:00:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718655#M9866</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T17:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718656#M9867</link>
      <description>&lt;P&gt;This function will archive folders on the SFTP folder itself:&lt;BR /&gt;def sftp_archive_files(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; creds: dict&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,src_path: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,files: list&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,archive_path: str&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) -&amp;gt; Tuple [int, int, str]:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Connect to SFTP server and remove previously processed files using list of file names.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Parameters:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; creds &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= Dictionary object that contains the endpoint, username, and password for this sftp site&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; src_path &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Path on sftp to search&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= List of files (from previous handling function)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; archive_path &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = Path to move file to on SFTP server&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Return:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_touched &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= Number of files touched during the process&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_moved &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= Number of files moved on the SFTP server&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; message &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= Message summarizing the action(s) taken&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Example usage:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_touched, files_deleted, msg = sftp_archive_files(sftp_creds, '/ven-directdivision', ['File1.txt','File2.txt'], '/ven-directdivision/archive')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; """&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; # Connect to the SFTP server using paramiko&lt;BR /&gt;&amp;nbsp; &amp;nbsp; transport = paramiko.Transport((creds['endpoint'],creds['port']))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; transport.connect(username=creds['username'], password=creds['password'])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; files_touched = 0&lt;BR /&gt;&amp;nbsp; &amp;nbsp; files_moved = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; with paramiko.SFTPClient.from_transport(transport) as sftp:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sftp.chdir(src_path)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for file in files:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_touched += 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_name = file&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_path = f"{src_path}/{file_name}"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; archive_full_path = f"{archive_path}/{file_name}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f'Moving: {file_path} to {archive_full_path}')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sftp.rename(file_path, archive_full_path)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_moved += 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; transport.close()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; msg = f'Files touched: {files_touched}, Files moved: {files_moved}'&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return(files_touched, files_moved, msg)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; with paramiko.SFTPClient.from_transport(transport) as sftp:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sftp.chdir(src_path)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files = sftp.listdir_attr()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for file_attr in files:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_touched += 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_name = file_attr.filename&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Check if the file matches the mask and date conditions&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if filename_mask in file_name:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file_path = f"{src_path}/{file_name}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(f'Downloading file: {file_path}...')&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # download file into memory, put file into dataframe, append dataframe to list of dataframes&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df = sftp_download_file(sftp, file_path, src_file_delim, src_file_encoding, src_file_head_row, transport)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df['FileName'] = file_name&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lst_df.append(df)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lst_files.append(file_name)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files_downloaded += 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Combine all DataFrames into a single result DataFrame&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if lst_df:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df_result = pd.concat(lst_df, ignore_index=True)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("All files successfully combined into a single DataFrame.")&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; df_result = pd.DataFrame()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("No files matched the conditions.")&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; transport.close()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return(files_touched, files_downloaded, df_result, lst_files)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this helps!&amp;nbsp; We are using these functions to ingest hundreds of files daily.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 17:00:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718656#M9867</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T17:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718716#M9868</link>
      <description>&lt;P&gt;I just noticed my replies appear out of order because of the default sort on replies.&amp;nbsp; You will probably want to sort by "Oldest to Newest" to have the replies in the correct order.&amp;nbsp; Sorry, there was a character limit on replies, hence the multiple replies.&lt;BR /&gt;&lt;BR /&gt;Feel free to kudos all of them if they are helpful &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 18:01:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718716#M9868</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T18:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718726#M9869</link>
      <description>&lt;P&gt;Thanks for all of the code, I already am using most of it, just have bosses that don't know fabric but like to see pipelines with nice blocks of predefined activities. Sometimes they just don't listen and you have to prove to them "it can't be done that way".&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 18:10:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718726#M9869</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-03T18:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718888#M9873</link>
      <description>&lt;P&gt;I understand.&amp;nbsp; Go ahead and provide Kudos and mark as the answer if you feel that is the right thing to do.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 23:07:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4718888#M9873</guid>
      <dc:creator>OldDogNewTricks</dc:creator>
      <dc:date>2025-06-03T23:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4719114#M9880</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-contrast="auto"&gt;Thanks for reaching out to the Microsoft fabric community forum.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-contrast="auto"&gt;I would also take a moment to thank &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/794577"&gt;@OldDogNewTricks&lt;/a&gt;&amp;nbsp;, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.&amp;nbsp;&lt;BR /&gt;&lt;SPAN class="" data-contrast="auto"&gt;If this post helps then please mark it as a solution, so that other members find it more quickly.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Menaka.&lt;BR /&gt;Community Support Team&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 05:32:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4719114#M9880</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2025-06-04T05:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4720194#M9908</link>
      <description>&lt;P&gt;I would like to write the file to my lake house exactly as it was read with no interpetation as to delmited etc.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 17:51:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4720194#M9908</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-04T17:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4724300#M9989</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If your goal is to preserve the file exactly as it was received&amp;nbsp; without interpreting delimiters, encodings, or structure&amp;nbsp; you can simply treat it as a binary file and write it directly to your Lakehouse storage. This avoids any transformation, parsing, or data loss. The file will remain byte-for-byte identical to what was on the SFTP server.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;If this post was helpful, please give us Kudos and consider marking &lt;STRONG&gt;Accept as solution&lt;/STRONG&gt; to assist other members in finding it more easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Menaka.&lt;BR /&gt;Community Support Team&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jun 2025 04:14:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4724300#M9989</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2025-06-08T04:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4725787#M10030</link>
      <description>&lt;P&gt;was able to accomplish my task using a notebook, since the Copy Data activity does not pass a list of files anywhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;transport&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;paramiko&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Transport&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ftpserver&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;22&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;transport&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;connect&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;username&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;ftpuserid&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;password&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;ftppwd&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;paramiko&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;SFTPClient&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;from_transport&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;transport&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;fileList&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt;.listdir(FromFolder)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt; &lt;SPAN&gt;file&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;fileList&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; &lt;SPAN&gt;fnmatch&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;fnmatch&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;, Mask):&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;# read file to memory becuase ftp library has no access to lake house&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt;.open(FromFolder + &lt;/SPAN&gt;&lt;SPAN&gt;"/"&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"r"&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;remote_file&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;file_data&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;remote_file&lt;/SPAN&gt;&lt;SPAN&gt;.read() &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;# 1MB chunks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;str_data&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;file_data&lt;/SPAN&gt;&lt;SPAN&gt;.decode(&lt;/SPAN&gt;&lt;SPAN&gt;"latin-1"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;notebookutils&lt;/SPAN&gt;&lt;SPAN&gt;.fs.put(ToFolder + &lt;/SPAN&gt;&lt;SPAN&gt;"/"&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;str_data&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;#let's ensure the Arc Folder exists on the ftp server&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt;.listdir(ArcFolder))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;except&lt;/SPAN&gt; &lt;SPAN&gt;IOError&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt;.mkdir(ArcFolder) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt;.rename(FromFolder + &lt;/SPAN&gt;&lt;SPAN&gt;"/"&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;, ArcFolder + &lt;/SPAN&gt;&lt;SPAN&gt;"/"&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sftp&lt;/SPAN&gt;&lt;SPAN&gt;.close()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;transport&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;close&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Jun 2025 13:03:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4725787#M10030</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-09T13:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Pass File list to notebook from copy data in a pipeline</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4729432#M10083</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for the update glad to hear you were able to accomplish the task using a notebook-based approach.&amp;nbsp;&lt;SPAN data-teams="true"&gt;If this is the solution that has worked for you please accept your reply as solution so as to help other community members who may face similar issue in the future.&lt;BR /&gt;&lt;BR /&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Menaka.&lt;BR /&gt;Community Support Team&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 05:08:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Pass-File-list-to-notebook-from-copy-data-in-a-pipeline/m-p/4729432#M10083</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2025-06-12T05:08:20Z</dc:date>
    </item>
  </channel>
</rss>

