[spacer] [spacer] [spacer]

Sign up with your email address to be the first to know about new publications

[mc4wp_form id="4946"] [spacer]

Restarting Azure Synapse Analytics SQL Pools with PowerShell

Let’s have a look at restarting, pausing or resuming an Azure Synapse Analytics SQL Pool database using PowerShell. The PowerShell scripts are quite useful. I built a wrapper to perform all the operations. 

I recently found myself working on a project where restarting the Azure Synapse Analytics SQL Pool (aka Azure SQL Data Warehouse) was a requirement to solve some performance issues. I also believe that it’s good practice to restart it. The activities in the compute nodes are intensive and generate many logs. 

With this script you can perform any of the following activities: 

  • Pausing 
  • Starting 
  • Restarting 

Download the Script 

The script is available through the following link:  

My Github 

Pre-requirements  

Before you can run the script, you need to download the Az Module and log into the Azure tenant. In  upcoming blog posts, I’ll show you how to use an automation account. 

Install Az Module  

Install-Module -Name Az 

Connect to Azure  

Connect-AzAccount  

Execute the Script 

The script has 4 mandatory parameters: 

  • ResourceGroupName: resource group name where the server is being hosted 
  • ServerName: server name that needs to be restarted 
  • DatabaseName: database name that needs to be restarted 
  • Operation: Start/Pause or Restart 
.\Restart-AzSynapseSQLPool.ps1 -ResourceGroupName "YourRGName" -ServerName "YourSQLServerName" -DatabaseName "YourDatabaseName" -Operation "Pause"  
Execute the script

Summary 

In this post, you’ve learned how easy it is to start using PowerShell scripts to manage your database. 

What’s next? 

In upcoming posts, I’ll show you how to include this script in an Automation Account.  

Check out my previous posts: 

No Comments Yet.

Do you want to leave a comment?

Your email address will not be published. Required fields are marked *