Skip to main content

Components and Sizing Recommendations

Prerequisites

Ensure the following tools and resources are installed and available:

Create a Portkey Account

  • Go to the Portkey website.
  • Sign up for a Portkey account.
  • Once logged in, locate and save your Organisation ID for future reference. It can be found in the browser URL: https://app.portkey.ai/organisation/<organisation_id>/
  • Contact the Portkey AI team and provide your Organisation ID and the email address used during signup.
  • The Portkey team will share the following information with you:
    • Docker credentials for the Gateway images (username and password).
    • License: Client Auth Key.

Setup Project Environment

1. Prepare Azure Resources

2. Create Terraform Configuration Files

Create a new directory for your deployment:

3. Create Module Configuration

Create a main.tf file:

Advanced Configuration

MCP Gateway (Optional)

By default, only the AI Gateway is enabled. To enable the MCP Gateway, update your terraform.tfvars: MCP Only:
Gateway + MCP (separate apps):
Note: When server_mode = "all" with Application Gateway, you must configure either host-based.

Auto-Scaling Configuration

Control how replicas scale based on different metrics. CPU-based scaling (default):
HTTP-based scaling:
Memory-based scaling:

Network Configuration with VNet

Deploy Gateway within a VNet: Create new VNet:
Use existing VNet and subnets:

Application Gateway Ingress

Deploy Azure Application Gateway with WAF, SSL termination, and zone redundancy: Basic Configuration:
Host-based Routing:
Configure DNS:
SSL Certificate:
Private Application Gateway:

Azure Managed Redis

Use Azure Cache for Redis instead of the built-in container:
Update secrets in main.tf:
Note: The values above should be Key Vault secret names, not the actual secret values.

Storage Configuration

Using Auto-Created Storage (Default): No configuration needed. Terraform automatically creates a Storage Account and container. Optional: Customize container name:
Using Existing Storage Account:

Integrating Gateway with Control Plane

Outbound Connectivity (Data Plane to Control Plane) Portkey supports the following methods for integrating the Data Plane with the Control Plane:
  • Azure Private Link
  • Over the Internet
Connect your Gateway to the Portkey Control Plane privately over Azure Private Link. Prerequisites: VNET deployment (network_mode = "new" or "existing"). Steps:
  1. Request whitelisting — Share your Azure Subscription ID with the Portkey team. Wait for confirmation that your subscription is whitelisted.
  2. Deploy Private Endpoint — Enable outbound Private Link in your Terraform configuration:
Add to your terraform.tfvars:
Deploy:
This creates:
  • Private Endpoint in your VNET
  • Private DNS Zone (privatelink-az.portkey.ai)
  • DNS A record (azure-cp) pointing to the Private Endpoint IP
  • VNET link for DNS resolution
  1. Request connection approval — Get the Private Endpoint resource ID and share it with the Portkey team:
Share the output with Portkey. Wait for them to approve the connection.
  1. Verify approval (optional):
  1. Configure Private Endpoint URLs — Update your Gateway configuration to use the private Control Plane endpoint.
Update in main.tf:
  1. Redeploy — Apply the configuration changes:

Over the Internet

Ensure Gateway has access to the following endpoints over the internet:
  • https://api.portkey.ai
  • https://albus.portkey.ai
No additional configuration needed if your network allows outbound internet access.

Inbound Connectivity (Control Plane to Data Plane)

  • Azure Private Link
  • IP Whitelisting
Allow Portkey Control Plane to connect to your Gateway privately via Azure Private Endpoint. Prerequisites: Gateway deployed and running. Steps:
  1. Share connection details — Get your Gateway connection information and share with the Portkey team:
Share both outputs with Portkey:
  • ACA Environment Resource ID (e.g., /subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.App/managedEnvironments/xxx)
  • Gateway FQDN (e.g., gateway.<env-domain>.<region>.azurecontainerapps.io)
  1. Wait for connection request — Portkey creates a Private Endpoint in their subscription targeting your ACA Environment. A connection request will appear in your Azure subscription.
  2. Check for pending connections:
  1. Approve the connection:
Or approve via Azure Portal: Container Apps Environment → Networking → Private endpoint connections → approve the pending request.

IP Whitelisting

Allows Control Plane to access the Data Plane over the internet by restricting inbound traffic to specific IP addresses. This method requires the Data Plane to have a publicly accessible endpoint. To whitelist, add an inbound rule to the Azure NSG or Firewall allowing connections from the Portkey Control Plane’s IPs (54.81.226.149, 34.200.113.35, 44.221.117.129) on the required port. To integrate the Control Plane with the Data Plane, contact the Portkey team and provide the Public Endpoint of the Data Plane.

Verifying Gateway Integration with the Control Plane

  • Send a test request to Gateway using curl.
  • Go to Portkey website -> Logs.
  • Verify that the test request appears in the logs and that you can view its full details by selecting the log entry.

Uninstalling Portkey Gateway

Example Configurations

Simple Deployment (No VNet)

This example shows a basic deployment with built-in Redis and auto-created storage: terraform.tfvars:

Deployment with VNet and Application Gateway

This example shows a deployment with VNet, Application Gateway with WAF, and managed services: terraform.tfvars:

Gateway + MCP Deployment

This example shows how to deploy both AI Gateway and MCP Gateway: terraform.tfvars:
Last modified on April 17, 2026