We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
Manages an App Service Hybrid Connection for an existing App Service, Relay and Service Bus.
Example Usage
This example provisions an App Service, a Relay Hybrid Connection, and a Service Bus using their outputs to create the App Service Hybrid Connection.
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var examplePlan = new Azure.AppService.Plan("examplePlan", new Azure.AppService.PlanArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = new Azure.AppService.Inputs.PlanSkuArgs
{
Tier = "Standard",
Size = "S1",
},
});
var exampleAppService = new Azure.AppService.AppService("exampleAppService", new Azure.AppService.AppServiceArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
AppServicePlanId = examplePlan.Id,
});
var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new Azure.Relay.NamespaceArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
SkuName = "Standard",
});
var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new Azure.Relay.HybridConnectionArgs
{
ResourceGroupName = exampleResourceGroup.Name,
RelayNamespaceName = exampleNamespace.Name,
UserMetadata = "examplemetadata",
});
var exampleAppservice_hybridConnectionHybridConnection = new Azure.AppService.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", new Azure.AppService.HybridConnectionArgs
{
AppServiceName = exampleAppService.Name,
ResourceGroupName = exampleResourceGroup.Name,
RelayId = exampleHybridConnection.Id,
Hostname = "testhostname.example",
Port = 8080,
SendKeyName = "exampleSharedAccessKey",
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/appservice"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/relay"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: &appservice.PlanSkuArgs{
Tier: pulumi.String("Standard"),
Size: pulumi.String("S1"),
},
})
if err != nil {
return err
}
exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
AppServicePlanId: examplePlan.ID(),
})
if err != nil {
return err
}
exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
SkuName: pulumi.String("Standard"),
})
if err != nil {
return err
}
exampleHybridConnection, err := relay.NewHybridConnection(ctx, "exampleHybridConnection", &relay.HybridConnectionArgs{
ResourceGroupName: exampleResourceGroup.Name,
RelayNamespaceName: exampleNamespace.Name,
UserMetadata: pulumi.String("examplemetadata"),
})
if err != nil {
return err
}
_, err = appservice.NewHybridConnection(ctx, "exampleAppservice/hybridConnectionHybridConnection", &appservice.HybridConnectionArgs{
AppServiceName: exampleAppService.Name,
ResourceGroupName: exampleResourceGroup.Name,
RelayId: exampleHybridConnection.ID(),
Hostname: pulumi.String("testhostname.example"),
Port: pulumi.Int(8080),
SendKeyName: pulumi.String("exampleSharedAccessKey"),
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const examplePlan = new azure.appservice.Plan("examplePlan", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: {
tier: "Standard",
size: "S1",
},
});
const exampleAppService = new azure.appservice.AppService("exampleAppService", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
appServicePlanId: examplePlan.id,
});
const exampleNamespace = new azure.relay.Namespace("exampleNamespace", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
skuName: "Standard",
});
const exampleHybridConnection = new azure.relay.HybridConnection("exampleHybridConnection", {
resourceGroupName: exampleResourceGroup.name,
relayNamespaceName: exampleNamespace.name,
userMetadata: "examplemetadata",
});
const exampleAppservice_hybridConnectionHybridConnection = new azure.appservice.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", {
appServiceName: exampleAppService.name,
resourceGroupName: exampleResourceGroup.name,
relayId: exampleHybridConnection.id,
hostname: "testhostname.example",
port: 8080,
sendKeyName: "exampleSharedAccessKey",
});
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_plan = azure.appservice.Plan("examplePlan",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku=azure.appservice.PlanSkuArgs(
tier="Standard",
size="S1",
))
example_app_service = azure.appservice.AppService("exampleAppService",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
app_service_plan_id=example_plan.id)
example_namespace = azure.relay.Namespace("exampleNamespace",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku_name="Standard")
example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection",
resource_group_name=example_resource_group.name,
relay_namespace_name=example_namespace.name,
user_metadata="examplemetadata")
example_appservice_hybrid_connection_hybrid_connection = azure.appservice.HybridConnection("exampleAppservice/hybridConnectionHybridConnection",
app_service_name=example_app_service.name,
resource_group_name=example_resource_group.name,
relay_id=example_hybrid_connection.id,
hostname="testhostname.example",
port=8080,
send_key_name="exampleSharedAccessKey")
Example coming soon!
Create HybridConnection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HybridConnection(name: string, args: HybridConnectionArgs, opts?: CustomResourceOptions);@overload
def HybridConnection(resource_name: str,
args: HybridConnectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HybridConnection(resource_name: str,
opts: Optional[ResourceOptions] = None,
app_service_name: Optional[str] = None,
hostname: Optional[str] = None,
port: Optional[int] = None,
relay_id: Optional[str] = None,
resource_group_name: Optional[str] = None,
send_key_name: Optional[str] = None)func NewHybridConnection(ctx *Context, name string, args HybridConnectionArgs, opts ...ResourceOption) (*HybridConnection, error)public HybridConnection(string name, HybridConnectionArgs args, CustomResourceOptions? opts = null)
public HybridConnection(String name, HybridConnectionArgs args)
public HybridConnection(String name, HybridConnectionArgs args, CustomResourceOptions options)
type: azure:appservice:HybridConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args HybridConnectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args HybridConnectionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args HybridConnectionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HybridConnectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HybridConnectionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var hybridConnectionResource = new Azure.AppService.HybridConnection("hybridConnectionResource", new()
{
AppServiceName = "string",
Hostname = "string",
Port = 0,
RelayId = "string",
ResourceGroupName = "string",
SendKeyName = "string",
});
example, err := appservice.NewHybridConnection(ctx, "hybridConnectionResource", &appservice.HybridConnectionArgs{
AppServiceName: pulumi.String("string"),
Hostname: pulumi.String("string"),
Port: pulumi.Int(0),
RelayId: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
SendKeyName: pulumi.String("string"),
})
var hybridConnectionResource = new com.pulumi.azure.appservice.HybridConnection("hybridConnectionResource", com.pulumi.azure.appservice.HybridConnectionArgs.builder()
.appServiceName("string")
.hostname("string")
.port(0)
.relayId("string")
.resourceGroupName("string")
.sendKeyName("string")
.build());
hybrid_connection_resource = azure.appservice.HybridConnection("hybridConnectionResource",
app_service_name="string",
hostname="string",
port=0,
relay_id="string",
resource_group_name="string",
send_key_name="string")
const hybridConnectionResource = new azure.appservice.HybridConnection("hybridConnectionResource", {
appServiceName: "string",
hostname: "string",
port: 0,
relayId: "string",
resourceGroupName: "string",
sendKeyName: "string",
});
type: azure:appservice:HybridConnection
properties:
appServiceName: string
hostname: string
port: 0
relayId: string
resourceGroupName: string
sendKeyName: string
HybridConnection Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The HybridConnection resource accepts the following input properties:
- App
Service stringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- Hostname string
- The hostname of the endpoint.
- Port int
- The port of the endpoint.
- Relay
Id string - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- Send
Key stringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey.
- App
Service stringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- Hostname string
- The hostname of the endpoint.
- Port int
- The port of the endpoint.
- Relay
Id string - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- Send
Key stringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey.
- app
Service StringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname String
- The hostname of the endpoint.
- port Integer
- The port of the endpoint.
- relay
Id String - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send
Key StringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey.
- app
Service stringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname string
- The hostname of the endpoint.
- port number
- The port of the endpoint.
- relay
Id string - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send
Key stringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey.
- app_
service_ strname - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname str
- The hostname of the endpoint.
- port int
- The port of the endpoint.
- relay_
id str - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send_
key_ strname - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey.
- app
Service StringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname String
- The hostname of the endpoint.
- port Number
- The port of the endpoint.
- relay
Id String - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send
Key StringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey.
Outputs
All input properties are implicitly available as output properties. Additionally, the HybridConnection resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Namespace
Name string - The name of the Relay Namespace.
- Relay
Name string - Send
Key stringValue - The value of the Service Bus Primary Access key.
- Service
Bus stringNamespace - The name of the Service Bus namespace.
- Service
Bus stringSuffix - The suffix for the service bus endpoint.
- Id string
- The provider-assigned unique ID for this managed resource.
- Namespace
Name string - The name of the Relay Namespace.
- Relay
Name string - Send
Key stringValue - The value of the Service Bus Primary Access key.
- Service
Bus stringNamespace - The name of the Service Bus namespace.
- Service
Bus stringSuffix - The suffix for the service bus endpoint.
- id String
- The provider-assigned unique ID for this managed resource.
- namespace
Name String - The name of the Relay Namespace.
- relay
Name String - send
Key StringValue - The value of the Service Bus Primary Access key.
- service
Bus StringNamespace - The name of the Service Bus namespace.
- service
Bus StringSuffix - The suffix for the service bus endpoint.
- id string
- The provider-assigned unique ID for this managed resource.
- namespace
Name string - The name of the Relay Namespace.
- relay
Name string - send
Key stringValue - The value of the Service Bus Primary Access key.
- service
Bus stringNamespace - The name of the Service Bus namespace.
- service
Bus stringSuffix - The suffix for the service bus endpoint.
- id str
- The provider-assigned unique ID for this managed resource.
- namespace_
name str - The name of the Relay Namespace.
- relay_
name str - send_
key_ strvalue - The value of the Service Bus Primary Access key.
- service_
bus_ strnamespace - The name of the Service Bus namespace.
- service_
bus_ strsuffix - The suffix for the service bus endpoint.
- id String
- The provider-assigned unique ID for this managed resource.
- namespace
Name String - The name of the Relay Namespace.
- relay
Name String - send
Key StringValue - The value of the Service Bus Primary Access key.
- service
Bus StringNamespace - The name of the Service Bus namespace.
- service
Bus StringSuffix - The suffix for the service bus endpoint.
Look up Existing HybridConnection Resource
Get an existing HybridConnection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: HybridConnectionState, opts?: CustomResourceOptions): HybridConnection@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
app_service_name: Optional[str] = None,
hostname: Optional[str] = None,
namespace_name: Optional[str] = None,
port: Optional[int] = None,
relay_id: Optional[str] = None,
relay_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
send_key_name: Optional[str] = None,
send_key_value: Optional[str] = None,
service_bus_namespace: Optional[str] = None,
service_bus_suffix: Optional[str] = None) -> HybridConnectionfunc GetHybridConnection(ctx *Context, name string, id IDInput, state *HybridConnectionState, opts ...ResourceOption) (*HybridConnection, error)public static HybridConnection Get(string name, Input<string> id, HybridConnectionState? state, CustomResourceOptions? opts = null)public static HybridConnection get(String name, Output<String> id, HybridConnectionState state, CustomResourceOptions options)resources: _: type: azure:appservice:HybridConnection get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- App
Service stringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- Hostname string
- The hostname of the endpoint.
- Namespace
Name string - The name of the Relay Namespace.
- Port int
- The port of the endpoint.
- Relay
Id string - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- Relay
Name string - Resource
Group stringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- Send
Key stringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey. - Send
Key stringValue - The value of the Service Bus Primary Access key.
- Service
Bus stringNamespace - The name of the Service Bus namespace.
- Service
Bus stringSuffix - The suffix for the service bus endpoint.
- App
Service stringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- Hostname string
- The hostname of the endpoint.
- Namespace
Name string - The name of the Relay Namespace.
- Port int
- The port of the endpoint.
- Relay
Id string - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- Relay
Name string - Resource
Group stringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- Send
Key stringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey. - Send
Key stringValue - The value of the Service Bus Primary Access key.
- Service
Bus stringNamespace - The name of the Service Bus namespace.
- Service
Bus stringSuffix - The suffix for the service bus endpoint.
- app
Service StringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname String
- The hostname of the endpoint.
- namespace
Name String - The name of the Relay Namespace.
- port Integer
- The port of the endpoint.
- relay
Id String - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- relay
Name String - resource
Group StringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send
Key StringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey. - send
Key StringValue - The value of the Service Bus Primary Access key.
- service
Bus StringNamespace - The name of the Service Bus namespace.
- service
Bus StringSuffix - The suffix for the service bus endpoint.
- app
Service stringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname string
- The hostname of the endpoint.
- namespace
Name string - The name of the Relay Namespace.
- port number
- The port of the endpoint.
- relay
Id string - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- relay
Name string - resource
Group stringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send
Key stringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey. - send
Key stringValue - The value of the Service Bus Primary Access key.
- service
Bus stringNamespace - The name of the Service Bus namespace.
- service
Bus stringSuffix - The suffix for the service bus endpoint.
- app_
service_ strname - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname str
- The hostname of the endpoint.
- namespace_
name str - The name of the Relay Namespace.
- port int
- The port of the endpoint.
- relay_
id str - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- relay_
name str - resource_
group_ strname - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send_
key_ strname - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey. - send_
key_ strvalue - The value of the Service Bus Primary Access key.
- service_
bus_ strnamespace - The name of the Service Bus namespace.
- service_
bus_ strsuffix - The suffix for the service bus endpoint.
- app
Service StringName - Specifies the name of the App Service. Changing this forces a new resource to be created.
- hostname String
- The hostname of the endpoint.
- namespace
Name String - The name of the Relay Namespace.
- port Number
- The port of the endpoint.
- relay
Id String - The ID of the Service Bus Relay. Changing this forces a new resource to be created.
- relay
Name String - resource
Group StringName - The name of the resource group in which to create the App Service. Changing this forces a new resource to be created.
- send
Key StringName - The name of the Service Bus key which has Send permissions. Defaults to
RootManageSharedAccessKey. - send
Key StringValue - The value of the Service Bus Primary Access key.
- service
Bus StringNamespace - The name of the Service Bus namespace.
- service
Bus StringSuffix - The suffix for the service bus endpoint.
Import
App Service Hybrid Connections can be imported using the resource id, e.g.
$ pulumi import azure:appservice/hybridConnection:HybridConnection example /subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/exampleResourceGroup1/providers/Microsoft.Web/sites/exampleAppService1/hybridConnectionNamespaces/exampleRN1/relays/exampleRHC1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
