r/SQLServer • u/East_Sentence_4245 • Jul 24 '26
Question Since Azure SQL is serverless, can app time-out before "cold start"?
I have the cheapest version of SQL Azure. I'm not sure if it's serverless, but it sure acts as if it's serverless.
The question is: When an external app (in this case, an Android mobile app) tries to connect to Azure SQL while it's "sleeping", can app time-out before the "cold start" is completed and DB is awake?
3
Upvotes
•
u/AutoModerator Jul 24 '26
After your question has been solved /u/East_Sentence_4245, please reply to the helpful user's comment with the phrase "Solution verified".
This will not only award a point to the contributor for their assistance but also update the post's flair to "Solved".
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/dlevy-msft Microsoft Employee Jul 24 '26
What is your app written in / what driver do you use?
15
u/dbrownems Microsoft Employee Jul 24 '26
Yes the initial connection attempt can time out and you should retry.
11
u/Justbehind Jul 24 '26
Depends on your app's implementation.
The general suggestion using cloud dbs is to implement retry-logic for establishing connections.
5
u/jdanton14 Microsoft MVP Jul 24 '26
Btw, fun thing I learned when building automation around azure sql serverless. Checking the TDE status of a database wakes it without throwing an error. I wouldn’t build an app around that though :)
4
u/SuperDuperDBA Jul 24 '26
not sure why you did a whole new question.
How to confirm this is your issue
Run this test:
You will probably see:
Then:
If the app immediately works after SSMS woke the database, you have basically proven it is the serverless pause/resume delay.
2
u/raistlin49 Jul 24 '26
Yes, it's very common to get a connectivity error on first connection when a serverless Azure SQL Db is resuming. Not sure if I'm getting used to it or it's really getting less common, but I want to say it used to be a lot more common.
1
u/tokenegret Jul 25 '26
It can, but you can usually set the timeout in the connection string
1
u/DennesTorres Jul 27 '26
Yes, it can. But serveless is not the cheapest one. DTU 5 is.