Azure Messaging Hybrid Connection
This page shows how to write Terraform and Azure Resource Manager for Messaging Hybrid Connection and write them securely.
azurerm_relay_hybrid_connection (Terraform)
The Hybrid Connection in Messaging can be configured in Terraform with the resource name azurerm_relay_hybrid_connection
. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_relay_hybrid_connection" "hc" {
name = "name"
resource_group_name = "resource_group"
relay_namespace_name = azurerm_relay_namespace.example.name
user_metadata = "metadata"
}
resource "azurerm_relay_hybrid_connection" "this" {
name = var.name
relay_namespace_name = var.relay_namespace_name
requires_client_authorization = var.requires_client_authorization
resource_group_name = var.resource_group_name
user_metadata = var.user_metadata
resource "azurerm_relay_hybrid_connection" "this" {
name = var.name
relay_namespace_name = var.relay_namespace_name
requires_client_authorization = var.requires_client_authorization
resource_group_name = var.resource_group_name
user_metadata = var.user_metadata
Parameters
-
id
optional computed - string -
name
required - string -
relay_namespace_name
required - string -
requires_client_authorization
optional - bool -
resource_group_name
required - string -
user_metadata
optional - string -
timeouts
single block
Explanation in Terraform Registry
Manages an Azure Relay Hybrid Connection.
Microsoft.Relay/namespaces/hybridConnections (Azure Resource Manager)
The namespaces/hybridConnections in Microsoft.Relay can be configured in Azure Resource Manager with the resource name Microsoft.Relay/namespaces/hybridConnections
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Relay/namespaces/hybridConnections",
"name": "[concat(parameters('relay_namespace'), '/a1')]",
"apiVersion": "[variables('apiVersion')]",
"properties": {
"requiresClientAuthorization": true
},
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"AppServiceName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"connectionName": {
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resource_prefix": {
"type": "Microsoft.Relay/namespaces/hybridConnections",
"apiVersion": "2017-04-01",
"name": "hybridConnectiontiontest",
"properties": {
"requiresClientAuthorization": true,
"userMetadata": "usermetadata is a placeholder to store user-defined string data for the HybridConnection endpoint.e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored."
"type": "Microsoft.Relay/namespaces/hybridConnections",
"apiVersion": "2017-04-01",
"properties": {
"requiresClientAuthorization": "boolean",
"userMetadata": "string"
},
"type": "Microsoft.Relay/namespaces/hybridConnections",
"apiVersion": "2017-04-01",
"name": "hybridConnectiontiontest",
"properties": {
"requiresClientAuthorization": true,
"userMetadata": "usermetadata is a placeholder to store user-defined string data for the HybridConnection endpoint.e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored."
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"namespaces_HybridConnectorNameSpace_name": {
"type": "Microsoft.Relay/namespaces/hybridConnections",
"name": "[concat(parameters('serviceBusName'), '/', parameters('hybridConnectionName'))]",
"properties": {
"requiresClientAuthorization": true,
"userMetadata": "[concat('[{\"key\":\"endpoint\",\"value\":\"', parameters('listenerHostname'), ':', parameters('listenerHostPort'), '\"}]')]"
}
"type": "Microsoft.Relay/namespaces/hybridConnections",
"name": "[concat(parameters('serviceBusName'), '/', parameters('hybridConnectionEndpoints')[copyIndex()].name)]",
"copy": {
"name": "hybridConnectionEndpoints",
"count": "[length(parameters('hybridConnectionEndpoints'))]"
},
Parameters
apiVersion
required - stringname
required - stringThe hybrid connection name.
properties
requiredrequiresClientAuthorization
optional - booleanReturns true if client authorization is needed for this hybrid connection; otherwise, false.
userMetadata
optional - stringThe usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, user-defined configuration settings can be stored.
type
required - string
Frequently asked questions
What is Azure Messaging Hybrid Connection?
Azure Messaging Hybrid Connection is a resource for Messaging of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Messaging Hybrid Connection?
For Terraform, the dmaxim/wimc-net, kevinhead/azurerm and niveklabs/azurerm source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the Azure/azure-relay-bridge, Lagler-Gruener/AzureTemplates and caseywatson/AutomatedHcmSetup source code examples are useful. See the Azure Resource Manager Example section for further details.