Diverting Requests to Slots

Pritam Ghosh 1 Reputation point
2022-05-20T09:10:28.637+00:00

My service contains 4 function apps. Init, Run, Track, DLQ.
After my code comes to Init Function app, we add our jobs to service queues and Run function takes up all the operations.
However, based on the requests in the Init app, we want to redirect our requests to some other slots, master or stage, and Run api will take up from it.

Is there any way to do that? Our code is in Python, our requests should be consistent, not highly available.

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

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,511 Reputation points
    2022-05-20T11:48:37.927+00:00

    Hi @Pritam Ghosh ,

    Thanks for reaching out to Q&A forum.

    From a high level, I can understand that you are trying to send requests from one function to another based on some logic. Ideally, in python, requests are sent using the requests module. You can use the same request module in the "Init" function to send requests to other functions and its slots. The function url would change for the production slot and testing/staging slot of the function. So you can send requests to appropriate urls based on your logic. This would be a straightforward and fairly simpler approach. Please note that, function app deployment slot can be considered as a seperate app running parallel with the main/production app with different set of workers.

    You can also set the traffic percentage of the requests sharing at the slot level.

    204123-image.png

    I hope this helps! Feel free to reach out to me if you have any queries or concerns.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    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.