Skip to content

Instantly share code, notes, and snippets.

@Laxman-SM
Forked from ahkim/ManipulateADF.ps1
Created January 24, 2020 09:44
Show Gist options
  • Save Laxman-SM/2e762d8672415f668904bb7836b3948c to your computer and use it in GitHub Desktop.
Save Laxman-SM/2e762d8672415f668904bb7836b3948c to your computer and use it in GitHub Desktop.
Useful powershell cmdlets for Azure Data Factory
#
# ManipulateADF.ps1
#
# automate log-in
$resourceGroupName = "{your_resource_group}"
$azureAccountName = '{your_email}'
$azurePassword = ConvertTo-SecureString '{your_password}' -AsPlainText -Force
$azureRMCredential = New-Object System.Management.Automation.PSCredential($azureAccountName, $azurePassword)
$account = Login-AzureRmAccount -Credential $azureRMCredential
# Remove pipeline
Remove-AzureRmDataFactoryPipeline -ResourceGroupName $resourceGroupName -DataFactoryName {your_datafactory_name} {your_pipeline_name} -Force
#Remove-AzureRmDataFactoryPipeline -ResourceGroupName $resourceGroupName -DataFactoryName ADFBI Pipeline_Copy_Blix -Force
# Suspend pipeline
Suspend-AzureRmDataFactoryPipeline -ResourceGroupName $resourceGroupName -DataFactoryName {your_datafactory_name} {your_pipeline_name} -Force
# Resume pipeline
Resume-AzureRmDataFactoryPipeline -ResourceGroupName $resourceGroupName -DataFactoryName {your_datafactory_name} {your_pipeline_name} -Force
# Get all datasets
Get-AzureRmDataFactoryDataset -ResourceGroupName $resourceGroupName -DataFactoryName {your_datafactory_name}
# Remove dataset individually
Remove-AzureRmDataFactoryDataset -ResourceGroupName $resourceGroupName -DataFactoryName {your_datafactory_name} -Name {your_table_name} -Force
# Remove all datasets
# This is particularly useful to recursively remove all datasets
Get-AzureRmDataFactoryDataset -ResourceGroupName $resourceGroupName -DataFactoryName {your_datafactory_name} | Remove-AzureRmDataFactoryDataset -Force
# Get status of data factory Gateway
# if status is Online, it means your gateway is ready to use
Get-AzureRmDataFactoryGateway -DataFactoryName {your_datafactory_name} -ResourceGroupName $resourceGroupName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment