How to Copy Multiple Tables from On-Premise to Cloud in Azure Data Factory with PowerShell (Part 2)

April 1, 2020
Learn how to implement a solution (using PowerShell) to copy multiple tables from an on-prem SQL Server DB to Azure Synapse Analytics!

Phil Woubshet Key2 ConsultingBy: Phil Woubshet
 
 
In part 1 of this series, we implemented a solution within the Azure Portal to copy multiple tables from an on-premise SQL Server database to Azure Synapse Analytics (formerly Azure SQL Data Warehouse).

Today’s exercise will be to implement the same solution programmatically using PowerShell.  We will skip the Azure Portal interface entirely.

A PowerShell solution could help augment an existing solution that you build in the Azure Portal that has repeatable elements to it.  You could also utilize a PowerShell solution to launch similar configurations to different resources, servers, data factories, etc.

Here’s an outline of what we will accomplish:

  1. Connect Azure Account
  2. Create Resource Group
  3. Create Data Factory
  4. Create Linked Service
  5. Create Pipeline
  6. Execute Pipeline

 

PowerShell Module installation

This is a one-time task per machine where you want to run the PowerShell script:

 

Create Configuration file:

 

Main Script Components

A. Connect Azure Account

 

B. Create Resource Group

 

C. Create Data Factory

 

D. Create Linked Service to On-Premise SQL Server Database

 

E. Create Datasets

 

F. Create Pipelines

 

G. Execute the Pipeline

 

References

https://docs.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-powershell
https://docs.microsoft.com/en-us/azure/data-factory/monitor-programmatically
 

Questions?

Thanks for reading. We hope you found this blog post to be useful. Do let us know if you have any questions or topic ideas related to BI, analytics, the cloud, machine learning, SQL Server, Star Wars, or anything else of the like that you’d like us to write about. Simply leave us a comment below, and we’ll see what we can do!
 

Keep Your Business Intelligence Knowledge Sharp by Subscribing to our Email List

Get fresh Key2 content around Business Intelligence, Data Warehousing, Analytics, and more delivered right to your inbox!

 


Key2 Consulting is a data warehousing and business intelligence company located in Atlanta, Georgia. We create and deliver custom data warehouse solutions, business intelligence solutions, and custom applications.

Related Content
What is a Cloud Solution? Two Useful Examples

What is a Cloud Solution? Two Useful Examples

By: Kash Sabba   Cloud-based product offerings have been on the rise over the last few years. Microsoft Azure, AWS, Google Cloud, and Snowflake are some of the big players that dominate today’s cloud space. Each company offers a suite of cloud products for...

How Confidential Computing Helps Secure Data In Use

How Confidential Computing Helps Secure Data In Use

By: Phillip Sharpless     Securing Data in On-Prem to Cloud Migrations When an organization decides to take the plunge and migrate from on-premise to a cloud-based architecture, there can be a certain apprehension when it comes to security. Nobody doubts...

What is Azure Databricks?

What is Azure Databricks?

By: Phillip Sharpless     Introduction to Azure Databricks Finding the right tools to manage your big data ecosystem can be a daunting task, as there seem to be a myriad of options, all advertising impressive-sounding features. One analytics platform that is...