# Using an Azure Load Balancer with Web.TextControl

> When deploying Web.TextControl behind an Azure Load Balancer, the default 5-tuple session persistence breaks editor state. Configuring Source IP Affinity with a 2-tuple or 3-tuple distribution mode ensures that client connections consistently route to the same backend VM.

- **Author:** Bjoern Meyer
- **Published:** 2016-03-22
- **Modified:** 2026-07-17
- **Description:** When deploying Web.TextControl behind an Azure Load Balancer, the default 5-tuple session persistence breaks editor state. Configuring Source IP Affinity with a 2-tuple or 3-tuple distribution mode ensures that client connections consistently route to the same backend VM.
- **3 min read** (445 words)
- **Tags:**
  - Azure
  - HTML5
  - MVC
  - Tutorial
- **Web URL:** https://www.textcontrol.com/blog/2016/03/22/using-an-azure-load-balancer-with-webtextcontrol/
- **LLMs URL:** https://www.textcontrol.com/blog/2016/03/22/using-an-azure-load-balancer-with-webtextcontrol/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2016/03/22/using-an-azure-load-balancer-with-webtextcontrol/llms-full.txt

---

LOB (line of business) applications are often deployed with a *Load Balancer* that distributes incoming traffic to healthy virtual machines or cloud services. When deploying an application, that uses the HTML5-based [Web.TextControl](https://docs.textcontrol.com/textcontrol/asp-dotnet/ref.txtextcontrol.web.textcontrol.class.htm), picking the right distribution algorithm is important.

The default setting for *session persistence* of an Azure *Load Balancing Rule* is *None*. The distribution algorithm uses a 5-tuple (source IP, source port, destination IP, destination port, protocol type) hash to route the traffic to servers in the *Backend Pool*. It provides stickiness only within the transport session. This distribution setup cannot be used for applications that use [Web.TextControl](https://docs.textcontrol.com/textcontrol/asp-dotnet/ref.txtextcontrol.web.textcontrol.class.htm) MVC or Web Forms.

![Using an Azure Load Balancer with Web.TextControl](https://s1-www.textcontrol.com/assets/dist/blog/2016/03/22/a/assets/load_balancing_5tupel.webp "Using an Azure Load Balancer with Web.TextControl")Azure provides an additional distribution mode called *Source IP Affinity* (also known as *session affinity* or *client IP affinity*). Azure Load Balancer can be configured to use a 2-tuple (source IP, destination IP) or 3-tuple (source IP, destination IP, protocol) to route traffic to the available servers. By using *Source IP Affinity*, connections initiated from the same client are routed always to the same endpoint.

![Using an Azure Load Balancer with Web.TextControl](https://s1-www.textcontrol.com/assets/dist/blog/2016/03/22/a/assets/load_balancing_2tupel.webp "Using an Azure Load Balancer with Web.TextControl")The same distribution mode is required when using a separate application server that runs the TX Text Control Service as described [in this article](https://www.textcontrol.com/blog/2015/12/11/txtextcontrolweb-web-forms-and-mvc-routing-service-calls-to-a-separate-application-server/llms-full.txt):

![Using an Azure Load Balancer with Web.TextControl](https://s1-www.textcontrol.com/assets/dist/blog/2016/03/22/a/assets/load_balancing_2tupel_app.webp "Using an Azure Load Balancer with Web.TextControl")When creating the Azure deployment, it is very important that the virtual machines of the load balancer *Backend pool* are created in the same *Availability Set*.

![Using an Azure Load Balancer with Web.TextControl](https://s1-www.textcontrol.com/assets/dist/blog/2016/03/22/a/assets/load_balancing_availability.webp "Using an Azure Load Balancer with Web.TextControl")In order to specify the *Source IP Affinity* distribution mode, select *Client IP* from the *Session Persistence* drop-down in the load balancing rule settings:

![Using an Azure Load Balancer with Web.TextControl](https://s1-www.textcontrol.com/assets/dist/blog/2016/03/22/a/assets/load_balancing_rule.webp "Using an Azure Load Balancer with Web.TextControl")*None* means 5-tupel, *Client IP* is 2-tupel and *Client IP and protocol* is the 3-tupel distribution algorithm.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Deploying the MVC HTML5 Editor to Azure App Services](https://www.textcontrol.com/blog/2018/04/06/deploying-the-mvc-html5-editor-to-azure-app-services/llms.txt)
- [Web.TextControl in MVC with MVC View Pages](https://www.textcontrol.com/blog/2015/03/23/webtextcontrol-in-mvc-with-mvc-view-pages/llms.txt)
- [Detect Toggle Button Changes Using a MutationObserver](https://www.textcontrol.com/blog/2021/11/11/detect-toggle-button-changes-using-a-mutationobserver/llms.txt)
- [Implementing Conditional Table Cell Colors with MailMerge](https://www.textcontrol.com/blog/2020/10/08/implementing-conditional-table-cell-colors-with-mailmerge/llms.txt)
- [Creating an ASP.NET MVC DocumentViewer Application With Razor](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-mvc-documentviewer-application-with-razor/llms.txt)
- [Creating an ASP.NET MVC Application With Razor](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-mvc-application-with-razor/llms.txt)
- [Creating Your First ASP.NET Reporting Application](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-aspnet-reporting-application/llms.txt)
- [Creating an ASP.NET Web Forms AJAX Application](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-web-forms-ajax-application/llms.txt)
- [ReportingCloud .NET Core Quickstart Tutorial](https://www.textcontrol.com/blog/2019/07/24/reportingcloud-dotnet-core-quickstart-tutorial/llms.txt)
- [Sneak Peek X15: Copy to Local Clipboard Support in ASP.NET Version](https://www.textcontrol.com/blog/2017/07/13/sneak-peek-x15-copy-to-local-clipboard-support-in-aspnet-version/llms.txt)
- [Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control](https://www.textcontrol.com/blog/2017/06/21/sneak-peek-x15-custom-field-overlays-in-html5-based-text-control/llms.txt)
- [New ASP.NET MVC DocumentViewer Rolled out to the ReportingCloud Portal](https://www.textcontrol.com/blog/2017/04/22/new-aspnet-mvc-documentviewer-rolled-out-to-the-reportingcloud-portal/llms.txt)
- [Updated MVC Sample: Loading Files from the Backstage Menu](https://www.textcontrol.com/blog/2017/04/20/updated-mvc-sample-loading-files-from-the-backstage-menu/llms.txt)
- [MVC: Loading a Document in the View Code from a MemoryStream](https://www.textcontrol.com/blog/2016/03/16/mvc-loading-a-document-in-the-view-code-from-a-memorystream/llms.txt)
- [MVC: Loading Files from the Backstage Menu](https://www.textcontrol.com/blog/2016/01/06/mvc-loading-files-from-the-backstage-menu/llms.txt)
- [MVC: Replace the File Menu with a Backstage View Menu](https://www.textcontrol.com/blog/2015/12/30/mvc-replace-the-file-menu-with-a-backstage-view-menu/llms.txt)
- [MVC: Replace the Ribbon Table Menu with a Quick Insert Table Drop-down](https://www.textcontrol.com/blog/2015/12/23/mvc-replace-the-ribbon-table-menu-with-a-quick-insert-table-drop-down/llms.txt)
- [MVC: Arrange a Docked Web.TextControl with a Custom Bar at the Top](https://www.textcontrol.com/blog/2015/12/18/mvc-arrange-a-docked-webtextcontrol-with-a-custom-bar-at-the-top/llms.txt)
- [Setting the Interface and Control's Culture of Web.TextControl](https://www.textcontrol.com/blog/2015/12/16/setting-the-interface-and-controls-culture-of-webtextcontrol/llms.txt)
- [MVC: Autosave and Restore Documents to and from the Local Browser Storage](https://www.textcontrol.com/blog/2015/12/14/mvc-autosave-and-restore-documents-to-and-from-the-local-browser-storage/llms.txt)
- [ASP.NET MVC: How to Use the HtmlHelper Settings with Lambda Expressions](https://www.textcontrol.com/blog/2015/12/10/aspnet-mvc-how-to-use-the-htmlhelper-settings-with-lambda-expressions/llms.txt)
- [MVC: Loading and Saving Documents Through Controller HttpPost Methods](https://www.textcontrol.com/blog/2015/12/08/mvc-loading-and-saving-documents-through-controller-httppost-methods/llms.txt)
- [Sending Authorized Requests from WebForms to MVC](https://www.textcontrol.com/blog/2015/10/05/sending-authorized-requests-from-webforms-to-mvc/llms.txt)
- [HTML5: Saving Documents in an MVC Controller Method](https://www.textcontrol.com/blog/2015/10/01/html5-saving-documents-in-an-mvc-controller-method/llms.txt)
- [TextControl.Web: Creating an MVC Application with Razor](https://www.textcontrol.com/blog/2015/05/12/textcontrolweb-creating-an-mvc-application-with-razor/llms.txt)
