azurerm_app_service_hybrid_connection

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.

resource "azurerm_resource_group" "example" {
  name     = "exampleResourceGroup1"
  location = "West Europe"
}

resource "azurerm_app_service_plan" "example" {
  name                = "exampleAppServicePlan1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku {
    tier = "Standard"
    size = "S1"
  }
}

resource "azurerm_app_service" "example" {
  name                = "exampleAppService1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id
}

resource "azurerm_relay_namespace" "example" {
  name                = "exampleRN1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku_name = "Standard"
}

resource "azurerm_relay_hybrid_connection" "example" {
  name                 = "exampleRHC1"
  resource_group_name  = azurerm_resource_group.example.name
  relay_namespace_name = azurerm_relay_namespace.example.name
  user_metadata        = "examplemetadata"
}

resource "azurerm_app_service_hybrid_connection" "example" {
  app_service_name    = azurerm_app_service.example.name
  resource_group_name = azurerm_resource_group.example.name
  relay_id            = azurerm_relay_hybrid_connection.example.id
  hostname            = "testhostname.example"
  port                = 8080
  send_key_name       = "exampleSharedAccessKey"
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

App Service Hybrid Connections can be imported using the resource id, e.g.

terraform import azurerm_app_service_hybrid_connection.example /subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/exampleResourceGroup1/providers/Microsoft.Web/sites/exampleAppService1/hybridConnectionNamespaces/exampleRN1/relays/exampleRHC1