Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Function Proxies

CI

Small Azure Functions app that forwards HTTP requests to a destination URL.

This project exists to give internal systems one controlled proxy endpoint, while keeping deployment simple (Flex Consumption + Bicep).

What it does

  • Exposes one function route: GET|PUT|POST|DELETE|HEAD|OPTIONS|TRACE|PATCH /api/proxy
  • Reads destination URL from:
    1. header x-proxy-url-b64 (base64-encoded absolute URL)
    2. header x-proxy-url
    3. query string url
  • Forwards request body + headers to destination
  • Streams upstream response back to caller

Important security note

This is an open forward proxy by design (destination is caller-controlled).

Use it only in trusted/internal scenarios and protect access with Function keys, network controls, and monitoring.

Prerequisites

  • .NET SDK 10
  • Azure Functions Core Tools v4
  • Azure CLI (for cloud deploy)
  • Azurite (for local storage emulation)

Run locally

From repo root:

dotnet restore
dotnet build

Start the function app:

cd src\AzureFunctionProxies.Function
func start

By default local endpoint is:

http://localhost:7071/api/proxy

Usage examples

1) URL via base64 header

curl -X GET "http://localhost:7071/api/proxy" \
  -H "x-proxy-url-b64: aHR0cHM6Ly9naXRodWIuY29tL1JNYXJpb3dza2kvQXp1cmVGdW5jdGlvblByb3hpZXM="

2) URL via header

curl -X GET "http://localhost:7071/api/proxy" \
  -H "x-proxy-url: https://github.com/RMariowski/AzureFunctionProxies"

3) URL via query string

curl "http://localhost:7071/api/proxy?url=https://github.com/RMariowski/AzureFunctionProxies"

Calling deployed function

When running in Azure, include function key:

  • Header: x-functions-key: <key>
  • or query string: ?code=<key>

Example:

curl "https://<app>.azurewebsites.net/api/proxy?url=https://github.com/RMariowski/AzureFunctionProxies" \
  -H "x-functions-key: <function-key>"

Deploy to Azure

Infrastructure is in deployment/azure-function-proxy.bicep.

Quick deploy script (multi-region capable):

cd deployment
.\deploy.ps1 -Locations eastus,westeurope -BaseName afp -ResourceGroupPrefix rg

Optional subscription override:

.\deploy.ps1 -SubscriptionId <subscription-id> -Locations eastus

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages