Skip to content

Commit 85c0e9c

Browse files
authored
Merge pull request #127279 from TD2106/duy/lifetime-docs
Update document for firewall lifetime connection limit
2 parents 9a6947c + dd4ad74 commit 85c0e9c

File tree

2 files changed

+40
-36
lines changed

2 files changed

+40
-36
lines changed
11.5 KB
Loading

articles/azure-signalr/signalr-howto-configure-application-firewall.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Application Firewall provides sophisticated control over client connections
1717

1818
## What Does the Application Firewall Do?
1919

20-
The Application Firewall consists of various rule lists. Currently, there are two rule lists called *Client Connection Count Rules* and *Client Traffic Control Rules*. Future updates will support more rule lists to control aspects such as connection lifetime.
20+
The Application Firewall consists of various rule lists. Currently, there are two rule lists called *Client Connection Count Rules* and *Client Traffic Control Rules* and a configuration *Max Client Lifetime*. Future updates will support more rule lists to control aspects such as connection lifetime.
2121

2222
This guideline is divided into three parts:
2323
1. Introduction to different application firewall rules.
@@ -69,6 +69,9 @@ Client Traffic Control Rules restrict the inbound throughput of client connectio
6969
This rule limits the inbound throughput of the same claim.
7070

7171

72+
## Max Client Lifetime configuration
73+
This setting controls the maximum lifetime of a client connection, in seconds. When the client connection lifetime reaches the specified time, the service will automatically clean up the session and close the connection. To disable this limit, set the value to 0.
74+
7275
## Set up Application Firewall
7376

7477
# [Portal](#tab/Portal)
@@ -112,42 +115,43 @@ resource signalr 'Microsoft.SignalRService/signalr@2024-10-01-preview' = {
112115
claimName: 'paidUser'
113116
}
114117
]
115-
clientTrafficControlRules:[
118+
clientTrafficControlRules:[
116119
// Add or remove rules as needed
117-
{
118-
// This rule will be skipped if no userId is set
119-
type: 'TrafficThrottleByUserIdRule'
120-
// Every minute
121-
aggregationWindowInSeconds: 60
122-
// 10MB
123-
maxInboundMessageBytes: 10485760
124-
}
125-
{
126-
type: 'TrafficThrottleByJwtSignatureRule'
127-
// Every 30 seconds
128-
aggregationWindowInSeconds: 30
129-
// 5MB
130-
maxInboundMessageBytes: 5242880
131-
}
132-
{
133-
// This rule will be skipped if no freeUser claim is set
134-
type: 'TrafficThrottleByJwtCustomClaimRule'
135-
// Every 10 minutes
136-
aggregationWindowInSeconds: 600
137-
// 1MB
138-
maxInboundMessageBytes: 1048576
139-
claimName: 'freeUser'
140-
}
141-
{
142-
// This rule will be skipped if no paidUser claim is set
143-
type: 'TrafficThrottleByJwtCustomClaimRule'
144-
// Every 30 seconds
145-
aggregationWindowInSeconds: 30
146-
// 1MB
147-
maxInboundMessageBytes: 1048576
148-
claimName: 'paidUser'
149-
}
150-
]
120+
{
121+
// This rule will be skipped if no userId is set
122+
type: 'TrafficThrottleByUserIdRule'
123+
// Every minute
124+
aggregationWindowInSeconds: 60
125+
// 10MB
126+
maxInboundMessageBytes: 10485760
127+
}
128+
{
129+
type: 'TrafficThrottleByJwtSignatureRule'
130+
// Every 30 seconds
131+
aggregationWindowInSeconds: 30
132+
// 5MB
133+
maxInboundMessageBytes: 5242880
134+
}
135+
{
136+
// This rule will be skipped if no freeUser claim is set
137+
type: 'TrafficThrottleByJwtCustomClaimRule'
138+
// Every 10 minutes
139+
aggregationWindowInSeconds: 600
140+
// 1MB
141+
maxInboundMessageBytes: 1048576
142+
claimName: 'freeUser'
143+
}
144+
{
145+
// This rule will be skipped if no paidUser claim is set
146+
type: 'TrafficThrottleByJwtCustomClaimRule'
147+
// Every 30 seconds
148+
aggregationWindowInSeconds: 30
149+
// 1MB
150+
maxInboundMessageBytes: 1048576
151+
claimName: 'paidUser'
152+
}
153+
],
154+
maxClientConnectionLifetimeInSeconds: 30
151155
}
152156
}
153157
}

0 commit comments

Comments
 (0)