Hi ,
Thanks for reaching out to Microsoft Q&A.
When using Azure Load Testing and sending HTTP requests directly (not through JMeter), passing cookies via the "cookie"
header in the request may not work as expected due to how Azure Load Testing manages request headers internally.
Root Cause:
Azure Load Testing might sanitize or omit certain headers (like Cookie
) for security reasons or due to its internal HTTP client behavior. Some HTTP clients ignore manual cookie
headers and expect cookie management to go through a cookie jar
or cookie container
.
Workarounds
Option 1: Use headers
but with a custom header
If your backend does not strictly require the standard Cookie
header and you control the backend, you can pass cookies as a custom header like:
"headers": { "x-cookie-data": "sessionid=abc123; token=xyz456" }
Then, read x-cookie-data
in the backend and process it as needed.
Option 2: Switch to JMeter for cookie handling
If you must use the Cookie
header and cannot modify backend expectations, consider:
- Switching to JMeter-based tests (which Azure Load Testing supports).
- JMeter handles cookies natively via
HTTP Cookie Manager
.
Since you are using requestbased load tests, and the native cookie
header does not pass through, either:
- Pass cookies in a custom header and parse them server-side.
- Use JMeter for advanced cookie/session simulation.
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.