Setting up Mock API with Azure Function Proxies

Recently, while I am working on a project with Node, Azure cloud, ARM Templates, and Azure DevOps, I need to test my front end application and realized the back end API is not ready yet. Then I want to add this exciting feature not to wait until the back end is available.

Let's get started

  1. Navigate to the Azure Management portal, http://portal.azure.com.

  2. Select + New, then type function into the search box on top. Select Function App from the results.

  3. Select the Create button on the Function App overview blade.

  4. On the Create Function App blade, specify the following configuration options:

    1. Name: unique value for the App name (ensure the green checkmark appears). Provide a name similar to pricingcalculatormockapi

    2. Specify the Resource Group "RETAIL-DEV-CUS-PRICINGCALCULATOR-RG"

    3. Select the App Service Plan Hosting Plan.

    4. Select the same location as your Resource Group.

    5. Leave the storage option as create new.

    6. Ensure Off is selected for Application Insights (we’ll add this later).

    7. select Create.

  5. After the function app is created navigate to function as shown below.

Azure Function Proxies

Functions Proxies are currently in public. With them, any function app can now define an endpoint that serves as a reverse proxy to another [API /webhook/function App/anything else]. Before being able to create new Azure Functions Proxies, you need to enable them. From the Function blade, select the Settings tab on the top of the screen, then click the On button, under the Proxie section.

Now let's create our first Function Proxy. Click on the "+" on the right of Proxies . Enter the following values.

Try It

I will cover the CI/CD for Azure function in the upcoming article. For now, we will launch the browser and type the URL. It will return the response.

For Detailed information or step by step please follow the referenced articles.

References

Last updated