Need to automate a Synapse Analytics Pipeline to gather the information from the previous day. every day

Alex Nieto Castro 0 Reputation points
2024-11-12T20:28:56.61+00:00

I have a Synapse Analytics Pipeline that gather information from SharePoint and put it into a storage account container in Azure. It is a Copy data action. Right now, every time I need to get more data, I need to change the date on Source /Date filter for Start time and End time. I want to automate this, so I don't have to worry about getting the data every day.

I'm not familiar with Synapse, so detailed replies would be appreciated.

User's image

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,012 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ganesh Gurram 1,510 Reputation points Microsoft Vendor
    2024-11-13T17:49:52.8766667+00:00

    @Alex Nieto Castro - Thanks for the question and using MS Q&A forum. 

    To automate your Azure Synapse Analytics pipeline to gather information from the previous day every day, you can use pipeline parameters and expressions to dynamically set the date filter values. Here's a step-by-step guide to achieve this: 

    Create Pipeline Parameters: Go to your pipeline and click on the 'Parameters' tab. Create two parameters: StartDate and EndDate. 

    Set Default Values for Parameters: Set the default values for the parameters to dynamic expressions that calculate the previous day's date. 

    1. For StartDate, use the expression: @formatDateTime(addDays(utcnow(), -1), 'yyyy-MM-ddT00:00:00Z') 
    2. For EndDate, use the expression: @formatDateTime(utcnow(), 'yyyy-MM-ddT00:00:00Z') 

    User's image

    Modify the Copy Data Activity:  Click on the 'Copy data' activity in your pipeline. Go to the 'Source' tab. For the 'Start time (UTC)' and 'End time (UTC)' fields, use the pipeline parameters you created. 

    1. For Start time, use: @pipeline().parameters.StartDate User's image

    User's image

    1. For End time, use: @pipeline().parameters.EndDate User's image

    User's image

    Add a Trigger to Run the Pipeline Daily: 

    1. Go back to the pipeline and click on 'Add trigger' > 'New/Edit'. 
    2. Create a new trigger and set it to run every day at your desired time. 
    3. Link this trigger to your pipeline. User's image

    Publish Your Changes: 

    1. After making these changes, publish your pipeline. 

    Hope this helps. Do let us know if you have any further queries.  

    ------------- 

    If this answers your query, do click `Accept Answer` and `Yes` for was this answer helpful. And, if you have any further query do let us know.  


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.