Autoscaling ensure VM instances are automatically triggered if metric exceeds threshold
- Add a VM to each cloud service – share the cloud service configurations
- Add all VMs to availability sets
- Configure scale by metric
Resource type should include in Resource Manager template to deploy a VM Scale Set (VMSS)
- Microsoft.Compute/virtualMachinesScaleSets – configure VMSS and VMs created within it
- Microsoft.Network/virtualNetworks – contain all VMs that are created in VMSS
- Microsoft.Storage/storageAccounts – store VHDs
- Microsoft.Network/loadBalancers – distribute traffic
- Microsoft.Network/publicIPAddresses – load balancer to receive request from Internet users
- Microsoft.Insights/autoScaleSettings – define metrics and triggers
Configure virtual networks to increase capacity by adding subscriptions
Export and modify the network configuration file. Then import the modified file.
Values in Session state not available in second web server
Replace external Load Balance with Azure Application Gateway – include load balancing based in HTTP protocol, includes cookie-based session affinity. Application Gateway identified client from cookie and ensures request are forwarded to same web server VM, ensuring session state values remain available.
Redress the balance of distribution of traffic to servers by disabling cookie-based affinity
Add customHeaders section to web.config
Azure web apps use Application Request Router (APR) to distribute the requests to servers within the service. Default configuration supports session-based affinity, any user who is maintaining a session with web app will directed to same server. But if users do not close browsers, cookie can persist indefinitely, leading imbalance request distribution. Adding custom header “Arr-Disable-Session-Affinity” = “true” will disable this feature, force all request to use a non-session aware logic for load balancing the request.