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