PowerShell get ADF parameters

Shi, Quan 61 Reputation points
2022-06-16T07:35:09.747+00:00

Use in PowerShell PS1 file calls the pipeline of ADF. How do I set the configuration file? Is it configured in ADF?

Param($execKind)
$json = ConvertFrom-Json -InputObject (Get-Content C:XX\account.json -Raw)
$runIdFile = $null
$pipeline = $null
if(1 -eq $execKind){
$runIdFile = $json.RunIdFile
$pipeline = $json.PipelineNameimmediate
}

The above code cannot obtain the ID of the pipeline and other information

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,916 Reputation points
    2022-06-16T15:26:04.577+00:00

    Hi ShiQuan-1371,

    The Pipeline data is configured in the ADF configuration file.

    For example lets alter a pipelines schedule start, end and paused values. I always publish to dev as paused to give me more control over running the pipeline.

    At the bottom of our pipeline component file I’ve done the following.

    //etc...  
    //activities block  
    ],  
    "start": "1900-01-01", /*<get from config file>*/  
    "end": "1900-01-01", /*<get from config file>*/  
    "isPaused": /*<get from config file>*/,  
    "pipelineMode": "Scheduled"  
    

    }
    }

    … Which means in my config file I need to create the equivalent set of attribute references and values. Note; the dollar for the root, then one level down into the properties namespace. Then another dot before the attribute.

    {
    "ExactNameOfYourPipeline": [ // <<< Component name. Exactly!
    {
    "name": "$.properties.isPaused",
    "value": true
    },
    {
    "name": "$.properties.start",
    "value": "2016-08-01"
    },
    {
    "name": "$.properties.end",
    "value": "2017-06-01"
    }
    ]
    }

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

    --If the reply is helpful, please Upvote and Accept as answer--


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.