Skip to content

Commit 5e07b2a

Browse files
committed
add custom port instructions
1 parent 9f656c2 commit 5e07b2a

1 file changed

Lines changed: 43 additions & 4 deletions

File tree

articles/app-service/app-service-hybrid-connections.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to create and use hybrid connections in Azure App Service
44
author: seligj95
55
ms.assetid: 66774bde-13f5-45d0-9a70-4e9536a4f619
66
ms.topic: how-to
7-
ms.date: 10/27/2025
7+
ms.date: 12/16/2025
88
ms.update-cycle: 1095-days
99
ms.author: jordanselig
1010
#customer intent: As an app developer, I want to understand the usage of Hybrid Connections to provide access to apps in Azure App Service.
@@ -175,8 +175,8 @@ To support the Hybrid Connections it's configured with, the Hybrid Connection Ma
175175

176176
- TCP access to Azure over port 443.
177177
- TCP access to the Hybrid Connection endpoint.
178-
- Windows clients must have ports 4999-5001 available.
179-
- Linux clients must have port 5001 available.
178+
- Windows clients use ports 4999-5001 by default. These ports can be [modified if needed](#configure-custom-ports).
179+
- Linux clients use port 5001 by default. This port can be [modified if needed](#configure-custom-ports).
180180
- The ability to do DNS look-ups on the endpoint host and the Service Bus namespace. In other words, the hostname in the Azure relay connection should be resolvable from the machine that hosts the Hybrid Connection Manager.
181181

182182
### Getting started with the Hybrid Connection Manager GUI
@@ -221,7 +221,7 @@ On Windows, you can use the Hybrid Connection Manager CLI by searching for and o
221221

222222
# [Linux](#tab/linux)
223223

224-
On Linux, once installed, you can run `hcm help` to confirm the Hybrid Connection Manager is installed and to see the available commands.
224+
On Linux, once installed, you can run `hcm --help` to confirm the Hybrid Connection Manager is installed and to see the available commands.
225225

226226
-----
227227

@@ -245,6 +245,45 @@ You can also show the details of a specific Hybrid Connection with the `hcm show
245245

246246
:::image type="content" source="media/app-service-hybrid-connections/hybrid-connections-hcm-details-cli.png" alt-text="Screenshot of Hybrid Connection Details in CLI.":::
247247

248+
### Configure custom ports
249+
250+
By default, the Hybrid Connection Manager uses ports 4999-5001 on Windows and port 5001 on Linux. You can configure custom ports if the default ports are unavailable or if your environment requires different port assignments.
251+
252+
# [Windows](#tab/windows)
253+
254+
To configure custom ports on Windows, navigate to **Edit the system environment variables** with Windows Search and add the following environment variables. Ensure you're editing the **System Variables** section, not the user variables.
255+
256+
- `HCM_GUI_PORT`
257+
- `HCM_SERVICE_PORT`
258+
259+
Set the value of each variable to the port number you want to use. For example, `HCM_GUI_PORT=1234`.
260+
261+
> [!NOTE]
262+
> If you set these environment variables after the Hybrid Connection Manager is installed, you need to restart **HybridConnectionManagerService** through **Services** from Windows Search. We recommend setting these variables before you install the Hybrid Connection Manager to avoid issues with the service picking up these values.
263+
264+
# [Linux](#tab/linux)
265+
266+
To configure a custom port on Linux:
267+
268+
1. Edit the `/etc/environment` file as root or with sudo and add the following line. Replace `<PORT-NUMBER>` with the port number you want to use for the Hybrid Connection Manager service:
269+
270+
```bash
271+
HCM_SERVICE_PORT=<PORT-NUMBER>
272+
```
273+
274+
1. Re-run the Hybrid Connection Manager setup script to apply the new port configuration:
275+
276+
```bash
277+
sudo ./setup.sh
278+
```
279+
280+
If running the setup script with sudo doesn't apply the port change, try running it without sudo.
281+
282+
> [!NOTE]
283+
> We recommend setting this environment variable before installing the Hybrid Connection Manager. If you set the variable after installation, you must re-run the setup script.
284+
285+
-----
286+
248287
### Configure proxy server settings
249288
250289
If you need to configure proxy server settings for the Hybrid Connection Manager, edit the `ProxySettings` section in the `appsettings.json` file located at:

0 commit comments

Comments
 (0)