Cloud service · Azure · Updated

Azure Relay - Azure Relay is a managed connectivity service that connects applications across network boundaries without requiring inbound firewall ports on the network hosting the service.

In short

Azure Relay exposes application endpoints through a cloud-hosted relay while the backend service maintains outbound connections from its existing network. It provides HTTP and WebSocket-based Hybrid Connections for cross-platform applications and WCF Relay for existing Windows Communication Foundation services.

Cloud Services Hub →

8 key features of Azure Relay

01
Outbound-initiated backend connectivity

Listeners connect outward to Azure Relay, allowing backend services to remain behind NAT and firewalls without inbound port forwarding. Network teams must still permit the required outbound traffic and protocol behavior.

02
Cross-platform Hybrid Connections

Hybrid Connections use documented HTTP and WebSocket protocols for request-response communication and bidirectional streams. Use client libraries or a compatible protocol implementation for applications outside the WCF ecosystem.

03
WCF Relay bindings

Existing full .NET Framework WCF services can expose endpoints through relay-specific bindings. This preserves the WCF programming model while moving the externally reachable endpoint to Azure.

04
Scoped connection authorization

Shared Access Signature policies distinguish Send, Listen, and Manage rights. Hybrid Connections also support Microsoft Entra ID authorization, allowing applications to use identity-based access rather than shared keys.

05
Namespace IP filtering

Namespace-level firewall rules restrict access to specified IPv4 addresses and CIDR ranges. Account for the public egress addresses of both senders and listeners when configuring access.

06
Private endpoint access for senders

Azure Private Link enables sender clients in a virtual network to reach a Relay namespace through a private IP address. Configure private DNS and validate the listener connection path separately.

07
Multiple concurrent listeners

A relay entity supports up to 25 concurrent listeners, allowing multiple backend processes to accept connections. Design listeners so a new connection can be handled by any eligible instance, and implement recovery for interrupted sessions.

08
Application-scoped exposure

Relay exposes specific application endpoints rather than providing general network routing. This is useful when a cloud application needs access to one internal service but does not require a VPN connection to the surrounding network.

Where Azure Relay is used

  1. 01
    Cloud applications accessing internal APIs

    Run a listener near an internal inventory or order-processing service and let a cloud application call it through a Hybrid Connection. Apply application-level authorization before forwarding requests to the internal backend.

  2. 02
    Incremental modernization of WCF systems

    Expose an existing WCF service to cloud-hosted clients using WCF Relay while retaining its current hosting environment. Assess binding and contract compatibility before migrating individual endpoints to Hybrid Connections.

  3. 03
    App Service access to private TCP endpoints

    Use App Service Hybrid Connections and an on-premises Hybrid Connection Manager to reach a configured hostname and TCP port, such as an internal database endpoint. Confirm App Service operating-system and plan support before choosing this integration.

  4. 04
    Cross-network interactive connections

    Use a Hybrid Connection stream for a custom support tool or administrative application whose endpoints cannot accept inbound connections. Implement explicit user authorization, session auditing, and limits on what the listener can access.

  5. 05
    Endpoint-specific partner access

    Give a partner application permission to send to a dedicated relay entity rather than granting broad corporate network access. Keep the listener narrowly scoped and validate every operation against the partner's application identity.

How Azure Relay is priced

Hybrid Connections listener-based billing

Hybrid Connections pricing is based on listener units, with a data-transfer allowance and additional transfer charges under the applicable offer. Estimate listener usage and relayed traffic, and check current billing granularity and allowance rules before sizing costs.

WCF Relay hours and messages

WCF Relay is billed using relay hours and message volume rather than Service Bus messaging operations. WCF Relay is available only in Standard-tier namespaces; calculate costs using the applicable message-metering rules.

Associated network and integration charges

Applicable outbound data-transfer charges can apply in addition to Relay usage. Include separately billed resources such as private endpoints, App Service plans, monitoring ingestion, and listener hosting in the total architecture cost.

Services Azure Relay works with

A common architecture places a cloud application in Azure App Service and a listener or Hybrid Connection Manager inside the network hosting the backend. The cloud application connects through Relay, while the on-premises component maintains outbound connectivity and reaches the internal API or configured TCP endpoint. App Service Hybrid Connections provides a managed integration for supported configurations; custom Hybrid Connections listeners give application code direct control over HTTP handling or stream processing.

Identity and secret management should follow the connection roles. Use Microsoft Entra identities and narrowly scoped Relay roles where supported. If SAS credentials are required, store them in Key Vault, separate Send and Listen permissions, and plan credential renewal and rotation. Instrument both sides with Azure Monitor-compatible telemetry and propagate correlation identifiers so engineers can distinguish Relay connectivity failures from backend application errors.

For virtual-network-hosted senders, Private Link can provide private endpoint access to the Relay namespace. Treat private DNS, public access restrictions, and listener egress as separate configuration tasks. Managed integrations such as Azure Machine Learning Kubernetes connectivity may also require trusted-service access settings; follow the integration-specific network requirements rather than assuming a private endpoint alone permits every required connection.

App Service

App Service Hybrid Connections uses Azure Relay to connect a supported app to a configured TCP hostname and port through Hybrid Connection Manager. For example, a web application can connect to an on-premises SQL Server endpoint without opening an inbound firewall port. This is endpoint-specific TCP connectivity, not a VPN or general-purpose network route, and support depends on the App Service operating system and plan.

Microsoft Entra ID (formerly Azure AD)

Hybrid Connections can use Microsoft Entra access tokens and Azure role-based access control to authorize senders and listeners. For example, a cloud application can use a managed identity with the Azure Relay Sender role while a separate backend identity receives the Azure Relay Listener role. Keep Relay connection authorization separate from authorization for the business operations carried over the connection.

Azure Key Vault

Applications using SAS authentication can store Relay credentials in Key Vault instead of embedding them in source code or deployment templates. For example, a listener can retrieve a Listen-only credential at startup through an identity authorized to read that secret. Credential rotation must include reloading secrets and renewing or reconnecting affected Relay sessions.

Azure Monitor

Use Azure Monitor for available Relay metrics and instrument sender and listener applications with Application Insights or OpenTelemetry. For example, alert on connection failures and correlate a cloud HTTP request with the listener's downstream database call. Carry an application correlation identifier across the relay boundary rather than assuming transport connectivity provides end-to-end tracing.

Azure Private Link

A Relay namespace can be accessed through a private endpoint for supported sender connectivity from a virtual network. For example, a virtual-network-hosted sender can resolve the namespace to a private IP address and connect without using its public endpoint. Configure private DNS and public-network restrictions deliberately, and test listener egress separately because sender-side Private Link does not make all connection paths private.

Azure Machine Learning

Azure Machine Learning Kubernetes integration uses Azure Relay for communication between the managed service and an attached Kubernetes cluster. For example, a cluster in a restricted network can participate in the supported Azure Machine Learning connection architecture without exposing an inbound service endpoint. Where required by that architecture, configure Relay's trusted Microsoft services access setting alongside the namespace firewall.

API Management

Azure Relay recognizes API Management as a trusted Microsoft service. With the trusted-service firewall exception enabled on a Relay namespace, supported API Management requests can reach the namespace without matching its IP allowlist.

Azure Analysis Services

Azure Relay carries traffic between Azure Analysis Services and the on-premises data gateway. For example, a model can refresh from an on-premises SQL Server through a connection the gateway opens outbound.

Azure Arc

Azure Relay provides Hybrid Connections for Azure Arc features such as SSH access to Arc-enabled servers and Cluster Connect for Arc-enabled Kubernetes. The Arc hybrid connectivity resource provider can create the connections and supply connection information to the Arc service that uses them.

Azure Blob Storage

Azure Relay can archive namespace resource logs to an Azure Storage account through an Azure Monitor diagnostic setting. The logs are written to blob containers, where they can be retained for later investigation.

What is Azure Relay

2 min read

Azure Relay provides application-level connectivity between services in private networks and callers in Azure, other datacenters, or external networks. Instead of publishing a backend server directly to the internet, an application registers a listener with a Relay namespace through an outbound connection. A sender connects to the corresponding relay address, and Azure Relay forwards traffic between the sender and the listener. The backend can remain behind network address translation and a firewall without accepting unsolicited inbound connections.

A namespace is the management and addressing boundary for relay resources. Within it, engineers create Hybrid Connections or WCF Relay endpoints. Hybrid Connections use HTTP and WebSockets and support request-response exchanges and bidirectional streams. Applications can use supported client libraries or implement the documented protocol with a compatible WebSocket library. WCF Relay instead uses relay-specific WCF bindings and is intended for services built on the full .NET Framework and Windows Communication Foundation.

For a Hybrid Connection, the listener establishes a persistent outbound WebSocket control channel and authenticates with permission to listen. When a sender requests a connection, the listener accepts it and establishes the necessary communication path through Relay. For HTTP scenarios, senders can issue HTTPS requests to the relay endpoint and receive responses from the listener. Relay does not host the backend application: engineers must deploy, patch, monitor, and scale the listener process and any internal services it calls.

Authorization and network access are separate design concerns. Shared Access Signatures can grant scoped Send or Listen permissions, and Hybrid Connections also support Microsoft Entra ID-based authorization. Keep sender and listener permissions separate rather than distributing a namespace management key. Relay authorization controls access to the connection; the application must still enforce business-level authorization for operations and data. Sender authentication is enabled by default for Hybrid Connections and should remain enabled unless an intentionally public endpoint has appropriate application protections.

Namespace-level IPv4 firewall rules can restrict access to known source addresses. Private Link supports private endpoint access for sender clients; it should not be treated as proof that every listener path is private. Validate listener egress, DNS resolution, proxy behavior, and WebSocket support independently. Relay does not support virtual network service endpoints.

Operationally, treat Relay as a live transport rather than a durable message broker. If no listener is available or a connection fails, applications need appropriate timeouts, reconnection logic, and safe retry behavior. Maintain control-channel keepalives and renew expiring credentials. Multiple listeners can improve availability, subject to service quotas, but they do not make an interrupted application session durable. Use Service Bus queues or another persistent messaging system when requests must survive backend outages.

Azure architecture icons are the property of Microsoft. BlowStack is not affiliated with or endorsed by Microsoft.