All about data

Create a Azure Data Factory Using PowerShell

It is easy to create a Azure Data Factory using PowerShell. However, you might fail to create one if you follow Microsoft’s Example without upgrading your PowerShell.

Prerequisites: you need to have a valid Azure Subscription and a resource group.

Step 1: Login Azure Account. run the following command. It will pop up a windows. You simply enter your username and password.

Login-AzureRmAccount

Step 2: Find your subscription. The following command will show you all subscriptions.

Get-AzureRmSubscription

Step 3: Choose your subscription. If you have multiple subscriptions, you need to choose which one you want to use. You need the subscription Id which you can find from the result of step 2.

Select-AzureRmSubscription -SubscriptionID “you subscription Id”

Step 4: Define resource group name and data factory name parameters. You need to know which resource group do you want to put your data factory. If you don’t remember the resource group name, you can get all your resource group names by running Get-AzureRmResourceGroup command. The data factory name must start with a letter or a number, and can contain only letters, numbers, and the dash (-) character. That means you can not use underscore which usually can be used for naming. Data factory name should be at least 3 characters long and no more than 63 characters long. You can check here for the data factory naming convention.

$resourceGroupName = “Your existing resource group name”;

$dataFactoryName = “Your Data Factory Name”;

Step 5: Create new data factory. In my case, you should use New-AzureRmDataFactory instead of Set-AzureRmDataFactoryV2 command.