I wanted to use Azure Functions to create stub response, I am stuck with one scenario where I want to update existing response for same input parameter and call get method for same input, and check response stored in downstream process.
Currently using getsandbox stub to test this scenario, where I can create state and delete state,"state.users.push(req.body);"
Wondering if Azure functions can provide similar functionality. I am able to create simple azure proxy to get response. Looking if can store json response and then get call to same input.
Azure Functions are stateless by definition (unless you're talking Durable Functions), so you'll have to store your data outside of your code & instance to have it available across requests. The easiest way would be to use either Azure Table Storage as a database or putting your data into a JSON file inside Azure Blob Storage.
Since your Azure Function already comes with a Storage Account it's not so difficult to get a basic Create-Read-Update-Delete (CRUD) scenario up and running.
You can find a tutorial + full source code (GitHub) in this article I wrote.