Re-enabling Azure Functions do not happen all the time

Ronnie Julio 1 Reputation point
2022-12-02T22:20:26.633+00:00

Our team have a number of Azure functions enabled and running. We added a new function with the intentions of disabling other functions while processing a message and then enable all functions once the message has been read and processed. Test runs are successful. We noticed an inconsistency with the functions re-enabling, majority of the time the functions are re-enabled. We are disabling the functions using the app setting approach. App insights do not provide much detail of any exceptions. Is there any configuration/setting, we need to consider when enabling/disabling functions?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,932 questions
{count} votes

3 answers

Sort by: Most helpful
  1. MikeUrnun 9,777 Reputation points Moderator
    2022-12-22T23:30:22.19+00:00

    @Ronnie Julio Thanks for the update! I assume you're using Azure SDK for toggling the App Settings, and under the covers, it's probably making requests to the Azure REST API over HTTPS which can intermittently fail due to networking issues or other reasons, especially with a synchronous run in a stateless function invocation. If this is likely the area of concern where the root cause might lie for the inconsistencies, I would consider isolating out the particular task of toggling the App Settings into a stateful Durable Functions component and leverage the built-in Async polling pattern which is used to mitigate the kind of problem with HTTPs.


  2. Ronnie Julio 1 Reputation point
    2023-02-02T21:24:57.6+00:00

    @MikeUrnun I found some time to start tinkering with the Durable Functions approach. I was able to convert all functions to durable functions. Now, the new function will search for all function orchestrations in the "RUNNING" status and suspend them, in the start function. Then, execute some logic via the activity function. Meanwhile in the start function, check the status of the orchestration function to determine if it has completed. At last, resume all function orchestrations. Conceptually, this makes sense. I just do not know the limitations of durable functions but that is why we test.

    0 comments No comments

  3. Ronnie Julio 1 Reputation point
    2023-03-13T21:08:18.89+00:00

    Hey @MikeUrnun , I have question about passing the message from the Client function to the Orchestration. I am trying to reuse existing code, so I am trying to pass the message as a ServiceBusReceivedMessage object. When the object gets to the orchestration, the body is empty. I thought by passing the message as JSON would resolve it, but that do not work all the time. I think the reason my team used this object is because of the DeliveryCount property. Do you have any tips for passing the message to the orchestration and activity functions. Thanks. Please see my code snippet below.

    User's image


Your answer

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