Open lczc1988 opened 7 years ago
Yup, I had a similar issue trying to automate deployment of a hybrid connection
I am also facing similar issue... trying to create hynrid connection and relay namespace aling with usermetadata - key and value Tried to give usermetadata as json array but failed Any help is appreciated
same issue here.anybody got the format which works?
@mandarj123 : I have used "userMetadata": "[concat('[{\"key\":\"endpoint\",\"value\":\"', parameters('hybid_endpoint_web'), '\"}]')]"
what does final value looks like? endpoint:abc.com:9399 can be a valid value ?
yes, you want to integrate hybrid connection with app service ? It has 2 steps - Create Hybrid connection in relay Integrate it with app service
For creating hybrid connection -
{
"name": "[concat(parameters('apiname'), '/', parameters('servicebus_name'), '/', parameters('hybid_connection_sql'))]",
"type": "Microsoft.Web/sites/hybridConnectionNamespaces/relays",
"apiVersion": "2018-02-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('apiname'))]"
],
"location": "[parameters('location')]",
"properties": {
"serviceBusNamespace": "parameters('servicebus_name')",
"relayName": " parameters('hybid_connection_sql')",
"relayArmUri": "[variables('hybridConnectionResourceId')]",
"hostName": "[split(json(reference(variables('hybridConnectionResourceId'), '2017-04-01').userMetadata)[0].value, ':')[0]]",
"port": "[split(json(reference(variables('hybridConnectionResourceId'), '2017-04-01').userMetadata)[0].value, ':')[1]]",
"sendKeyName": "defaultSender",
"sendKeyValue": "[listkeys(concat(variables('hybridConnectionResourceId'), '/authorizationRules/defaultSender'), '2017-04-01').primaryKey]"
}
}
where variable - "hybridConnectionResourceId": "[resourceId(parameters('resourcegroup'), 'Microsoft.Relay/Namespaces/Hybridconnections', parameters('servicebus_name'), parameters('hybid_connection_sql'))]"
parameter - hybid_connection_sql is name of hybrid connection for example sqlhybrid connection
"userMetadata": "[concat('[{"key":"endpoint","value":"', parameters('hybid_endpoint_sql'), '"}]')]" this template will pick endpoint from hybrid connection ( endpoint like you gave - abc.com:9399 )
Customer used this https://github.com/Azure/azure-quickstart-templates/tree/master/201-azure-relay-create-hybridconnection arm template to create a hybrid connection.
He wanted to configure the userMetadata. Cx tried to add the parameters as below, but it is not added to Hybrid connection as expected. Any idea here? Thank you.
"userMetadata": { "type": "string", "metadata": { "description": "userMetadata information" }
"userMetaData": "[parameters('userMetaData')]"
We can add the userMetadata via portal or in reources.azure.com.