azureparametersazure-data-factoryfetchxml

Use date parameter in Azure Pipeline FetchXML query


in my Azure Data Factory pipeline, I have a parameter, let's call it 'pDate', and it has a default value of 2023-01-01.

But every time I run the pipeline (copy data), I want to be able to change it.

I can do that with a variable as shown below (date1 variable), but then I have to change the value of the variable.

How could I insert a parameter here instead?

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> 
<entity name="my_attachment"> 
<all-attributes/>  
<filter type="and"> 
<condition attribute="createdon" operator="on-or-after" value="@{variables('date1')}" /> 
</filter>  
</entity> 
</fetch>


Solution

  • <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="my_attachment">
    <all-attributes/>
    <filter type="and">
    <condition attribute="createdon" operator="on-or-after" value="@{pipeline().parameters.req_date}" />
    </filter>
    </entity>
    </fetch>
    

    enter image description here