You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Configure node endpoints in Azure Batch pool
3
3
description: How to configure node endpoints such as access to SSH or RDP ports on compute nodes in an Azure Batch pool.
4
4
ms.topic: how-to
5
-
ms.date: 01/12/2026
5
+
ms.date: 03/06/2026
6
6
# Customer intent: As an IT administrator, I want to configure remote access endpoints for compute nodes in an Azure Batch pool, so that I can control external connectivity while ensuring security and compliance in my environment.
7
7
---
8
8
9
9
# Configure remote access to compute nodes in an Azure Batch pool
10
10
11
-
If configured, you can allow a [node user](/rest/api/batchservice/computenode/adduser) with network connectivity to connect
11
+
If configured, you can allow a [node user](/rest/api/batchservice/nodes/create-node-user) with network connectivity to connect
12
12
externally to a compute node in a Batch pool. For example, a user can connect by Remote Desktop (RDP) on port 3389 to a
13
13
compute node in a Windows pool. Similarly, by default, a user can connect by Secure Shell (SSH) on port 22 to a compute
14
14
node in a Linux pool.
@@ -21,86 +21,160 @@ node in a Linux pool.
21
21
22
22
In your environment, you might need to enable, restrict, or disable external access settings or any other ports you wish
23
23
on the Batch pool. You can modify these settings by using the Batch APIs to set the
The endpoint configuration consists of one or more [network address translation (NAT) pools](/rest/api/batchservice/pools/create-pool#batchinboundnatpool)
27
+
28
+
The endpoint configuration consists of one or more [network address translation (NAT) pools](/rest/api/batchmanagement/pool/create#inboundnatpool)
28
29
of frontend ports. Don't confuse a NAT pool with the Batch pool of compute nodes. You set up each NAT pool to override
29
30
the default connection settings on the pool's compute nodes.
30
31
31
-
Each NAT pool configuration includes one or more [network security group (NSG) rules](/rest/api/batchservice/pools/create-pool#networksecuritygrouprule). Each NSG rule allows or denies certain network traffic to the endpoint. You can choose to allow or deny all traffic, traffic identified by a [service tag](../virtual-network/network-security-groups-overview.md#service-tags) (such as "Internet"), or traffic from specific IP addresses or subnets.
32
+
Each NAT pool configuration includes one or more [network security group (NSG) rules](/rest/api/batchmanagement/pool/create#networksecuritygrouprule). Each NSG rule allows or denies certain network traffic to the endpoint. You can choose to allow or deny all traffic, traffic identified by a [service tag](../virtual-network/network-security-groups-overview.md#service-tags) (such as "Internet"), or traffic from specific IP addresses or subnets.
32
33
33
34
### Considerations
34
-
* The pool endpoint configuration is part of the pool's [network configuration](/rest/api/batchservice/pools/create-pool#networkconfiguration). The network configuration can optionally include settings to join the pool to an [Azure virtual network](batch-virtual-network.md). If you set up the pool in a virtual network, you can create NSG rules that use address settings in the virtual network.
35
-
* You can configure multiple NSG rules when you configure a NAT pool. The rules are checked in the order of priority. Once a rule applies, no more rules are tested for matching.
35
+
36
+
- The pool endpoint configuration is part of the pool's [network configuration](/rest/api/batchmanagement/pool/create#networkconfiguration). The network configuration can optionally include settings to join the pool to an [Azure virtual network](batch-virtual-network.md). If you set up the pool in a virtual network, you can create NSG rules that use address settings in the virtual network.
37
+
- You can configure multiple NSG rules when you configure a NAT pool. The rules are checked in the order of priority. Once a rule applies, no more rules are tested for matching.
36
38
37
39
## Example: Allow RDP traffic from a specific IP address
38
40
39
-
The following C# snippet shows how to configure the RDP endpoint on compute nodes in a Windows pool to allow RDP access only from IP address *198.168.100.7*. The second NSG rule denies traffic that doesn't match the IP address.
41
+
The following C# snippet shows how to configure the RDP endpoint on compute nodes in a Windows pool to allow RDP access only from IP address _198.168.100.7_. The second NSG rule denies traffic that doesn't match the IP address.
40
42
41
43
```csharp
42
-
usingMicrosoft.Azure.Batch;
43
-
usingMicrosoft.Azure.Batch.Common;
44
+
usingSystem;
45
+
usingAzure.Core;
46
+
usingAzure.Identity;
47
+
usingAzure.ResourceManager.Batch;
48
+
usingAzure.ResourceManager.Batch.Models;
44
49
45
50
namespaceAzureBatch
46
51
{
47
52
public void SetPortsPool()
48
53
{
49
-
pool.NetworkConfiguration = new NetworkConfiguration
54
+
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
55
+
TokenCredential cred = new DefaultAzureCredential();
56
+
57
+
// authenticate your client
58
+
ArmClient client = new ArmClient(cred);
59
+
60
+
// this example assumes you already have this BatchAccountResource created on azure
61
+
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
// the variable result is a resource, you could call other operations on this instance as well
103
+
// but just for demo, we get its data from this resource instance
104
+
BatchAccountPoolDataresourceData=result.Data;
60
105
}
61
106
}
62
107
```
63
108
64
109
## Example: Allow SSH traffic from a specific subnet
65
110
66
-
The following Python snippet shows how to configure the SSH endpoint on compute nodes in a Linux pool to allow access only from the subnet *192.168.1.0/24*. The second NSG rule denies traffic that doesn't match the subnet.
111
+
The following Python snippet shows how to configure the SSH endpoint on compute nodes in a Linux pool to allow access only from the subnet _192.168.1.0/24_. The second NSG rule denies traffic that doesn't match the subnet.
print(f"Pool '{result.name}' created successfully.")
173
+
```
100
174
101
175
## Example: Deny all RDP traffic
102
176
103
-
The following C# snippet shows how to configure the RDP endpoint on compute nodes in a Windows pool to deny all network traffic. The endpoint uses a frontend pool of ports in the range *60000 - 60099*.
177
+
The following C# snippet shows how to configure the RDP endpoint on compute nodes in a Windows pool to deny all network traffic. The endpoint uses a frontend pool of ports in the range _60000 - 60099_.
104
178
105
179
> [!NOTE]
106
180
> As of Batch API version `2024-07-01`, port 3389 typically associated with RDP is no longer mapped by default.
@@ -109,30 +183,73 @@ The following C# snippet shows how to configure the RDP endpoint on compute node
109
183
> from other sources.
110
184
111
185
```csharp
112
-
usingMicrosoft.Azure.Batch;
113
-
usingMicrosoft.Azure.Batch.Common;
186
+
usingSystem;
187
+
usingAzure.Core;
188
+
usingAzure.Identity;
189
+
usingAzure.ResourceManager.Batch;
190
+
usingAzure.ResourceManager.Batch.Models;
114
191
115
192
namespaceAzureBatch
116
193
{
117
194
public void SetPortsPool()
118
195
{
119
-
pool.NetworkConfiguration = new NetworkConfiguration
196
+
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
197
+
TokenCredential cred = new DefaultAzureCredential();
198
+
199
+
// authenticate your client
200
+
ArmClient client = new ArmClient(cred);
201
+
202
+
// this example assumes you already have this BatchAccountResource created on azure
203
+
// for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource
// the variable result is a resource, you could call other operations on this instance as well
244
+
// but just for demo, we get its data from this resource instance
245
+
BatchAccountPoolDataresourceData=result.Data;
129
246
}
130
247
}
131
248
```
132
249
133
250
## Example: Deny all SSH traffic from the internet
134
251
135
-
The following Python snippet shows how to configure the SSH endpoint on compute nodes in a Linux pool to deny all internet traffic. The endpoint uses a frontend pool of ports in the range *4000 - 4100*.
252
+
The following Python snippet shows how to configure the SSH endpoint on compute nodes in a Linux pool to deny all internet traffic. The endpoint uses a frontend pool of ports in the range _4000 - 4100_.
136
253
137
254
> [!NOTE]
138
255
> As of Batch API version `2024-07-01`, port 22 typically associated with SSH is no longer mapped by default.
@@ -141,29 +258,60 @@ The following Python snippet shows how to configure the SSH endpoint on compute
0 commit comments