AzureDataFactoryV2/Execute-PIP_Setup.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Param(
   [string]$TenantID,
   [string]$ResourceGroupName,
   [string]$DataFactoryName,
   [string]$AnalyticsSPAppID,
   [string]$AnalyticsSPKey,
   [string]$AdlsAccountName
)

# halt on first error
$ErrorActionPreference = "Stop"
# print Information stream
$InformationPreference = "Continue"

$pipelineName = "PIP_Setup"
$unmountIfExists = "0"

$pipParameters = @{
tenantId = $TenantID
clientId = $AnalyticsSPAppID
clientKey = $AnalyticsSPKey
adlsAccountName = $AdlsAccountName
unmountIfExists = $unmountIfExists
}

Write-Information "Getting pipeline $ResourceGroupName\$DataFactoryName\$pipelineName ..."
$pipeline = Get-AzureRmDataFactoryV2Pipeline -ResourceGroupName $ResourceGroupName -DataFactoryName $DataFactoryName -Name $pipelineName

Write-Information "Executing pipeline ..."
$pipRun = $pipeline | Invoke-AzureRmDataFactoryV2Pipeline -Parameter $pipParameters

$pipeline | Get-AzureRmDataFactoryV2PipelineRun -PipelineRunId $pipRun

$pipeline