Skip to content

Instantly share code, notes, and snippets.

@ahkim
Created July 14, 2016 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahkim/47bad863e4bd2f71e70391046a45ba58 to your computer and use it in GitHub Desktop.
Save ahkim/47bad863e4bd2f71e70391046a45ba58 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