1
votes

We have a large SQL Database running on Azure which is only generally in use during normal office hours, although from time to time, overtime/weekend staff will require performant access to the database.

Currently, we run the database on the S3 Tier during office hours, and reduce it to S0 at all other times.

I know that there are a number of example PowerShell scripts that can be used together with automation tasks to automatically modify the database tiers according to a predefined timetable. However, we would like to control it from within our own .Net application. The main benefit is that this would allow us to give control to admin staff to switch up the database tier during out-of-hours as required without the need for technical staff to get involved.

There are a number of articles/videos on the Microsoft site that mention "scaling up/down" (as opposed to "scaling out/in", i.e. creating/removing additional shards), but the sample code provided seems to deal exclusively with sharding, and not with vertical "scaling up/down".

Is this possible? Can anyone point me in the direction of any relevant resources?

2
Since you want to do this from .Net, use of Sql Azure SDK should be more appropriate. nuget.org/packages/Microsoft.WindowsAzure.Management.SqlVikas Gupta
Agreed, although I think if the only reason is to scale the tier, adding the whole SDK is an overkill.Panos
Thank you for your advice. I also discovered that in fact I could achieve the same thing by issuing an ALTER DATABASE command on the appropriate database.user2209634
Could you give us the command you used?Steven Elliott

2 Answers

3
votes

You can, yes. You have to use the REST API to do the call to our endpoints and update the database.

The description and the parameters of the PUT required to the update is explained here -> Update Database Details

You can change the tier programmatically from there.

1
votes

Yes, you can change database tiers using REST API and call Azure endpoints to update the tier.

The parameters to be used for PUT are explained on this msdn page: Update Database