patron
patron

Reputation: 11

Azure SQL DTU level increase and decrease with powershell schedule

We have a REPORT database in Azure. Every morning, we need some complex sql procedures to work inside that server. Normally DTU level of this server is 0. but only in the mornings, it needs to be updated to DTU level 3. We are now making this manually by ourselves. But we want this to be automated via Powershell or anything. how can we achieve this. Can you show us the way please because we are .NET developers and don't know anything about scripting languages.

Thanks for reading and hope you can help us.

Upvotes: 0

Views: 4709

Answers (2)

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30333

There are powershell script, azure cli and API that you can use to manage Elastic Pools.

Powershell: For more information check here

Set-AzSqlElasticPool -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -ElasticPoolName "ElasticPool01" -Dtu 1000 -DatabaseDtuMax 100 -DatabaseDtuMin 20 

Azure Cli: Check here for more information

az sql elastic-pool update -g mygroup -s myserver -n mypool -c

API: Check here for details.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}?api-version=2017-10-01-preview

Upvotes: 1

Leon Yue
Leon Yue

Reputation: 16411

Single Azure SQL Database supports manual dynamic scalability, but not autoscale. For a more automatic experience, consider using elastic pools, which allow databases to share resources in a pool based on individual database needs. However, there are scripts that can help automate scalability for a single Azure SQL Database. For an example, see Use PowerShell to monitor and scale a single SQL Database.

Hope this helps.

Upvotes: 0

Related Questions