How to Create Azure Synapse Analytics

How to Create Azure Synapse Analytics

In this Azure tutorial, we will discuss how to create Azure synapse analytics. Along with this, we will also discuss Create Azure Synapse Analytics using PowerShell, Azure Synapse Studio, and how to open Azure Synapse Studio, etc.

To Create Azure synapse analytics workspace, Search for Azure synapse analytics in the Azure Portal –> Click on the + Create button from the Azure synapse analytics window.

Well, we can easily create an Azure synapse analytics workspace using Azure Portal. Before starting the actual functionality we should know the prerequisites needed for creating Azure synapse analytics.

Prerequisites

You must have a valid Azure Account or an Azure Subscription. If you don’t have an Azure account, create a free Azure account now.

Assuming, you are ready with the prerequisites, let’s start creating Azure synapse analytics using Azure Portal.

Create Azure Synapse Analytics

  1. Log in to the Azure Portal (https://portal.azure.com/)
  2. Once, logged in to the Azure Portal, search for “Azure Synapse Analytics” and click on the search result “Azure Synapse Analytics“.
Create Azure Synapse Analytics

3. On the Azure Synapse Analytics window, click on the + Create button to create your Azure Synapse Analytics Workspace.

Or, you can also click on the Create Synapse Workspace button to create the Workspace.

create azure synapse analytics workspace

4. On the Create Synapse workspace window, fill in the below details.

  • Subscription: Select a valid Azure Subscription that you want to use here.
  • Resource Group: You can select your existing Resource Group or If you don’t have an existing Resource Group, you can click on the Create new link to create a new Resource group.
  • Managed resource group: Provide the name for the Managed resource group.
  • Workspace name: Provide an unique name for your Azure Synapse workspace.
  • Region: Select the Region.
  • Select Data Lake Storage Gen2: You can select the From subscription option. You can also do it Manually via URL.
  • Account name: Click on the Create new ink and provide a name for your Data Lake Storage Gen2 account.
  • File system name: For the File system name, Click on Create new ink and provide a name for the Data Lake Storage Gen2 file system.
creating azure synapse analytics workspace
How to create azure synapse analytics workspace

Now, it will look like below.

Create Synapse workspace in Azure Portal

Select or check the checkbox “Assign myself the Storage Blob Data Contributor role on the Data Lake Storage Gen2 account to interactively query it in the workspace.“.

Keep the other options as it is and now click on the Review + create button.

Now, it will validate all the values entered are correct or not. If it will find all the values are perfect as per the terms and conditions, it will show a “Validation succeeded” message on the next screen and the Create button will get enabled.

5. On the next screen review all the details including the pricing details and finally, click on the Create button to create the Synapse workspace.

It might take a few minutes to create all the components associated with the Synapse workspace and finally, it will show you “Your deployment is complete”.

Expand Deployment details to see all the components of the Synapse workspace.

Create synapse analytics workspace on Azure Portal

So, we have created the Synapse workspace successfully.

How do I create Azure synapse analytics

Create Azure Synapse Analytics using PowerShell

Well, you can also use the Azure Synapse Analytics using Azure PowerShell, But before that, we should know the Prerequisites needed here.

Prerequisites

Follow the below steps quickly.

  1. The first step is to install Az.Synapse Azure PowerShell module.
Install-Module -Name Az.Synapse

Once, you will run the above command, you will get the below pop-up. Click on the Yes to All button to install the Az.Synapse Azure PowerShell module.

Create Azure Synapse Analytics PowerShell

On the successful installation of the Az.Synapse module, you will get the installation completed message.

install Az.Synapse Azure PowerShell module

2. As the next step, you need to create a resource group using the below Azure PowerShell cmdlet.

$resourceGrp = 'Demo690'
$YourRegion = 'East US'
New-AzResourceGroup -Name $resourceGrp -Location $YourRegion

Once, you will execute the above script, you will get the below output on successful completion.

ResourceGroupName : Demo690
Location          : eastus
ProvisioningState : Succeeded
Tags              : 
ResourceId        : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups
                    /Demo690

3. If you don’t have a storage account, you can create an Azure storage account using the below Azure PowerShell cmdlet.

$resourceGrp = 'Demo690'
$location = 'East US'

New-AzStorageAccount -ResourceGroupName $resourceGrp `
  -Name 'demostrgact' `
  -Location $location `
  -SkuName Standard_RAGRS `
  -Kind StorageV2

On the successful execution, you will get the output like below

StorageAccountName ResourceGroupName PrimaryLocation SkuName        Kind      AccessTi
                                                                              er      
------------------ ----------------- --------------- -------        ----      --------
demostrgact        Demo690           eastus          Standard_RAGRS StorageV2 Hot    

4. Now, run the below Azure Powershell script to create the Azure Synapse Analytics workspace.

$SynapseWN = 'demoworkspace56'
$resourceGrp = 'Demo690'
$StorageAN ='demostrgact'
$FileSN = 'democtfile'
$MySqlUser = 'tsinfouser1'
$MySqlPassword = '[email protected]'
$Region = 'East US'

$myCred = New-Object -TypeName System.Management.Automation.PSCredential ($SqlUser, (ConvertTo-SecureString $SqlPassword -AsPlainText -Force))

$MywpParams = @{
  Name = $SynapseWN
  ResourceGroupName = $resourceGrp
  DefaultDataLakeStorageAccountName = $StorageAN
  DefaultDataLakeStorageFilesystem = $FileSN
  SqlAdministratorLoginCredential = $myCred
  Location = $Region
}
New-AzSynapseWorkspace @MywpParams

Below are the parameter details

  • $SynapseWN = Your Azure Synapse Workspace name.
  • $resourceGrp = Your Resource Group name.
  • $StorageAN = The ADLS Gen2 storage account name that you have created above.
  • $FileSN = Your existing file storage name.

Once you will run the above Azure PowerShell script, on the Successful creation of the Azure Synapse Workspace, you will get the output like below. In Case, you will get an error like “The ‘New-AzSynapseWorkspace’ command was found…”, you can check out the Solution.

DefaultDataLakeStorage           : Microsoft.Azure.Commands.Synapse.Models.PSDataLakeS
                                   torageAccountDetails
ManagedResourceGroupName         : synapseworkspace-managedrg-68aac7b1-e5bf-44b2-8409-
                                   4aa31d3edc44
ProvisioningState                : Succeeded
SqlAdministratorLogin            : tsinfouser1
VirtualNetworkProfile            : 
Identity                         : Microsoft.Azure.Commands.Synapse.Models.PSManagedId
                                   entity
ConnectivityEndpoints            : {[web, https://web.azuresynapse.net?workspace=%2fsu
                                   bscriptions%2f1cdf4300-dee5-4518-9c9c-feaa72a5cbd1%
                                   2fresourceGroups%2fDemo690%2fproviders%2fMicrosoft.
                                   Synapse%2fworkspaces%2fdemoworkspace56], [dev, 
                                   https://demoworkspace56.dev.azuresynapse.net], 
                                   [sqlOnDemand, 
                                   demoworkspace56-ondemand.sql.azuresynapse.net], 
                                   [sql, demoworkspace56.sql.azuresynapse.net]}
ManagedVirtualNetwork            : 
PrivateEndpointConnections       : {}
WorkspaceUID                     : 6d7de4af-d4f0-4a2b-82ef-1726bd07a1e3
ExtraProperties                  : {[WorkspaceType, Normal], [IsScopeEnabled, False]}
ManagedVirtualNetworkSettings    : 
Encryption                       : Microsoft.Azure.Commands.Synapse.Models.PSEncryptio
                                   nDetails
WorkspaceRepositoryConfiguration : 
CspWorkspaceAdminProperties      : Microsoft.Azure.Commands.Synapse.Models.PSCspWorksp
                                   aceAdminProperties
PublicNetworkAccess              : Enabled
PurviewConfiguration             : 
Tags                             : 
TagsTable                        : 
Location                         : eastus
Id                               : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1
                                   /resourceGroups/Demo690/providers/Microsoft.Synapse
                                   /workspaces/demoworkspace56
Name                             : demoworkspace56
Type                             : Microsoft.Synapse/workspaces

You can see it here.

Create Azure Synapse Analytics using PowerShell

5. Now, to get the Azure synapse URL, you can execute the below Azure PowerShell script

$SynapseWN = 'demoworkspace56'
$resourceGrp = 'Demo690'
$MywsWebURL = (Get-AzSynapseWorkspace -Name $SynapseWN -ResourceGroupName $resourceGrp).ConnectivityEndpoints.web

$MywsWebURL contains the value for the Azure Synapse URL.

6. Access the Azure Synapse Workspace URL using the below command.

Start-Process $MywsWebURL

Once, you will run the above command, the Azure Synapse Analytics Workspace will open in a new tab on your browser.

How to Create Azure Synapse Analytics using PowerShell

You might be thinking what next?. Yes, it is Synapse Studio that comes into the picture now.

Azure Synapse Studio

Azure Synapse Studio is an excellent tool that helps you to build your fully-integrated analytics solution. It helps you to perform many activities on your data.

Azure Synapse Studio provides you with different tabs. On the Azure Synapse Studio page, you will find all the tabs on the left navigation.

How to open Azure Synapse Studio

Home Tab

Here, you will get the options to ingest, analyze, visualize your data. You can interact with PowerBI to build interactive reports with your data.

Getting started with Azure Synapse Studio

Data Tab

From the Data tab, you have the options to create SQL database, Lake database, etc. you can also connect to external data. Click on the + option to view all the available options.

Introduction to Azure Synapse Studio

Develop Tap

From the Develop tap, you can manage SQL script, KQL script, Notebook, your Data flow, etc. Just click on the + option to get all these options.

How to use Azure Synapse Studio

Integrate Tab

On the Integrate tab, you have the option to integrate with Pipeline, Copy Data tool, etc. Just click on the + option for viewing all these options.

Use Azure Synapse Studio

Monitor Tab

From the Monitor tab, you have the options to monitor SQL Pools, Apache Spark pools, Data Explorer Pools, SQL requests, KQL requests, Apache Spark applications, etc. Once you will click on the Monitor tab, you will find all the options. Click each of the options to monitor individually.

azure synapse studio tutorial

Manage Tab

From the manage tab, you can able to manage SQL pools, Data Explore pools, Apache Spark pools, and along with that, you can manage external connections like Linked services, Azure Purview, etc. You can also manage the security part with Credentials, Access controls, etc.

Along with that, you can manage the integration with the triggers, Creating pipeline triggers, Integration runtimes, and many more.

what is azure synapse studio

How to open Azure Synapse Studio

  1. Once you have created Azure Synapse Analytics workspace in Azure Portal, Follow the below steps to open the Azure Synapse Studio.
  2. Log in to the Azure Portal (https://portal.azure.com/)
  3. Search for Azure Synapse Analytics and click on the Search result “Azure Synapse Analytics”.
  4. Now, you can able to see the Azure Synapse Analytics Workspace that you have already created –> click on that Workspace to open.
  5. On the Azure Synapse Analytics Workspace page –> Click on the Overview tab –> You can ble to see “Open Synapse Studio” on the right side under “Getting started”.
Azure Synapse Studio

Delete Azure Synapse Analytics Workspace

If you don’t want to keep the Azure Synapse Workspace, you can delete the workspace using PowerShell as well as using Azure Portal.

Using PowerShell

You can use the below Azure PowerShell script to delete the Workspace.

$SynapseWN = 'demoworkspace56'
$resourceGrp = 'Demo690'
Remove-AzSynapseWorkspace -Name $SynapseWN -ResourceGroupName $resourceGrp

Once you will execute the above script, click on the Yes button for confirmation on the next step.

Delete Azure Synapse Analytics Workspace using PowerShell

It will take a few seconds to delete the Azure Synapse Analytics Workspace.

Using Azure Portal

From Azure Portal also you can able to remove the Azure Synapse Analytics Workspace using the below information.

  1. Login to AzurePortal and navigate to the Azure Synapse Analytics Workspace.
  2. On the Synapse workspace page, click on the three dots from the right side –>
Remove Azure Synapse Analytics Workspace

You may also like following the below articles

Wrapping Up

In this article, we learned how to create Azure synapse analytics using Azure Portal and PowerShell and along with that, we have also discussed Azure Synapse Studio and how to open Azure Synapse Studio, Delete Azure Synapse Analytics Workspace, etc. Hope you have enjoyed this article !!!