Hello,
Welcome to Microsoft Q&A,
The behavior you're experiencing an HTTP 429 "Too Many Requests" error on the first call to the Azure Speech-to-Text REST API after a period of inactivity is indicative of the service's autoscaling mechanism. Azure's Speech service dynamically allocates resources based on demand, and after a prolonged idle period, the service may need time to scale up resources to handle new requests.
When the Speech service has been idle, it may not have sufficient resources immediately available to handle incoming requests. The first request after such an idle period can trigger the service to scale up its resources. During this scaling process, the service may temporarily reject requests, resulting in a 429 error.
To mitigate this issue, consider the following strategies:
- Implement Retry Logic (As you have implemented currently)
- Periodic Warm-Up Requests - Send periodic light weight request to keep it active
Please Upvote and Accept the answer if it helps!!