Skip to content

azurermFunctionAppHybridConnection

Manages a Function App Hybrid Connection.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-rg",
  }
);
const azurermServicePlanExample = new azurerm.servicePlan.ServicePlan(
  this,
  "example_2",
  {
    location: azurermResourceGroupExample.location,
    name: "example-plan",
    os_type: "Windows",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "S1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermServicePlanExample.overrideLogicalId("example");
const azurermStorageAccountExample = new azurerm.storageAccount.StorageAccount(
  this,
  "example_3",
  {
    account_replication_type: "GRS",
    account_tier: "Standard",
    location: azurermResourceGroupExample.location,
    name: "storageaccountname",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStorageAccountExample.overrideLogicalId("example");
const azurermWindowsFunctionAppExample =
  new azurerm.windowsFunctionApp.WindowsFunctionApp(this, "example_4", {
    location: azurermResourceGroupExample.location,
    name: "example-function-app",
    resource_group_name: azurermResourceGroupExample.name,
    service_plan_id: azurermServicePlanExample.id,
    site_config: [{}],
    storage_account_access_key: azurermStorageAccountExample.primaryAccessKey,
    storage_account_name: azurermStorageAccountExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermWindowsFunctionAppExample.overrideLogicalId("example");
const azurermWindowsWebAppExample = new azurerm.windowsWebApp.WindowsWebApp(
  this,
  "example_5",
  {
    location: azurermResourceGroupExample.location,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
    service_plan_id: azurermServicePlanExample.id,
    site_config: [{}],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermWindowsWebAppExample.overrideLogicalId("example");
const azurermRelayNamespaceExample = new azurerm.relayNamespace.RelayNamespace(
  this,
  "example_6",
  {
    location: azurermResourceGroupExample.location,
    name: "example-relay",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "Standard",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermRelayNamespaceExample.overrideLogicalId("example");
const azurermRelayHybridConnectionExample =
  new azurerm.relayHybridConnection.RelayHybridConnection(this, "example_7", {
    name: "examplerhc1",
    relay_namespace_name: azurermRelayNamespaceExample.name,
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermRelayHybridConnectionExample.overrideLogicalId("example");
const azurermFunctionAppHybridConnectionExample =
  new azurerm.functionAppHybridConnection.FunctionAppHybridConnection(
    this,
    "example_8",
    {
      function_app_id: azurermWindowsWebAppExample.id,
      hostname: "myhostname.example",
      port: 8081,
      relay_id: azurermRelayHybridConnectionExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermFunctionAppHybridConnectionExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • functionAppId - (Required) The ID of the Function App for this Hybrid Connection. Changing this forces a new resource to be created.

  • relayId - (Required) The ID of the Relay Hybrid Connection to use. Changing this forces a new resource to be created.

  • hostname - (Required) The hostname of the endpoint.

  • port - (Required) The port to use for the endpoint


  • sendKeyName - (Optional) The name of the Relay key with send permission to use. Defaults to rootManageSharedAccessKey

Attributes Reference

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

  • id - The ID of the Function App Hybrid Connection

  • namespaceName - The name of the Relay Namespace.

  • relayName - The name of the Relay in use.

  • sendKeyValue - The Primary Access Key for the sendKeyName

  • serviceBusNamespace - The Service Bus Namespace.

  • serviceBusSuffix - The suffix for the endpoint.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Function App Hybrid Connection.
  • update - (Defaults to 30 minutes) Used when updating the Function App Hybrid Connection.
  • read - (Defaults to 5 minutes) Used when retrieving the Function App Hybrid Connection.
  • delete - (Defaults to 5 minutes) Used when deleting the Function App Hybrid Connection.

Import

a Function App Hybrid Connection can be imported using the resourceId, e.g.

terraform import azurerm_function_app_hybrid_connection.example "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/hybridConnectionNamespaces/hybridConnectionNamespace1/relays/relay1"