I’m very happy to announce mock API and HTTP request/response overrides in the Azure functions portal. This feature allows a function proxy to return sample data through a mock API, enabling development against a functions API endpoint without writing any code. Request/response overrides allows API data to be transformed in flight, enabling new API schemas to be supported without modifying a backend API.
This functionality mirrors the existing request/response overrides and mocks previously only accessible through proxies.json
The following example shows a mock API that mimics the "hello serverless" example. The example returns a static response while also inserting text from a request parameter.
The next example performs a transform on requests as they're sent to jsonplaceholder.typicode.com. It changes all HTTP verbs to HTTP GET, and appends the request's verb to the response header.
We’ve seen a great response to the proxies preview and we're excited to continue releasing updates
- For more product news, follow @AzureFunctions.
- To report bugs or file feature requests, please open an issue on the Azure-Functions GitHub repo. Please include “Proxies” in the issue title.
- For technical questions, please post on the MSDN forums or StackOverflow. The entire Functions engineering team monitors these questions, so you’re sure to get an expert answer.