Setup Azure Function Hybrid Connection

In this latest post in Donnie and I’s Migrating from Orchestrator series, I’ll show you how to setup Hybrid Connection for PowerShell Azure Functions. This will allow you to perform automation tasks on-prem with Function Apps using PowerShell Core.

Requirements

  • App Service Plan
  • Azure Function in my case I’m using PowerShell Core

You’ll need a non shared or dev/test App Service Plan. The cheapest one I’m aware of that allows Hybrid Connections is the B1 which is the Basic plan. https://azure.microsoft.com/en-us/pricing/details/app-service/windows/

Otherwise Hybrid Connections won’t show up, if using a Consumption Function. Or if you’re on a shared or dev/test App Service Plan you’ll get this message.

PowerShell Azure Function Hybrid Connection

Setup Hybrid Connection

Once setup with the proper App Service Plan, you’ll have the Hybrid connections option under your Azure Function -> Platform Features -> Networking.

PowerShell Azure Function Hybrid Connection

Open Hybrid connections and select Add.

PowerShell Azure Function Hybrid Connection

Give your connection a name, a end point name that can be resolved on the server Hybrid connections will be isntalled on. Then give it a port to use, and Servicebus topic.

PowerShell Azure Function Hybrid Connection

Install On-Prem

Next, you’ll need to download the install agent, copy it to your server and install it. Once installed open the application and click Add a new Hybrid Connection.

 

PowerShell Azure Function Hybrid Connection

You’ll need to be able to sign into Azure. Sorry Server Core. In my case I had to add all the Azure login URLs to trusted sites.

PowerShell Azure Function Hybrid Connection

You’ll be prompted to select your Azure Subscription and select from your published Hybrid Connections.

PowerShell Azure Function Hybrid Connection

In my case because I selected port 777. I did have to make a special firewall rule for TCP 777 before the connection was successful.

PowerShell Azure Function Hybrid Connection PowerShell Azure Function Hybrid Connection

Having Hybrid Connection for Azure Functions opens a new world of on-prem automation options with PowerShell Core.