Share via

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.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

Anonymous
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.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.