Open cacizi41 opened 3 years ago
Update: If trying to add hc thru azure subscription login on HCM , it turns out that endpoint needs to be populated in user_metadata filed to resolve the "no endpoint configured" error . I would hope for a more clear documentation on that filed. If trying to add hc manually on HCM, the connection string of terraform generated hc is still missing the entitypath part which makes the connection string incomplete with only relay level info. Not sure where the responsibility lays in this case.
I can confirm this both when using azurerm_app_service_hybrid_connection
and also if you try to describe the app service hybrid connection using ARM combined with azurerm_resource_group_template_deployment
results in a connectionstring that is missing EntityPath
from the connectionstring. I am not able to add it manually in the Hybrid Connection Manager even though I have set the user_metadata on the hybrid connection on the relay.
I can confirm this both when using
azurerm_app_service_hybrid_connection
and also if you try to describe the app service hybrid connection using ARM combined withazurerm_resource_group_template_deployment
results in a connectionstring that is missingEntityPath
from the connectionstring. I am not able to add it manually in the Hybrid Connection Manager even though I have set the user_metadata on the hybrid connection on the relay.
I have the exact same issue
Can confirm being still broken in provider version 2.70.0.
This is still broken in provider 3.46.0, how can we get some movement on this issue?
I've managed to get this working, here is some example TF code
resource "azurerm_resource_group" "example" {
name = "ta-hc-test"
location = "West Europe"
}
resource "azurerm_service_plan" "example" {
name = "example-plan-tatest"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
os_type = "Linux"
sku_name = "B2"
}
resource "azurerm_relay_namespace" "example" {
name = "example-relay-tatest"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
sku_name = "Standard"
}
resource "azurerm_relay_namespace_authorization_rule" "example" {
name = "RootManageSharedAccessKey"
resource_group_name = azurerm_resource_group.example.name
namespace_name = azurerm_relay_namespace.example.name
listen = true
send = true
manage = true
}
resource "azurerm_relay_hybrid_connection" "example" {
name = "examplerhc1-tatest"
resource_group_name = azurerm_resource_group.example.name
relay_namespace_name = azurerm_relay_namespace.example.name
requires_client_authorization = true
user_metadata = "[{\"key\":\"endpoint\",\"value\":\"sqlserver:1433\"}]"
}
resource "azurerm_windows_web_app" "example" {
name = "example-web-app-tatest"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
service_plan_id = azurerm_service_plan.example.id
site_config {}
}
resource "azurerm_web_app_hybrid_connection" "example" {
web_app_id = azurerm_windows_web_app.example.id
relay_id = azurerm_relay_hybrid_connection.example.id
hostname = "sqlserver"
port = 1433
}
resource "azurerm_relay_hybrid_connection_authorization_rule" "example-listen" {
name = "defaultListener"
resource_group_name = azurerm_resource_group.example.name
hybrid_connection_name = azurerm_relay_hybrid_connection.example.name
namespace_name = azurerm_relay_namespace.example.name
listen = true
send = false
manage = false
}
resource "azurerm_relay_hybrid_connection_authorization_rule" "example-send" {
name = "defaultSender"
resource_group_name = azurerm_resource_group.example.name
hybrid_connection_name = azurerm_relay_hybrid_connection.example.name
namespace_name = azurerm_relay_namespace.example.name
listen = false
send = true
manage = false
}
Community Note
Terraform (and AzureRM Provider) Version
azurerm_app_service_hybrid_connection
Terraform Configuration Files
Exactly followed the template of azurerm_app_service_hybrid_connection
Debug Output
Panic Output
Expected Behavior
Hybrid Connection generated thru terraform should be able to be recognized in Hybrid Connection Manager
Actual Behavior
By comparing connection strings from those, I found out that "EntityPath"(which is the name of hc) section is missing from the service bus connection string from the terraform generated hc.
Manual connection string: Endpoint=sb://blah.servicebus.windows.net/;SharedAccessKeyName=defaultListener;SharedAccessKey=blah;EntityPath=manualhc Terraform connection string: Endpoint=sb://blah.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=blah;
Steps to Reproduce
Important Factoids
References
0000