Azure App Service (Web Apps) Hybrid Connection

This page shows how to write Terraform for App Service (Web Apps) Hybrid Connection and write them securely.

azurerm_app_service_hybrid_connection (Terraform)

The Hybrid Connection in App Service (Web Apps) can be configured in Terraform with the resource name azurerm_app_service_hybrid_connection. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

relays.tf#L10
resource "azurerm_app_service_hybrid_connection" "hc_app" {
  app_service_name = azurerm_app_service.example.name
  resource_group_name = "resource_group"
  relay_id = azurerm_relay_hybrid_connection.hc.id
  hostname = "hostname"
  port = 8080
main.tf#L1
resource "azurerm_app_service_hybrid_connection" "example" {
  app_service_name    = module.app_service.azurerm_app_service.example.name
  resource_group_name = module.resource_group.azurerm_resource_group.example.name
  relay_id            = azurerm_relay_hybrid_connection.example.id
  hostname            = var.hostname
  port                = var.port

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an App Service Hybrid Connection for an existing App Service, Relay and Service Bus.

Tips: Best Practices for The Other Azure App Service (Web Apps) Resources

In addition to the azurerm_app_service, Azure App Service (Web Apps) has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_app_service

Ensure your App Service is accessible via HTTPS only

It is better to configure the App Service to be accessible via HTTPS only. By default, both HTTP and HTTPS are available.

risk-label

azurerm_function_app

Ensure to enable authentication to prevent anonymous request being accepted

It is better to enable authentication to prevent anonymous requests and ensure all communications in the application are authenticated.

Review your Azure App Service (Web Apps) settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Azure Resource Manager Example

Azure Resource Manager code does not have the related resource.

Frequently asked questions

What is Azure App Service (Web Apps) Hybrid Connection?

Azure App Service (Web Apps) Hybrid Connection is a resource for App Service (Web Apps) of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure App Service (Web Apps) Hybrid Connection?

For Terraform, the dmaxim/wimc-net and VentsislavDinev/en_sample source code examples are useful. See the Terraform Example section for further details.