Connecting to an Azure SQL Database

I'm running a serverless Azure SQL database which goes to pause state after 1 hour of inactivity. If I run an aggregate against it while it is paused, it takes somewhere around 30 seconds to wake up & responds. I'd like to have something more interactive on screen to tell the users at 5 second intervals that it is attempting something, then capture the error.

My current approach (which doesn't work):

On login I have a server action with a timeout of 30 seconds & within that server action I have an aggregate with a timeout of 5 seconds. I expected the aggregate to timeout first, but I can never seem to trigger the timeout exception of the aggregate using a Communication Exception or even All Exceptions in the server action. Instead a communication exception is triggered on timeout of the server action after 30 seconds.

My intended application was that if a Communication Exception is triggered the server action should respond success=false, wait for 5 seconds, then try again. This sits in a loop for 5 attempts, after which it triggers a higher level exception.

How could I go about this/what am I doing wrong?

Rank: #17

Hi Steve,

Why not set the timeout to 90 seconds, according to Microsoft documentation the latency to autoresume a serverless database is generally order of 1 minute to autoresume.

If you use a loader button to execute a query you give the user a visual feedback that the loading of data takes place.