creating Schedule trigger using powershell in ADFV2

AzeemK 516 Reputation points
2020-12-23T23:51:09.903+00:00

I am creating a schedule trigger using Power Shell in ADF V2 , getting error below , any idea what I am missing
MY resource group is : RSG-EDMASAP-DEV
ADF name is : asap-dev-adf1
Trigger name is : Tg_NCF
Json file to create trigger is : Tg_MCFSegment.json

PS C:\windows\system32> Set-AzDataFactoryV2Trigger -ResourceGroupName $RSG-EDMASAP-DEV
-DataFactoryName $asap-dev-adf1 -Name "Tg_MCFSeg" -DefinitionFile "C:\Users\adm.Akhan\Documents\Tg_MCFSegment.json"

cmdlet Set-AzDataFactoryV2Trigger at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Name: Tg_NCF
DefinitionFile: Tg_MCFSegment.json
DataFactoryName: asap-dev-adf1
Set-AzDataFactoryV2Trigger : Run Connect-AzAccount to login.
At line:1 char:1

  • Set-AzDataFactoryV2Trigger -ResourceGroupName $RSG-EDMASAP-DEV
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : CloseError: (:) [Set-AzDataFactoryV2Trigger], PSInvalidOperationException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.DataFactoryV2.SetAzureDataFactoryTriggerCommand

-DataFactoryName : The term '-DataFactoryName' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:2 char:2

  • -DataFactoryName $asap-dev-adf1 -Name "Tg_MCFSeg" -DefinitionFile "C ...
  • ~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (-DataFactoryName:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,483 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,486 Reputation points Microsoft Vendor
    2020-12-24T05:30:28.56+00:00

    Hi,

    According to the error message, you need to run Connect-AzAccount to login before Set-AzDataFactoryV2Trigger and the second line starting with -DataFactoryName should be in the same line with Set-AzDataFactoryV2Trigger. If you wan to split a command into multiple lines, you have to append a backtick character ` to the first line

    Set-AzDataFactoryV2Trigger -ResourceGroupName $RSG-EDMASAP-DEV `  
    -DataFactoryName $asap-dev-adf1 -Name "Tg_MCFSeg" -DefinitionFile "C:\Users\adm.Akhan\Documents\Tg_MCFSegment.json"  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful