Azure / azure-relay-dotnet

☁️ .NET Standard client library for Azure Relay Hybrid Connections

Home Page:https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Export relay to ARM template

kristofferjalen opened this issue · comments

It seems to be not possible to export an Azure Hybrid Connection relay to an ARM template. When exporting the whole resource group, the relay is not included. The relay is defined by this ARM template.

The ARM template I use creates a corrupt relay, which cannot find the on-premise host. But if I add the relay manually instead, the host is found. That's the reason I need to investigate an exported ARM template.

My current ARM template:

{
    "apiVersion": "2019-08-01",
    "dependsOn":
    [
        "[resourceId('Microsoft.Web/sites', variables('webAppName'))]"
    ],
    "name": "[concat(parameters('relayName'), '/', parameters('hybridName'))]",
    "location": "[resourceGroup().location]",
    "properties":
    {
        "relayArmUri": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('relayResourceGroup'), '/providers/Microsoft.Relay/namespaces/', parameters('relayName'), '/hybridConnections/', parameters('hybridName'))]",
        "sendKeyName": "defaultSender",
        "sendKeyValue": "[listkeys(concat(variables('hybridConnectionResourceId'), '/authorizationRules/defaultSender'), '2017-04-01').primaryKey]",
        "hostname": "[parameters('hostname')]",
        "port": "[parameters('port')]",
        "serviceBusSuffix": ".servicebus.windows.net"
    },
    "type": "hybridConnectionNamespaces/relays"
}