question

WeberDonaldA-8805 avatar image
0 Votes"
WeberDonaldA-8805 asked WeberDonaldA-8805 rolled back

Looking for Powershell cmdlet that returns information about the DataFactory "Monitor" functionality for DataFactory V2

I am writing a Powershell script to pause Synapse SQL pool after xx time idle. As part of functionality to determine if the Synapse SQL pool can be paused, I would like to determine which DataFactory pipelines are currently running. When specific DataFactory pipelines are running, I do not want to pause the Synapse SQL pool, even if it has been idle for the specified period of time. It appears that the Get-AzDataFactoryActivityWindow cmdlet provided this function for DataFactory V1, but it does not exists for DataFactory V2.

azure-data-factorywindows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered WeberDonaldA-8805 rolled back

Hi @WeberDonaldA-8805 ,

Welcome to Microsoft Q&A platform. Thank you for posting your query here.

For your case you can leverage Get-AzDataFactoryV2, Get-AzDataFactoryV2Pipeline & Get-AzDataFactoryV2PipelineRun.

The Get-AzDataFactoryV2 cmdlet gets information about data factories in an Azure resource group. If you specify the name of a data factory, this cmdlet gets information about that data factory. If you do not specify a name, this cmdlet gets information about all of the data factories in an Azure resource group.

The Get-AzDataFactoryV2Pipeline cmdlet gets information about pipelines in Azure Data Factory. If you specify the name of a pipeline, this cmdlet gets information about that pipeline. If you do not specify a name, this cmdlet gets information about all the pipelines in the data factory.

The Get-AzDataFactoryV2PipelineRun command returns information about runs for the specified pipeline. If PipelineRunId is specified, it shows details for the run with that ID. If the PipelineRunId is not specified, then it shows information about all runs for the pipelines that happened between the values of LastUpdatedAfter and LastUpdatedBefore.


By leveraging all above modules you should be able to develop logic of getting pipeline names and looping through each pipeline to see if any running pipeline there.

Hope this will help. Please let us know if any further queries. Thank you.


  • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks ShaikMaheer-MSFT and LimitlessTechnology-2700 for your responses. Unfortunately both of your proposed solutions only work if you have the PipelineRunId. The PipelineRunId is unique to the specific run a the pipeline.

I currently use the Get-AzDataFactoryV2PipelineRun cmdlet to monitor DataFactory pipelines that are programmically requested by using the Invoke-AzDataFactoryV2Pipeline cmdlet. Basically what was outlined in the link referenced by LimitlessTechnology-2700. This works because Invoke-AzDataFactoryV2Pipeline cmdlet returns the PipelineRunId.

ShaikMaheer-MSFT, without the PipelineRunId, I do not know how to go from Get-AzDataFactoryV2Pipeline cmdlet to the Get-AzDataFactoryV2PipelineRun cmdlet that requires the PipelineRunId.

Any other suggestions or modifications to these suggestions would be appreciated. Thanks.

0 Votes 0 ·

Hi @WeberDonaldA-8805 ,

Thank you for follow-up query.

As mentioned in above answer Get-AzDataFactoryV2PipelineRun will also work without PipelineRunId as well.

If the PipelineRunId is not specified, then Get-AzDataFactoryV2PipelineRun shows information about all runs for the pipelines that happened between the values of LastUpdatedAfter and LastUpdatedBefore.

Please check below screenshot which I tried for same.

130361-image.png

Hope this will help. Thank you.


  • Please don't forget to click on Accept Answer button 130330-acceptansw.jpg whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators


1 Vote 1 ·
image.png (253.8 KiB)
acceptansw.jpg (2.4 KiB)
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hi @WeberDonaldA-8805,



Data Factory only stores pipeline run data for 45 days. When you query programmatically for data about Data Factory pipeline runs - for example, with the PowerShell command Get-AzDataFactoryV2PipelineRun - there are no maximum dates for the optional LastUpdatedAfter and LastUpdatedBefore parameters.

I understand you are in the need of commands for Programmatically monitoring an Azure data factory , if so you can refer this link
https://docs.microsoft.com/en-us/azure/data-factory/monitor-programmatically

Hope this Answers all your queries , if not please do repost back .
If an Answer is helpful, please click "Accept Answer" and upvote it : )

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.