Automate pause/resume Synapse Workspace (Preview) SQL Pool with Powershell

Jim Mauck 106 Reputation points
2020-07-19T20:58:36.333+00:00

I have a Synapse Workspace with SQL Pool that I would like to automate resume and suspend with PowerShell. I am following this MS doc as a guide: https://learn.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/pause-and-resume-compute-powershell

I am using this command after authenticating and setting proper subscription context:

Suspend-AzSqlDatabase –ResourceGroupName "workspacemanagedrg-********-****-****-****-************" –ServerName "syndatawarehouse" –DatabaseName "sqlpooldw"  

(The only way I can get this command to work is by referencing the SQL Pool with managed resource group name as the ResourceGroupName parameter. The SQL Pool is not found when referencing it using the primary resource group name.)

With this, the suspend command is able to reference my SQL Pool but I get this error message:

Suspend-AzSqlDatabase: DenyAssignmentAuthorizationFailed: The client '****@******.onmicrosoft.com' with object id '********-****-****-****-************' has permission to perform action 'Microsoft.Sql/servers/databases/pause/action' on scope '/subscriptions/********-****-****-****-************/resourceGroups/workspacemanagedrg-********-****-****-****-************/providers/Microsoft.Sql/servers/syndatawarehouse/databases/sqlpooldw/pause'; however, the access is denied because of the deny assignment with name '********-****-****-****-************' and Id '********************************' at scope '/subscriptions/********-****-****-****-************/resourceGroups/workspacemanagedrg-********-****-****-****-************'.  

I can see the deny assignment is placed on the SQL Pool from the managed resource group through Azure Blueprint that was applied during SQL Pool creation.

Do I need to remove the deny assignment?
Or is there another way to reference the SQL Pool database to get around the deny assignment?

Thank you,
Jim

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,378 questions
{count} votes

Accepted answer
  1. Jim Mauck 106 Reputation points
    2020-07-27T17:13:22.377+00:00

    Hi Pradeep,

    I figured it out I was using wrong product documentation set. I was following "Azure Synapse Analytics (formerly SQL DW)".
    I needed to follow "Azure Synapse Analytics (workspaces preview)". They have completely different set of commands. This happened easily because searching for "pause resume Synapse Analytics with PowerShell" in MS documentation sites finds the formerly SQL DW and not the workspaces preview in the results.

    Going back through the workspaces preview documentation again I noticed that distinction and the PowerShell command Update-AzSynapseSqlPool.

    So, for my instance, these commands work in PowerShell:

    Update-AzSynapseSqlPool -WorkspaceName syndatawarehouse -Name sqlpooldw -Resume
    Update-AzSynapseSqlPool -WorkspaceName syndatawarehouse -Name sqlpooldw -Suspend
    

    I am also able the schedule these as PowerShell runbooks in Azure Automation.

    Regards,
    Jim

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.