0

Can someone with how to get the status for Azure Function. Here's the use case.

  1. User submits the lengthy form online on our website. Once the form is submitted on UI, the spinner comes up
  2. In background, my function kicks in and starts inserting the data to the database.
  3. Once data is inserted, I want the spinner to go away.

As of right now, i am not sure how to know when the function has processed all the data. I tried looking App insights, it seems the logs can be delayed by a few minutes. I also checked Durable functions but couldn't much figure out how to do that.

Any insights how can i achieve this? It is turning out to be more complex that I thought.

Thank you for the help!!!

  • You would need to submit code to get help, but generally your front end should hide the spinner once your backend function sends the http response, which also indicates success or error – Dave Pile Nov 24 '21 at 00:31
  • It is very simple. Your client calls Azure Functions. Your function does its task and then returns a response to the client. The client shows the spinner while waiting for a response. In HTTP speak, the client makes an HTTP GET/PUT/POST request. When that request returns with an HTTP response the task is complete or failed. – John Hanley Nov 24 '21 at 00:55
  • I am sorry to make it sound so simple. I missed a step. my data is first sitting in the service bus topic and the function has a trigger for SB topic which is then inserting the data into the database. When i tried, I think function URL is only available for HTTPS triggers. Any thing else you can recommend? – RandomUser Nov 24 '21 at 02:08
  • isn't function URL available only for HTTP triggers? If i can find a URL for a function that is triggered by SB topic, then it's straightforward. However, there's no way for me to call a function that is triggered from SB topic to know its status. – RandomUser Nov 24 '21 at 15:02

1 Answers1

0

We cannot directly get the status of Non-http trigger azure function. If you want to know the status of Non-http Trigger function you need to enable to logs to check whether the function can be executed or not. It has some slight delay in azure Application insights to know the status of function execution. For that you can check the logs by using Kudu console (https://yourfunctionappname.scm.azurewebsites.net/DebugConsole, then click LogFiles\Application\Functions\Function\yourtriggername> to check the log files) or use Live metrics to know the status of azure function . refer here

If you using the serverless architecture, each time whenever you invoke a service endpoint, a new instance will be created and scaling is managed by scaling controller. There is no way to check if the function is running or not. Refer here

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15