Hi,
How should I set up my endpoint for session affinity? I run at most 10 instances of my web application web role and the user need to hit the same one based on the 5 tuple hash described on the load balancer documentation pages.
The web roles cloud service is part of a subnet which has access to the service layer. The web role also has a reserved IP.
Here is the .csdef file:
<?xml version="1.0" encoding="utf-8"?><ServiceDefinition name="UI.Main.MainUI.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6"><WebRole name="UI.Main.MainUI" vmsize="Small"><Runtime executionContext="elevated" /><Startup><Task commandLine="Startup/startup.cmd" executionContext="elevated" taskType="background" /></Startup><Sites><Site name="Web"><Bindings><Binding name="Endpoint1" endpointName="Endpoint1" /></Bindings></Site></Sites><ConfigurationSettings><Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" /></ConfigurationSettings><Endpoints><InputEndpoint name="Endpoint1" protocol="http" port="80" loadBalancerDistribution="none"/></Endpoints><Imports><Import moduleName="RemoteAccess" /><Import moduleName="RemoteForwarder" /><Import moduleName="Caching" /></Imports><LocalResources><LocalStorage name="DiagnosticStore" sizeInMB="20000" cleanOnRoleRecycle="false" /></LocalResources></WebRole></ServiceDefinition>
And here is the cloud configuration:
<?xml version="1.0" encoding="utf-8"?><ServiceConfiguration serviceName="UI.Main.MainUI.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6"><Role name="UI.Main.MainUI"><Instances count="1" /><ConfigurationSettings><Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=storagename;AccountKey=mykey==" /><Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" /><Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="adminname" /><Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="encryptedpassword" /><Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2016-09-15T23:59:59.0000000+02:00" /><Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" /><Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}" /><Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="1" /><Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" /><Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="DefaultEndpointsProtocol=https;AccountName=mystoragename;AccountKey=myaccountkey==" /></ConfigurationSettings><Certificates><Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="here is a thumbprint" thumbprintAlgorithm="sha1" /></Certificates></Role><NetworkConfiguration><VirtualNetworkSite name="AzureVNetWE" /><AddressAssignments><InstanceAddress roleName="UI.Main.MainUI"><Subnets><Subnet name="PrivateFrontend" /></Subnets></InstanceAddress><ReservedIPs><ReservedIP name="PrivateFrontendIP" /></ReservedIPs></AddressAssignments></NetworkConfiguration></ServiceConfiguration>