Forum Discussion
DJ200
Mar 01, 2024Copper Contributor
Azure SQL Connection Timing Out all of a sudden
Hi All I have a Azure Function App and IoT Hub where my incoming data(once per min per device) gets saved to an SQL database. This has been working well for sometime, but in last day or so, i not...
BabatundeDallas
Mar 09, 2024Copper Contributor
DJ200 the error message you received indicates that the timeout period elapsed before obtaining a connection from the pool.
If your queries take longer to execute, you might encounter timeout errors. You can increase the SQL commands timeout by Setting the SqlCommand.CommandTimeout property to a value that accommodates your function's execution time (e.g., 10 minutes or 600 seconds).
Check the Azure Service Health dashboard for any ongoing issues or maintenance activities in the West Europe region. Sometimes, transient issues or maintenance can impact service availability. If there are any reported incidents, it might explain the sudden increase in pooling and DTU (Database Transaction Units).
Also, please review your SQL database performance metrics. Are there any long-running queries or resource-intensive operations? To improve performance, consider optimizing your queries, indexing, and database schema. Monitor the Database Transaction Units (DTUs) and adjust your database tier if needed.
I will also recommend reading the Timeout expired messages when connecting to SQL Server documentation.
---
If this post is helpful, please give my response a thumbs up! You can also mark it as the solution to help others find it easily.