public/Stop-AdfTriggers.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
35
36
<#
.SYNOPSIS
Stops all triggers in Azure Data Factory instance (service).
 
.DESCRIPTION
Stops (disables) all triggers in Azure Data Factory instance (service).
 
.PARAMETER FactoryName
Name of Azure Data Factory service to be affected.
 
.PARAMETER ResourceGroupName
Resource Group Name of ADF service to be affected.
 
.EXAMPLE
$ResourceGroupName = 'rg-devops-factory'
$DataFactoryName = "SQLPlayerDemo"
Stop-AdfTriggers -FactoryName "$DataFactoryName" -ResourceGroupName "$ResourceGroupName"
 
.LINK
Online version: https://github.com/SQLPlayer/azure.datafactory.tools/
#>

function Stop-AdfTriggers {
    [CmdletBinding()]
    param (
        [parameter(Mandatory = $true)] [String] $FactoryName,
        [parameter(Mandatory = $true)] [String] $ResourceGroupName
    )

    [Adf] $adf = New-Object 'Adf'
    $adf.Name = $FactoryName
    $adf.ResourceGroupName = $ResourceGroupName

    Stop-Triggers -adf $adf
    
}