JS_Diver
JS_Diver

Reputation: 786

Azure Data Factory - How to remove data sets in bulk?

How to remove data sets in bulk? I have many data sets but could not find an option on the UI how to delete them all, neither I could find a powershell command.

Upvotes: 4

Views: 2043

Answers (3)

Jingxian Fang
Jingxian Fang

Reputation: 1

Microsoft has updated the version of powershell command for azure data factory. If you want to run above query successfully, now you need to use the V2 version which shows below

Get-AzureRmDataFactoryV2 -ResourceGroupName <rgname> -Name <factory name>  | Get-AzureRmDataFactoryV2Dataset |Remove-AzureRmDataFactoryV2Dataset -Force

Upvotes: 0

JS_Diver
JS_Diver

Reputation: 786

I have not found this option but I created a ps1 script file with Remove-AzureRMDataFactoryDataset statement for each dataset and with -force parameter and then ran it via powershell. It did the job.

Upvotes: 0

Brian Golden
Brian Golden

Reputation: 158

While there is no such option to delete all datasets in the portal, you can do so with a PowerShell snippet:

Get-AzureRmDataFactory -ResourceGroupName <rgname> -Name <factory name> | Get-AzureRmDataFactoryDataset | Remove-AzureRmDataFactoryDataset

You may wish to append -Force to Remove-AzureRmDataFactoryDataset, which will stop the cmdlet from prompting you before deleting each dataset. Keep in mind that datasets cannot be deleted if they are being referenced by some existing pipeline.

Upvotes: 4

Related Questions