%3CLINGO-SUB%20id%3D%22lingo-sub-1592199%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20configure%20session%20affinity%20to%20backend%20nodes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1592199%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20Sharing%20with%20the%20Community%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1591897%22%20slang%3D%22en-US%22%3EHow%20to%20configure%20session%20affinity%20for%20backend%20nodes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1591897%22%20slang%3D%22en-US%22%3E%3CP%3E%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3ESome%20customer%20asked%20me%20about%20the%20following%20issues%20they%20had%20faced.%20I%20would%20like%20to%20summarise%20root%20cause%20of%20this%20issue%20and%20solutions%20in%20case%20of%20this%20customer's%20condition.%3C%2FP%3E%0A%3CP%3EJapanese%20edition%20is%20%3CA%20href%3D%22https%3A%2F%2Flogico-jp.io%2F2020%2F03%2F19%2Fconfigured-session-affinity-but%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1204416537%22%20id%3D%22toc-hId-1204416537%22%3EWhat%20is%20the%20issue%3F%3C%2FH3%3E%0A%3CP%3EThe%20customer%20asked%20some%20SI%20(system%20integration)%20partner%20to%20migrate%20their%20system%20to%20cloud%20in%20the%20form%20of%20%22lift-and-shift%22%2C%20but%20session%20affinity%20did%20not%20work%20properly.%20Session%20affinity%20worked%20fine%20when%20system%20ran%20in%20their%20data%20center.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--603037926%22%20id%3D%22toc-hId--603037926%22%3EEnvironment%20and%20deployment%20topology%3C%2FH3%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aheading%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3ETheir%20deployment%20topology%20was%20listed%20below.%20This%20issue%20occurred%20after%20migration%20completed.%20The%20customer%20did%20not%20deploy%20their%20system%20on%20multi-region.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Load%20Balancer%20(ALB)%20%3A%20Traffic%20routing%20is%20based%20on%20protocol%20and%20client%20IP.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ENetwork%20virtual%20appliance%26nbsp%3B%20(NVA)%3CUL%3E%0A%3CLI%3EL7%20Load%20Balancer%20(L7%20LB)%20%3A%20Active-Active%20configuration.%3C%2FLI%3E%0A%3CLI%3EReverse%20Proxy%20(Apache%20HTTP%20server)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EVirtual%20Machine%20(VM)%3CUL%3E%0A%3CLI%3EPackaged%20application%3C%2FLI%3E%0A%3CLI%3EDatabase%20(Oracle)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3C!--%20%2Fwp%3Alist%20--%3E%20%3C!--%20wp%3Aimage%20%7B%22id%22%3A3138%2C%22sizeSlug%22%3A%22large%22%7D%20--%3E%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aimage%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Logico_jp_0-1597628615213.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212671i8AAED4BDF1140CDF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Logico_jp_0-1597628615213.png%22%20alt%3D%22Logico_jp_0-1597628615213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdditional%20requests%20from%20the%20customer%20were...%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Aquote%20--%3E%3C%2FP%3E%0A%3CBLOCKQUOTE%20class%3D%22wp-block-quote%22%3E%0A%3CP%3EWe'd%20like%20to%20configure%20cookie%20based%20session%20affinity.%3C%2FP%3E%0A%3CP%3EWe'd%20like%20to%20achieve%20it%20as%20inexpensive%20as%20possible.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aquote%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1884474907%22%20id%3D%22toc-hId-1884474907%22%3ESituation%3C%2FH3%3E%0A%3CP%3EIn%20case%20packaged%20application%20is%20hosted%20on%20Java%20EE%20application%20server%2C%20session%20affinity%20is%20typically%20configured%20using%20clustering%20of%20Java%20EE%20application%20server%20or%20session%20sharing%20with%20in-memory%20data%20grid%20or%20cache.%20However%2C%20they%20could%20not%20configure%20application%20server%20cluster%20since%20clustering%20was%20restricted%20against%20the%20edition%20they%20used.%26nbsp%3B%20And%20the%20SI%20partner%20deployed%20L7%20LB%20NVA%20behind%20ALB%20to%20achieve%20session%20affinity%2C%20as%20the%20SI%20partner%20knew%20ALB%20did%20not%20have%20session%20affinity%20feature.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Aheading%20%7B%22level%22%3A3%7D%20--%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-77020444%22%20id%3D%22toc-hId-77020444%22%3ELet's%20imaging%20causes%20of%20this%20issue%3C%2FH3%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aheading%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3EThere%20are%20many%20people%20who%20can%20imagine%20the%20root%20cause%20when%20looking%20at%20the%20deployment%20topology%20above.%20The%20following%20points%20should%20be%20checked.%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Alist%20--%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWould%20source%20IP%20of%20inbound%20traffic%20to%20ALB%20(public)%20change%3F%20Specifically%2C%20would%20global%20IP%20be%20changed%20when%20transforming%20local%20IP%20to%20global%20IP%20using%20SNAT%20on%20customer%20site%3F%3C%2FLI%3E%0A%3CLI%3EALB%20does%20not%20have%20any%20feature%20for%20session%20affinity.%20Therefore%2C%20if%20source%20IP%20of%20inbound%20traffic%20is%20changed%2C%20the%20destination%20VM%20which%20hosts%20packaged%20application%20should%20change.%3C%2FLI%3E%0A%3CLI%3EWould%20reverse%20proxy%20develop%20side%20effect%3F%3C%2FLI%3E%0A%3CLI%3EWould%20L7%20LB%20NVA%20which%20deploys%20behind%20ALB%20work%20as%20expected%3F%20Would%20session%20information%20be%20shared%20between%20both%20NVAs%3F%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Alist%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1730434019%22%20id%3D%22toc-hId--1730434019%22%3ERoot%20cause%3C%2FH3%3E%0A%3CP%3EThis%20issue%20occurred%20due%20to%20the%20following%20causes.%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Alist%20--%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ESource%20IP%20of%20inbound%20traffic%20was%20sometimes%20changed%20due%20to%20SNAT.%3C%2FLI%3E%0A%3CLI%3EWhen%20source%20IP%20was%20changed%2C%20ALB%20(public)%20recognized%20that%20this%20traffic%20came%20from%20another%20client%20and%20routed%20the%20traffic%20to%20another%20L7%20LB%20NVA.%3C%2FLI%3E%0A%3CLI%3EL7%20LB%20NVAs%20were%20deployed%20behind%20ALB%20for%20session%20affinity%2C%20but%20they%20did%20not%20work%20expectedly%20since%20session%20information%20was%20not%20shared%20with%20the%20NVAs.%20When%20inbound%20traffic%20was%20routed%20to%20one%20L7%20LB%20NVA%2C%20the%20L7%20LB%20NVA%20did%20not%20have%20any%20way%20to%20identify%20session%20continuity.%20So%2C%20the%20NVA%20recognized%20that%20this%20traffic%20came%20from%20other%20client.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3C!--%20%2Fwp%3Alist%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3EThe%20following%20URL%20describes%20traffic%20distribution%20rule.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EConfigure%20the%20distribution%20mode%20for%20Azure%20Load%20Balancer%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fload-balancer%2Fload-balancer-distribution-mode%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fload-balancer%2Fload-balancer-distribution-mode%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20table%20is%20listed%20what%20happened%20in%20each%20component%20specifically.%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Atable%20--%3E%3C%2FP%3E%0A%3CFIGURE%20class%3D%22wp-block-table%22%3E%0A%3CTABLE%3E%0A%3CTHEAD%3E%0A%3CTR%3E%0A%3CTH%3EComponent%3C%2FTH%3E%0A%3CTH%3EWhat%20would%20happen%3F%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3EALB%20(Public)%3C%2FTD%3E%0A%3CTD%3EThe%20fact%20of%20the%20matter%20is%20that%20traffic%20comes%20from%20the%20same%20client%2C%20but%20the%20traffic%20is%20sometimes%20NATed%20into%20other%20global%20IP.%20In%20this%20case%2C%20ALB%20(public)%20recognizes%20that%20this%20traffic%20comes%20from%20different%20client%2C%20and%20routes%20the%20traffic%20to%20any%20L7%20LB%20NVAs.%20Therefore%2C%20chosen%26nbsp%3BL7%20LB%20NVA%20might%20be%20different%20from%20the%20one%20processed%20previous%20traffic%20from%20the%20same%20client.%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EL7%20LB%20NVA%3C%2FTD%3E%0A%3CTD%3EIf%20L7%20LB%20NVAs%20are%20configured%20in%20the%20form%20of%20%22Active-Active%22%20but%20session%20information%20is%20not%20shared%20between%20L7%20LB%20NVAs%2C%20no%20L7%20LB%20NVA%20can%20identify%20whether%20or%20not%20the%20traffic%20comes%20from%20the%20same%20client.%20Therefore%2C%20L7%20LB%20NVA%20can%20route%20traffic%20to%20any%20reverse%20proxy%20NVAs%20and%20chosen%20reverse%20proxy%20NVA%20might%20be%20different%20from%20the%20one%20processed%20previous%20traffic.%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EALB%20(Internal)%3C%2FTD%3E%0A%3CTD%3EIf%20a%20reverse%20proxy%20NVA%20where%20current%20traffic%20passed%20is%20different%20from%20the%20one%20processed%20previous%20traffic%2C%20ALB%20(Internal)%20recognizes%20that%20this%20traffic%20comes%20from%20different%20client%20since%20source%20IP%20is%20different%2C%20and%20routes%20the%20traffic%20to%20any%20internal%20L7%20LB%20NVAs.%20Therefore%2C%20chosen%26nbsp%3BL7%20LB%20NVA%20might%20be%20different%20from%20the%20one%20processed%20previous%20traffic%20from%20the%20same%20client.%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EInternal%20L7%20LB%20NVA%3C%2FTD%3E%0A%3CTD%3EThis%20is%20the%20same%20as%20mentioned%20above.%3CBR%20%2F%3ESince%20session%20information%20is%20not%20shared%20between%20internal%20L7%20LB%20NVAs%2C%20no%20internal%20L7%20LB%20NVA%20can%20identify%20whether%20or%20not%20the%20traffic%20comes%20from%20the%20same%20client.%20Therefore%2C%20internal%20L7%20LB%20NVA%20can%20route%20traffic%20to%20any%20VMs%20hosted%20packaged%20application%20and%20chosen%20VM%20might%20be%20different%20from%20the%20one%20processed%20previous%20traffic.%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EPackaged%20Application%3C%2FTD%3E%0A%3CTD%3ETraffic%20routing%20was%20not%20consistent%20due%20to%20reasons%20mentioned%20above%2C%20so%20traffic%20was%20sometimes%20routed%20to%20the%20VM%20which%20handled%20previous%20traffic%2C%20and%20at%20other%20times%20another%20traffic%20was%20routed%20to%20the%20different%20VM.%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3C%2FFIGURE%3E%0A%3CP%3E%3C!--%20%2Fwp%3Atable%20--%3E%20%3C!--%20wp%3Aheading%20%7B%22level%22%3A3%7D%20--%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-757078814%22%20id%3D%22toc-hId-757078814%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1050375649%22%20id%3D%22toc-hId--1050375649%22%3ESolution%3C%2FH3%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aheading%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3EI%20commented%20points%20to%20be%20fixed%20and%20SI%20partner%20reconfigured%20component%20topology.%20After%20that%2C%20traffic%20was%20routed%20to%20an%20expected%20package%20application%20node.%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Alist%20--%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EALB%2C%20L7%20LB%20NVAs%2C%20and%20Reverse%20Proxy%20NVAs%20were%20replaced%20with%20Azure%20Application%20Gateway%20(App%20GW).%3C%2FLI%3E%0A%3CLI%3ECookie%20based%20affinity%20was%20enabled%20following%20the%20document.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3C!--%20%2Fwp%3Alist%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3EEnable%20Cookie%20based%20affinity%20with%20an%20Application%20Gateway%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fapplication-gateway%2Fingress-controller-cookie-affinity%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-label%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapplication-gateway%2Fingress-controller-cookie-affinity%20(%E6%96%B0%E3%81%97%E3%81%84%E3%82%BF%E3%83%96%E3%81%A7%E9%96%8B%E3%81%8F)%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fapplication-gateway%2Fingress-controller-cookie-affinity%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20reconfigured%20component%20topology.%20This%20topology%20helped%20the%20customer%20reduce%20NVA%20related%20cost%20and%20operational%20cost.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212672iD603822C97E7742C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Alist%20--%3E%20%3C!--%20wp%3Aheading%20%7B%22level%22%3A3%7D%20--%3E%3C%2FP%3E%0A%3CP%3EIn%20this%20case%2C%20Azure%20Front%20Door%20as%20a%20public%20L7%20LB%20is%20not%20a%20good%20solution%20since%20the%20customer's%20system%20was%20not%20deployed%20to%20multiple%20regions.%20In%20other%20words%2C%20global%20service%20does%20not%20meet%20their%20requirement.%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20is%20Azure%20Front%20Door%20Service%3F%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Ffrontdoor%2Ffront-door-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-label%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Ffrontdoor%2Ffront-door-overview%20(%E6%96%B0%E3%81%97%E3%81%84%E3%82%BF%E3%83%96%E3%81%A7%E9%96%8B%E3%81%8F)%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fazure%2Ffrontdoor%2Ffront-door-overview%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20case%2C%20App%20GW%20features%20met%20their%20requirements%20for%20reverse%20proxy.%20If%20App%20GW%20does%20not%20meet%20customer%20requirements%20for%20reverse%20proxy%20(for%20example%2C%20reverse%20proxy%20for%20authentication%20gateway%20is%20required)%2C%20the%20following%20topology%20would%20be%20better.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212673i26E2203E4CBA51B3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%20%3C!--%20wp%3Aimage%20%7B%22id%22%3A3148%2C%22width%22%3A503%2C%22height%22%3A178%2C%22sizeSlug%22%3A%22large%22%7D%20--%3E%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aimage%20--%3E%20%3C!--%20wp%3Aheading%20%7B%22level%22%3A3%7D%20--%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1437137184%22%20id%3D%22toc-hId-1437137184%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--370317279%22%20id%3D%22toc-hId--370317279%22%3EConclusion%3C%2FH3%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aheading%20--%3E%20%3C!--%20wp%3Aparagraph%20--%3E%3C%2FP%3E%0A%3CP%3EThe%20following%20points%20are%20important%20when%20migrating%20existing%20systems%20to%20cloud.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EGood%20understanding%20of%20services%20you%20are%20using.%3C%2FLI%3E%0A%3CLI%3ESimple%20deployment%20topology.%20In%20other%20words%2C%20decrease%20the%20number%20of%20components%20you%20use.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EHope%20this%20helps.%3C%2FP%3E%0A%3CP%3E%3C!--%20%2Fwp%3Aparagraph%20--%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1591897%22%20slang%3D%22en-US%22%3E%3CP%3ESome%20customer%20had%20an%20issue%20about%20session%20affinity.%20I%20would%20like%20to%20summarise%20root%20cause%20of%20this%20issue%20and%20solutions%20in%20case%20of%20this%20customer's%20condition.%3C%2FP%3E%0A%3CP%3EJapanese%20edition%20is%20%3CA%20href%3D%22https%3A%2F%2Flogico-jp.io%2F2020%2F03%2F19%2Fconfigured-session-affinity-but%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1591897%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInfrastructure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Some customer asked me about the following issues they had faced. I would like to summarise root cause of this issue and solutions in case of this customer's condition.

Japanese edition is here.

 

What is the issue?

The customer asked some SI (system integration) partner to migrate their system to cloud in the form of "lift-and-shift", but session affinity did not work properly. Session affinity worked fine when system ran in their data center.

 

Environment and deployment topology

Their deployment topology was listed below. This issue occurred after migration completed. The customer did not deploy their system on multi-region.

  • Azure Load Balancer (ALB) : Traffic routing is based on protocol and client IP. 
  • Network virtual appliance  (NVA)
    • L7 Load Balancer (L7 LB) : Active-Active configuration.
    • Reverse Proxy (Apache HTTP server)
  • Virtual Machine (VM)
    • Packaged application
    • Database (Oracle)

Logico_jp_0-1597628615213.png

 

Additional requests from the customer were... 

We'd like to configure cookie based session affinity.

We'd like to achieve it as inexpensive as possible.

 

Situation

In case packaged application is hosted on Java EE application server, session affinity is typically configured using clustering of Java EE application server or session sharing with in-memory data grid or cache. However, they could not configure application server cluster since clustering was restricted against the edition they used.  And the SI partner deployed L7 LB NVA behind ALB to achieve session affinity, as the SI partner knew ALB did not have session affinity feature.

 

Let's imaging causes of this issue

There are many people who can imagine the root cause when looking at the deployment topology above. The following points should be checked.

  • Would source IP of inbound traffic to ALB (public) change? Specifically, would global IP be changed when transforming local IP to global IP using SNAT on customer site?
  • ALB does not have any feature for session affinity. Therefore, if source IP of inbound traffic is changed, the destination VM which hosts packaged application should change.
  • Would reverse proxy develop side effect?
  • Would L7 LB NVA which deploys behind ALB work as expected? Would session information be shared between both NVAs?

 

Root cause

This issue occurred due to the following causes.

  • Source IP of inbound traffic was sometimes changed due to SNAT.
  • When source IP was changed, ALB (public) recognized that this traffic came from another client and routed the traffic to another L7 LB NVA.
  • L7 LB NVAs were deployed behind ALB for session affinity, but they did not work expectedly since session information was not shared with the NVAs. When inbound traffic was routed to one L7 LB NVA, the L7 LB NVA did not have any way to identify session continuity. So, the NVA recognized that this traffic came from other client.

The following URL describes traffic distribution rule.

 

Configure the distribution mode for Azure Load Balancer
https://docs.microsoft.com/azure/load-balancer/load-balancer-distribution-mode

 

The following table is listed what happened in each component specifically.

Component What would happen?
ALB (Public) The fact of the matter is that traffic comes from the same client, but the traffic is sometimes NATed into other global IP. In this case, ALB (public) recognizes that this traffic comes from different client, and routes the traffic to any L7 LB NVAs. Therefore, chosen L7 LB NVA might be different from the one processed previous traffic from the same client.
L7 LB NVA If L7 LB NVAs are configured in the form of "Active-Active" but session information is not shared between L7 LB NVAs, no L7 LB NVA can identify whether or not the traffic comes from the same client. Therefore, L7 LB NVA can route traffic to any reverse proxy NVAs and chosen reverse proxy NVA might be different from the one processed previous traffic.
ALB (Internal) If a reverse proxy NVA where current traffic passed is different from the one processed previous traffic, ALB (Internal) recognizes that this traffic comes from different client since source IP is different, and routes the traffic to any internal L7 LB NVAs. Therefore, chosen L7 LB NVA might be different from the one processed previous traffic from the same client.
Internal L7 LB NVA This is the same as mentioned above.
Since session information is not shared between internal L7 LB NVAs, no internal L7 LB NVA can identify whether or not the traffic comes from the same client. Therefore, internal L7 LB NVA can route traffic to any VMs hosted packaged application and chosen VM might be different from the one processed previous traffic.
Packaged Application Traffic routing was not consistent due to reasons mentioned above, so traffic was sometimes routed to the VM which handled previous traffic, and at other times another traffic was routed to the different VM.

 

Solution

I commented points to be fixed and SI partner reconfigured component topology. After that, traffic was routed to an expected package application node.

  • ALB, L7 LB NVAs, and Reverse Proxy NVAs were replaced with Azure Application Gateway (App GW).
  • Cookie based affinity was enabled following the document.

Enable Cookie based affinity with an Application Gateway
https://docs.microsoft.com/azure/application-gateway/ingress-controller-cookie-affinity

 

Here is the reconfigured component topology. This topology helped the customer reduce NVA related cost and operational cost.

image.png

In this case, Azure Front Door as a public L7 LB is not a good solution since the customer's system was not deployed to multiple regions. In other words, global service does not meet their requirement.

 

What is Azure Front Door Service?
https://docs.microsoft.com/azure/frontdoor/front-door-overview

 

In this case, App GW features met their requirements for reverse proxy. If App GW does not meet customer requirements for reverse proxy (for example, reverse proxy for authentication gateway is required), the following topology would be better.

image.png

 

Conclusion

The following points are important when migrating existing systems to cloud.

  • Good understanding of services you are using.
  • Simple deployment topology. In other words, decrease the number of components you use.

Hope this helps.

1 Comment

Thanks for Sharing with the Community :cool: