Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/DataFactory/DataFactoryV2/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Fixed the command `Invoke-AzDataFactoryV2Pipeline` for SupportsShouldProcess issue

## Version 1.11.2
* Updated ADF .Net SDK version to 4.13.0
Expand Down
1 change: 1 addition & 0 deletions src/DataFactory/DataFactoryV2/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,6 @@ internal static class Constants

public const string ActionDescriptionForRemoveEventSubscription = "Unsubscribe the event trigger from external service events.";

public const string ActionDescriptionForInvokePipeline = "Starts a run for \"{0}\" pipeline in the \"{1}\" factory.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace Microsoft.Azure.Commands.DataFactoryV2
{
[Cmdlet("Invoke", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2Pipeline", DefaultParameterSetName = ParameterSetNames.ByFactoryNameByParameterFile,SupportsShouldProcess = true), OutputType(typeof(PSPipeline))]
[Cmdlet("Invoke", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2Pipeline", DefaultParameterSetName = ParameterSetNames.ByFactoryNameByParameterFile, SupportsShouldProcess = true), OutputType(typeof(PSPipeline))]
public class InvokeAzureDataFactoryPipelineCommand : DataFactoryBaseCmdlet
{
[Parameter(ParameterSetName = ParameterSetNames.ByPipelineObjectByParameterFile, Position = 0, Mandatory = true, ValueFromPipeline = true,
Expand Down Expand Up @@ -157,7 +157,10 @@ public override void ExecuteCmdlet()
}
}

WriteObject(DataFactoryClient.CreatePipelineRun(ResourceGroupName, DataFactoryName, PipelineName, paramDictionary, ReferencePipelineRunId, isRecovery, StartActivityName, startFromFailure));
if (ShouldProcess(this.ResourceGroupName, string.Format(Constants.ActionDescriptionForInvokePipeline, this.PipelineName, this.DataFactoryName)))
{
WriteObject(DataFactoryClient.CreatePipelineRun(ResourceGroupName, DataFactoryName, PipelineName, paramDictionary, ReferencePipelineRunId, isRecovery, StartActivityName, startFromFailure));
}
}

private Dictionary<string, object> ReadParametersFromJson()
Expand Down