<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm" -->

---
title: Disabling session affinity in Azure App Service Web Apps...
description: A back-end web API hosted on Azure Websites (Azure App Service) was unevenly distributing traffic across instances due to session affinity cookies set by IIS...
canonical: https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Disabling session affinity in Azure App Service Web Apps (Websites) | daily.dev
og:description: A back-end web API hosted on Azure Websites (Azure App Service) was unevenly distributing traffic across instances due to session affinity cookies set by IIS...
og:url: https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm
og:image: https://api.daily.dev/og/posts/q48mieoZm.png
og:image:alt: Disabling session affinity in Azure App Service Web Apps (Websites)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Disabling session affinity in Azure App Service Web Apps (Websites)

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 3 min read · 0 upvotes · 0 comments

## Summary

A back-end web API hosted on Azure Websites (Azure App Service) was unevenly distributing traffic across instances due to session affinity cookies set by IIS Application Request Routing (ARR). Disabling this behavior is possible by adding a custom response header, Arr-Disable-Session-Affinity set to true, via Web.config, which stops ARR from setting the affinity cookie and lets round-robin load balancing take over for APIs that don't need sticky sessions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2015-12-23-disabling-session-affinity-in-azure-app-service-web-apps-websites>

## Questions this post answers

### How do I disable session affinity cookies on Azure App Service so requests are load balanced evenly across instances?

Add a custom response header named Arr-Disable-Session-Affinity with value true in Web.config under system.webServer/httpProtocol/customHeaders. This tells IIS Application Request Routing (ARR), which handles load balancing for Azure App Service, not to set the ARRAffinity cookie, so subsequent client requests get distributed by the load balancing algorithm instead of sticking to one backend server.

_daily.dev surfaces practical fixes like this for developers tuning load balancing on Azure App Service._

### Why does one Azure App Service instance get almost no traffic while others are overloaded?

This happens because IIS Application Request Routing (ARR), which load balances Azure App Service traffic, sets a session affinity cookie called ARRAffinity on responses so repeat requests from the same client always hit the same backend server. If a client never establishes affinity with an underused instance, that instance can end up receiving little to no traffic, such as only monitoring pings.

_Developers debugging uneven traffic distribution can find similar infrastructure deep dives on daily.dev._

## Similar posts on daily.dev

- [Your Logout Button Is Lying: ASP.NET Session Security Done Right — Daily DevOps & .NET](https://daily.dev/posts/your-logout-button-is-lying-asp-net-session-security-done-right-daily-devops-net-swu9n2jai) · We Are .NET · 1 upvotes · 0 comments
- [5 Mistakes Teams Make When Scaling .NET Applications](https://daily.dev/posts/5-mistakes-teams-make-when-scaling-net-applications-jeilk21xw) · Telerik · 5 upvotes · 0 comments
- [AWS, Microsoft and Google agree the session is the new unit. They disagree on how to isolate it.](https://daily.dev/posts/aws-microsoft-and-google-agree-the-session-is-the-new-unit-they-disagree-on-how-to-isolate-it--fyff0nkhp) · The New Stack · 0 upvotes · 0 comments
- [CORS in ASP.NET Core \(.NET 10\) - Cross-Origin Done Right](https://daily.dev/posts/cors-in-asp-net-core-net-10---cross-origin-done-right-yhzuttdec) · Code with Mukesh · 15 upvotes · 0 comments
- [Monitor and improve your web app’s load performance](https://daily.dev/posts/monitor-and-improve-your-web-app-s-load-performance-nupczfgkm) · Patrick Brosset · 0 upvotes · 0 comments

---

Tags: [#azure](https://daily.dev/tags/azure), [#.net](https://daily.dev/tags/.net)

[View this post on daily.dev](https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Disabling session affinity in Azure App Service Web Apps (Websites)","url":"https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm"},"datePublished":"2026-10-04T13:04:07.242Z","dateModified":"2026-10-04T13:04:54.148Z","description":"A back-end web API hosted on Azure Websites (Azure App Service) was unevenly distributing traffic across instances due to session affinity cookies set by IIS...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d0b0afbe9bce87fc807de9019cdb39b9?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d0b0afbe9bce87fc807de9019cdb39b9?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"azure,.net","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Disabling session affinity in Azure App Service Web Apps (Websites)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/disabling-session-affinity-in-azure-app-service-web-apps-websites--q48mieozm#faq","mainEntity":[{"@type":"Question","name":"How do I disable session affinity cookies on Azure App Service so requests are load balanced evenly across instances?","acceptedAnswer":{"@type":"Answer","text":"Add a custom response header named Arr-Disable-Session-Affinity with value true in Web.config under system.webServer/httpProtocol/customHeaders. This tells IIS Application Request Routing (ARR), which handles load balancing for Azure App Service, not to set the ARRAffinity cookie, so subsequent client requests get distributed by the load balancing algorithm instead of sticking to one backend server. daily.dev surfaces practical fixes like this for developers tuning load balancing on Azure App Service."}},{"@type":"Question","name":"Why does one Azure App Service instance get almost no traffic while others are overloaded?","acceptedAnswer":{"@type":"Answer","text":"This happens because IIS Application Request Routing (ARR), which load balances Azure App Service traffic, sets a session affinity cookie called ARRAffinity on responses so repeat requests from the same client always hit the same backend server. If a client never establishes affinity with an underused instance, that instance can end up receiving little to no traffic, such as only monitoring pings. Developers debugging uneven traffic distribution can find similar infrastructure deep dives on daily.dev."}}]}
```

