Our jobs are failing intermittently at azure sql db step error code 40316

Ankit Kumar Bansal 20 Reputation points
2026-08-27T13:13:10.7333333+00:00

we have so many scheduled job which interact with azure sql database few are failing and few are succeeding , all are configured with same database.

see below ss for your reference
User's image

Azure SQL Database

Answer accepted by question author
Deepesh Dhake 1,165 Reputation points
2026-08-27T14:42:15.2033333+00:00

You can try following:

Check the compute tier. If it's Serverless, auto-pause likely explains it, the first connection after idle returns 40613 while it resumes. Raise the auto-pause delay or move to provisioned.

Check Resource Health to see if failures line up with platform events. Persistent failures while the DB shows Online = platform-side.

Add retry logic with backoff (3–5 retries) on all jobs.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Oldest
  1. Himaja Y 375 Reputation points Microsoft External Staff Moderator
    2026-08-27T14:18:07.7733333+00:00

    Hi @Ankit Kumar Bansal ,

    Thank you for posting your query on Microsoft Q&A platform.

    We understand that multiple scheduled jobs are intermittently failing and that this is causing critical production impact.

    The screenshot confirms Azure SQL error 40613:“Database is not currently available.” This can occur when the database is temporarily unable to accept connections. However, the error alone does not confirm the underlying cause, so further investigation is required. Similar cases may involve maintenance, failover, resource pressure, or another database availability event.

    As an immediate mitigation, please enable retry logic with exponential backoff for database connection attempts. Also verify the database status, Azure Service Health, Resource Health, and database resource-utilization metrics during the affected period.

    To proceed with investigation, please share the required details through private message.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.