I created an Azure function in python to insert data into SQL server. The process was taking around a minute
when I was locally testing it. But when I deployed the code, I ended up receiving a 503 error
as shown below.
After debugging, I realized the data was successfully persisted in the database (the whole 1 min process), but it's only the response that I get is the error.
So I created a function to just sleep for 30 seconds
(after some trial and error) and render a JSON response (check below code).
I get a successful response for 29 seconds or lesser
but when I make the sleep to 30 seconds, I get the 503 error
import json
import azure.functions as func
import time
def main(req: func.HttpRequest) -> func.HttpResponse:
data = req.get_json()
data["processed"] = True
time.sleep(30)
return func.HttpResponse(json.dumps(data))
Our services aren't available right now
We're working to restore all services as soon as possible. Please check back soon.
I started with a consumption plan
and even changed it to Elastic Premium
but the outcome did not change.