Azure App Service team released in the end of February/2017; a new feature called Azure functions proxies, which is currently in public preview.
With this, you can define an endpoint that serves as a reverse proxy to another API, another function app or anything else.
In this quick article, we'll learn how to create an Azure function proxy to serve as a reverse proxy to static files, which are hosted on Azure Blob Storage.
Creating a proxy
- Open Azure portal and navigate to New-> Compute -> Function app.
- Set the required fields to create your Function app.
- After the provisioning, navigate to your function app.
- In the left-hand navigation, select New proxy.
- Provide a name for your proxy.
- Configure the endpoint exposed on this function app by specifying the route template.
- Set the backend URL to your Azure Blob Storage endpoint.
It is thstatic, which is the name of my Storage Account and site is the name of my container.
- Click Create.
- Click Function app settings.
- Make sure that your proxy is enabled.
- Make sure that your proxy uses the latest version of proxy runtime version: latest (~0.1).
All you need to do is add some static files to your blob storage and test it.
Your proxy now exists as a new endpoint on your function app. Your customers don't know that Azure Blob Storage serves static files.