You can use a Web Activity to call your REST API endpoint and get the URL of the zip file.
(with the REST API as the source and your ADLS as the sink) then use a Custom Activity (which allows you to run custom code) to unzip the downloaded file in ADLS.
Step 1: Web Activity
- Add a Web Activity to your pipeline.
- Configure it to call your REST API endpoint.
- Capture the URL of the zip file from the response.
Step 2: Copy Activity
- Add a Copy Activity to your pipeline.
- In the Source tab, configure it to use the URL obtained from the Web Activity.
- Use the dynamic content feature to pass the URL from the Web Activity.
- In the Sink tab, configure it to write to ADLS.
Step 3: Custom Activity to Unzip the File
- Add a Custom Activity to your pipeline. This requires setting up an Azure Batch Account and creating a pool of compute nodes.
- Write a script (If you are familiar with Python script) to unzip the file.
import zipfile
import os
zip_file_path = "<path_to_the_zip_file>"
extract_path = "<path_to_extract_directory>"
os.makedirs(extract_path, exist_ok=True)
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
zip_ref.extractall(extract_path)
- Upload the script to a location accessible by the Custom Activity (e.g., a storage account).
- Configure the Custom Activity to run the script.