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
Copy file name to clipboardExpand all lines: articles/container-apps/session-pool.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.author: cshoe
11
11
12
12
# Use session pools in Azure Container Apps
13
13
14
-
Azure Container Apps sessions are secure sandboxed environments ideal for running code or applications that require strong isolation from other workloads. Sessions are managed by a pool which provides immediate access to new sessions, and is responsible for handling the lifecycle of each session.
14
+
Session pools provide subsecond session allocation times for new pools, and is responsible for the management and lifecycle of each session.
Azure Container Apps dynamic [sessions](sessions.md) offer isolated, secure contexts when you need to run code or applications separately from other workloads. Sessions run inside a [session pool](session-pool.md) which provides immediate access to new and existing sessions.
15
+
Azure Container Apps dynamic [sessions](sessions.md) offer isolated, secure contexts when you need to run code or applications separately from other workloads. Sessions run inside a [session pool](session-pool.md) which provides immediate access to new and existing sessions. These sessions are ideal for scenarios where user-generated input needs to be processed in a controlled manner or when integrating third-party services that require executing code in an isolated environment.
16
16
17
17
This article shows you how to manage and interact with dynamic sessions.
18
18
@@ -30,13 +30,11 @@ For more information managing session pools, see [session pools management endpo
30
30
31
31
## Forwarding requests to a session's container
32
32
33
-
To send a request into a session's container, you use the management endpoint as the root for your request.
34
-
35
-
Anything in the path following the base pool management endpoint is forwarded to the session's container.
33
+
To send a request into a session's container, you use the management endpoint as the root for your request. Anything in the path following the base pool management endpoint is forwarded to the session's container.
36
34
37
35
For example, if you make a call to: `<POOL_MANAGEMENT_ENDPOINT>/api/uploadfile`, the request is routed to the session's container at `0.0.0.0:<TARGET_PORT>/api/uploadfile`.
38
36
39
-
## Continuous session interaction
37
+
## Continuous interaction
40
38
41
39
As you continue to make calls to the same session, the session remains [allocated](sessions.md#session-lifecycle) in the pool. Once there are no requests to the session after the cooldown period has elapsed, the session is automatically destroyed.
42
40
@@ -80,7 +78,7 @@ The identifier must be a string that is 4 to 128 characters long and can contain
80
78
81
79
## Work with files
82
80
83
-
You can upload and download files and list all files to a session.
81
+
You can upload and download files, and list all the files in a session.
84
82
85
83
### Upload a file
86
84
@@ -169,6 +167,20 @@ Only configure or upload sensitive data to a session if you trust the users of t
169
167
170
168
By default, sessions are prevented from making outbound network requests. You can control network access by configuring network status settings on the session pool.
171
169
170
+
-**Use strong, unique session identifiers**: Always generate session identifiers that are long and complex to prevent brute-force attacks. Use cryptographic algorithms to create identifiers that are hard to guess.
171
+
172
+
-**Limit session visibility**: Set strict access controls to ensure that session identifiers are only visible to the session pool. Avoid exposing session IDs in URLs or logs.
173
+
174
+
-**Implement short expiration times**: Configure session identifiers to expire after a short period of inactivity. This approach minimizes the risk of sessions being hijacked after a user has finished interacting with your application.
175
+
176
+
-**Regularly rotate session credentials**: Periodically review and update the credentials associated with your sessions. Rotation decreases the risk of unauthorized access.
177
+
178
+
-**Utilize secure transmission protocols**: Always use HTTPS to encrypt data in transit, including session identifiers. This approach protects against man-in-the-middle attacks.
179
+
180
+
-**Monitor session activity**: Implement logging and monitoring to track session activities. Use these logs to identify unusual patterns or potential security breaches.
181
+
182
+
-**Validate user input**: Treat all user input as dangerous. Use input validation and sanitation techniques to protect against injection attacks and ensure that only trusted data is processed.
183
+
172
184
To fully secure your sessions, you can:
173
185
174
186
-[Use Microsoft Entra ID authentication and authorization](#authentication)
Copy file name to clipboardExpand all lines: articles/container-apps/sessions.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,27 +28,27 @@ With sessions, you get:
28
28
29
29
***Scalable**: Sessions can run at a high scale. You can run hundreds or thousands of sessions concurrently.
30
30
31
+
***API access**: Sessions are exposed to your application via a single HTTP endpoint.
32
+
31
33
## Session
32
34
33
35
A session is a sandboxed environment that runs untrusted code or your application.
34
36
35
-
Each session is isolated from all other sessions and from the host environment with a [Hyper-V](/windows-server/virtualization/hyper-v/hyper-v-technology-overview) sandbox. Hyper-V technology is at the foundation for session isolation, ensuring that different sessions operate independently with the necessary security boundaries in place.
36
-
37
-
For enhanced network security, you can enable session network isolation on your session.
37
+
Each session is isolated from all other sessions and from the host environment with a [Hyper-V](/windows-server/virtualization/hyper-v/hyper-v-technology-overview) sandbox. Hyper-V technology is at the foundation for session isolation, ensuring that different sessions operate independently with the necessary security boundaries in place. For enhanced network security, you can enable session network isolation on your session.
38
38
39
-
Each session executes in the context of a session pool.
39
+
There are two different types of sessions.
40
40
41
41
## Session types
42
42
43
-
Sessions are exposed to your application via a single HTTP endpoint.
44
-
45
43
Azure Container Apps supports two types of sessions:
46
44
47
45
| Type | Description | Billing model |
48
46
|------|-------------|---------------|
49
47
|[Code interpreter sessions](./sessions-code-interpreter.md)| Fully managed code interpreter which allows you to run code in a sandbox preinstalled with popular libraries.<br><br>Ideal for running untrusted code, such as code provided by users of your application or code generated by a large language model (LLM).<br><br>You can use the session out-of-the-box or with a [language model framework](./sessions-code-interpreter.md#llm-framework-integrations). | Per session (consumption) |
50
48
|[Custom container sessions](./sessions-custom-container.md)| Bring-your-own-container option where you run your own container images in secure, isolated sandboxes.<br><br>This approach is a good option if you want to run a custom code interpreter for a language that isn't supported out of the box, or workloads that require strong isolation. | Container Apps Dedicated Plan |
51
49
50
+
Each session, regardless of type, runs in the context of a session pool.
51
+
52
52
## Session pools
53
53
54
54
To provide subsecond session allocation times, Azure Container Apps maintains a pool of ready but unallocated sessions. When your application makes a request for a session that hasn't been used before, the pool automatically assigns a new session for you. As sessions are allocated, the pool is automatically replenished to maintain a constant number of ready sessions.
@@ -94,7 +94,18 @@ Dynamic sessions are available in the following regions:
94
94
95
95
Custom container sessions are billed based on the resources consumed by the session pool. For more information, see [Azure Container Apps billing](billing.md#custom-container).
96
96
97
-
## Next steps
97
+
## Security
98
+
99
+
Use the following methods to help harden the security of your dynamic sessions.
100
+
101
+
***Secure identifiers**: Use secure [session identifiers](sessions-usage.md#identifiers) at all times. Generate session identifiers using cryptographic methods to ensure unique and unpredictable values. Avoid using sequential IDs that could be guessed by an attacker.
102
+
103
+
***Use HTTPS**: Always use HTTPS to encrypt data in transit. This protects session identifiers and any sensitive data exchanged between the client and server from being intercepted.
104
+
105
+
***Limit session lifetime**: Implement timeouts for sessions. For instance, allow a maximum of 15 minutes of inactivity before the session is automatically terminated. This helps mitigate risks due to a lost or unattended device.
106
+
107
+
***Regular audits and monitoring**: Periodically review session management practices and logs. Implement monitoring tools to alert suspicious activities, such as repeated failed login attempts or abnormal session lengths.
0 commit comments