%3CLINGO-SUB%20id%3D%22lingo-sub-1774232%22%20slang%3D%22en-US%22%3ECustom%20Origin%2C%20Azure%20CDN%20and%20Vegeta%20Attack%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1774232%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1238105582%22%20id%3D%22toc-hId--1238105582%22%20id%3D%22toc-hId--1238105582%22%20id%3D%22toc-hId--1238105582%22%3EAbstract%3C%2FH2%3E%3CP%3EAzure%20services%20are%20always%20misunderstood%20that%2C%20they%20can%20be%20used%20only%20with%20Native%20Azure%20offerings.%20This%20is%20not%20true.%20It%20is%20surprising%20to%20see%20people%20make%20this%20perception%20so%20easily.%20Azure%20CDN%20is%20no%20exception%20for%20this%20perception.%20Well%2C%20Azure%20CDN%20can%20be%20used%20for%20Azure%20services%20and%20for%20any%20other%20cloud%20vendors%20and%20even%20for%20on%20premises%20workloads%20as%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20common%20question%20I%20get%20is%2C%20%E2%80%9CIf%20I%20have%20Azure%20VM%20hosted%20website%2C%20how%20can%20I%20use%20Azure%20CDN%20on%20top%20of%20it%3F%20I%20am%20not%20using%2F%20don%E2%80%99t%20want%20to%20use%20Azure%20blob%20storage.%20Can%20I%20still%20use%20CDN%20for%20files%20sources%20from%20web%20application%3F%20If%20yes%2C%20how%3F%E2%80%9D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20article%20where%20we%20will%20explore%20how%20can%20you%20use%20Azure%20CDN%20with%20IIS%20hosted%20sample%20website%20on%20Azure%20VM%20and%20then%20check%20the%20performance%20of%20the%20website%20using%20recently%20wrote%20approach%20of%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-architecture-blog%2Fvegeta-attack-and-azure-container-instance%2Fba-p%2F1754254%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EVegeta%20Attack%20load%20test.%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%E2%80%99s%20cache!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1249407251%22%20id%3D%22toc-hId-1249407251%22%20id%3D%22toc-hId-1249407251%22%20id%3D%22toc-hId-1249407251%22%3EOrigin%20for%20Azure%20CDN%3C%2FH2%3E%3CP%3EWe%20should%20be%20clear%20what%20is%20going%20to%20be%20origin%20for%20CDN%20deployment.%20Origin%20simply%20means%20source%20location%20from%20where%20CDN%20will%20pickup%20publicly%20available%20static%20files%20and%20contents%20and%2C%20cache%20it%20for%20faster%20access.%20In%20our%20case%20the%20origin%20is%20going%20to%20be%20Azure%20VM%20and%20one%20static%20image%20that%20we%20will%20access%20from%20CDN.%20By%20default%2C%20Azure%20CDN%20can%20have%20native%20Azure%20services%20as%20Origin%20as%20listed%20below%20%E2%80%93%3C%2FP%3E%3COL%3E%3CLI%3EAzure%20Storage%3C%2FLI%3E%3CLI%3EAzure%20App%20Services%20%E2%80%93%20web%20app%3C%2FLI%3E%3CLI%3EAzure%20Cloud%20Service%20%E2%80%93%20Web%20role%20deployments%3C%2FLI%3E%3C%2FOL%3E%3CP%3EAnything%20beyond%20above%20list%20must%20be%20%E2%80%9CCustom%20Origin%E2%80%9D.%20The%20sample%20list%20of%20custom%20origins%20can%20be%20as%20follows%20%E2%80%93%3C%2FP%3E%3CP%3EPublic%2F%20Internet%20facing%20content%20from%20%E2%80%93%3C%2FP%3E%3COL%3E%3CLI%3Eon%20Premise%20hosted%20Application%3C%2FLI%3E%3CLI%3EAzure%20VM%20hosted%20application%3C%2FLI%3E%3CLI%3EAWS%20hosted%20applications.%3C%2FLI%3E%3CLI%3EGCP%20hosted%20applications%3C%2FLI%3E%3C%2FOL%3E%3CP%3EAnd%20so%20on.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId--558047212%22%20id%3D%22toc-hId--558047212%22%20id%3D%22toc-hId--558047212%22%20id%3D%22toc-hId--558047212%22%3EArchitecture%20of%20implementation%3C%2FH2%3E%3CP%3EWith%20above%20understanding%20of%20custom%20origin%20for%20Azure%20CDN%20let%20us%20have%20a%20look%20at%20the%20architecture%20we%20are%20trying%20to%20implement%20as%20a%20part%20of%20this%20article.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Architecture.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226242iD3D2E41C9D8365A5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Architecture.png%22%20alt%3D%22Custom%20Origin%20Architecture%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECustom%20Origin%20Architecture%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20we%20have%20one%20Azure%20VM%20with%20IIS%20default%20website%20running%20on%20port%2080.%20We%20will%20configure%20the%20public%20IP%20of%20this%20Azure%20VM%20as%20%E2%80%9CCustom%20Origin%E2%80%9D%20in%20Azure%20CDN.%20Then%20run%20Vegeta%20Attack%20load%20test%20on%20Origin%20based%20URL%20and%20CDN%20based%20URL%20to%20see%20the%20different%20in%20performance%20in%20terms%20of%20latency%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1929465621%22%20id%3D%22toc-hId-1929465621%22%20id%3D%22toc-hId-1929465621%22%20id%3D%22toc-hId-1929465621%22%3ECreating%20Azure%20CDN%20with%20Custom%20Origin%3C%2FH2%3E%3CP%3EI%20already%20have%20created%20Azure%20VM%2C%20subnet%2C%20VNET%2C%20and%20configured%20IIS%20based%20default%20website%20along%20with%20public%20IP%2C%20also%20added%20sample%20image%20we%20plan%20to%20access%20through%20CDN.%20While%20creating%20Azure%20CDN%20make%20sure%20you%20select%20%E2%80%9CCustom%20Origin%E2%80%9D%20option%20provide%20public%20IP%20of%20website%20which%20we%20use%20for%20accessing%20it%20over%20internet.%20Refer%20below%20%E2%80%93%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Create%20CDN%20custom%20origin.png%22%20style%3D%22width%3A%20586px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226243i2C6DEE1089418F54%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Create%20CDN%20custom%20origin.png%22%20alt%3D%22Create%20CDN%20custom%20origin.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENotice%20below%20screenshot.%20I%20have%20not%20added%20%E2%80%9COrigin%20Path%E2%80%9D%20value%20and%20kept%20it%20empty.%20Similarly%2C%20for%20hist%20header%20it%20is%20empty.%20When%20I%20had%20added%20%E2%80%9Corigin%20path%E2%80%9D%20value%20Azure%20CDN%20URL%20was%20throwing%20error%20of%20404.%20I%20removed%20it%20and%20it%20worked.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Empty%20Path.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226244i646D3048DB9D61CC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Empty%20Path.png%22%20alt%3D%22Empty%20Path.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20this%20configuration%20if%20I%20access%20the%20CDN%20URL%20I%20see%20an%20image%20being%20loaded.%20Similarly%2C%20if%20I%20access%20origin%20URL%20the%20same%20image%20being%20loaded.%20Refer%20below%20%E2%80%93%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image%20load.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226245iDDBB99A7EFDA4EA1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image%20load.png%22%20alt%3D%22image%20load.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId-122011158%22%20id%3D%22toc-hId-122011158%22%20id%3D%22toc-hId-122011158%22%20id%3D%22toc-hId-122011158%22%3EVegeta%20Attack%20on%20Azure%20CDN%20and%20Origin%20URL%3C%2FH2%3E%3CP%3EI%20am%20using%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-architecture-blog%2Fvegeta-attack-and-azure-container-instance%2Fba-p%2F1754254%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EVegeta%20Attack%20with%20Azure%20Container%20Instances%3C%2FA%3E%20to%20generate%20load%20against%20both%20URLs%20%E2%80%93%20CDN%20and%20Origin%20URL%20and%20below%20are%20the%20results%20%E2%80%93%3C%2FP%3E%3CH3%20id%3D%22toc-hId-812572632%22%20id%3D%22toc-hId-812572632%22%20id%3D%22toc-hId-812572632%22%20id%3D%22toc-hId-812572632%22%3EOrigin%20Test%20%E2%80%93%3C%2FH3%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Origin%20Vegeta.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226246i727FFE915DB22954%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Origin%20Vegeta.png%22%20alt%3D%22Origin%20Vegeta.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId--994881831%22%20id%3D%22toc-hId--994881831%22%20id%3D%22toc-hId--994881831%22%20id%3D%22toc-hId--994881831%22%3ECDN%20Test%20-%3C%2FH3%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CDN%20Vegeta.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226247i3B62CA2F433B3D42%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22CDN%20Vegeta.png%22%20alt%3D%22CDN%20Vegeta.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EClearly%20CDN%20based%20responses%20are%20clear%20win!%20CDN%20based%20responses%20are%20not%20even%20crossing%201%20second%20where%20Origin%20URL%20is%20going%20to%2011%20seconds%20sometimes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId--1005384935%22%20id%3D%22toc-hId--1005384935%22%20id%3D%22toc-hId--1005384935%22%20id%3D%22toc-hId--1005384935%22%3EAzure%20CDN%20with%20Azure%20File%20Storage%3C%2FH2%3E%3CP%3EThis%20another%20common%20question%20I%20get%20for%20Azure%20CDN.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E2%80%9CCan%20I%20use%20Azure%20Files%20for%20Azure%20CDN%E2%80%9D%3F%3C%2FP%3E%3CP%3EAnswer%20is%3A%20Yes%2C%20you%20can.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20there%20is%20a%20catch.%20There%20is%20always%20a%20catch.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAzure%20Files%20is%20a%20SMB%20thing%20which%20can%E2%80%99t%20be%20accessed%20directly%20over%20internet.%20It%20requires%20%E2%80%9CAuthentication%E2%80%9D.%20If%20you%20access%20Azure%20Files%20base%20URL%20there%20is%20no%20way%20how%20you%20can%20perform%20the%20%E2%80%9Cauthentication%E2%80%9D%20to%20access%20the%20Azure%20Files%20hosted%20content.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20when%20you%20want%20to%20access%20Azure%20Files%20contents%20from%20Azure%20CDN%20you%20need%20to%20take%20care%20of%20Authentication%20while%20calling%20from%20Azure%20CDN.%20Therefore%2C%20the%20way%20we%20can%20use%20Azure%20Blob%20public%20blob%2Fcontainer%20in%20Azure%20CDN%3B%20Azure%20files%20can%E2%80%99t%20be%20accessed%20directly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20cater%20to%20requirement%20of%20authentication%20to%20access%20Azure%20Files%20you%20need%20to%20use%20web%20application.%20So%2C%20create%20a%20web%20application%2C%20use%20Azure%20Files%20authentication%20inside%20it%20to%20allow%20access%20to%20Azure%20File%20Share%20contents%20and%20then%20refer%20those%20contents%20in%20Azure%20CDN.%20Of%20course%2C%20you%20will%20have%20to%20use%20%E2%80%9CCustom%20Origin%E2%80%9D%20in%20this%20case%20mapping%20to%20Web%20application%20domain%20or%20IP%20address.%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1482127898%22%20id%3D%22toc-hId-1482127898%22%20id%3D%22toc-hId-1482127898%22%20id%3D%22toc-hId-1482127898%22%3ETesting%20Hops%3C%2FH2%3E%3CP%3EBack%20in%202011%20I%20wrote%20two%20articles%20on%20CDN%20basics%20%E2%80%93%20%3CA%20href%3D%22https%3A%2F%2Fwww.sanganakauthority.com%2F2011%2F09%2Fusing-windows-azure-content-delivery.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fwww.sanganakauthority.com%2F2011%2F09%2Fwhat-is-azure-cdn-azure-content.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20of%20the%20articles%20talks%20about%20Hops%20used%20for%20reaching%20to%20destination%20and%20this%20test%20is%20still%20valid%20to%20learn%20performance%20improvement%20from%20CDN%20while%20using%20Custom%20Origin.%20This%20is%20also%20a%20very%20good%20option%20to%20showcase%20CDN%20performance%20boost.%3C%2FP%3E%3CH2%20id%3D%22toc-hId--325326565%22%20id%3D%22toc-hId--325326565%22%20id%3D%22toc-hId--325326565%22%20id%3D%22toc-hId--325326565%22%3EConclusion%3C%2FH2%3E%3CP%3EHope%20this%20article%20gave%20you%20good%20understanding%20on%20approach%20of%20using%20Azure%20CDN%20with%20other%20backends%20using%20%E2%80%9CCustom%20Origin%E2%80%9D%20feature.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1774232%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20my%20static%20content%20to%20load%20faster%20than%20this%20Turtle%E2%80%99s%20speed.%20What%20is%20my%20option%20and%20how%20do%20I%20test%20it%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Turtle%20speed.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F226240i3DE97513B112F241%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Turtle%20speed.jpg%22%20alt%3D%22Turtle%20speed.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1774232%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECDN%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDevOps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInfrastructure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1785783%22%20slang%3D%22en-US%22%3ERe%3A%20Custom%20Origin%2C%20Azure%20CDN%20and%20Vegeta%20Attack%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1785783%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F750181%22%20target%3D%22_blank%22%3E%40kunalchandratre%3C%2FA%3E%26nbsp%3B%20very%20interesting%20blog%20post.%3C%2FP%3E%3CP%3Ewe%20are%20experimenting%20on%20accelerate%20on%20premise%20customers%20web%20sites%20with%20azure%20CDN%20and%20this%20post%20is%20very%20enlightening.%3C%2FP%3E%3CP%3EI%20wonder%20if%20the%20approach%20works%20also%20with%20https%20and%20sni%20involved%20in%20a%20scenario%20where%20on%20the%20custom%20origin%20the%20vm%20offers%20several%20sites%20with%20different%20hostnames%20and%20TLS.%20Is%20azure%20CDN%20capable%20of%20passing%20sni%20requests%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eandrea%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

Abstract

Azure services are always misunderstood that, they can be used only with Native Azure offerings. This is not true. It is surprising to see people make this perception so easily. Azure CDN is no exception for this perception. Well, Azure CDN can be used for Azure services and for any other cloud vendors and even for on premises workloads as well.

 

The common question I get is, “If I have Azure VM hosted website, how can I use Azure CDN on top of it? I am not using/ don’t want to use Azure blob storage. Can I still use CDN for files sources from web application? If yes, how?”

 

This is the article where we will explore how can you use Azure CDN with IIS hosted sample website on Azure VM and then check the performance of the website using recently wrote approach of Vegeta Attack load test.

 

Let’s cache!

 

Origin for Azure CDN

We should be clear what is going to be origin for CDN deployment. Origin simply means source location from where CDN will pickup publicly available static files and contents and, cache it for faster access. In our case the origin is going to be Azure VM and one static image that we will access from CDN. By default, Azure CDN can have native Azure services as Origin as listed below –

  1. Azure Storage
  2. Azure App Services – web app
  3. Azure Cloud Service – Web role deployments

Anything beyond above list must be “Custom Origin”. The sample list of custom origins can be as follows –

Public/ Internet facing content from –

  1. on Premise hosted Application
  2. Azure VM hosted application
  3. AWS hosted applications.
  4. GCP hosted applications

And so on.

 

Architecture of implementation

With above understanding of custom origin for Azure CDN let us have a look at the architecture we are trying to implement as a part of this article.

 

Custom Origin ArchitectureCustom Origin Architecture

 

So, we have one Azure VM with IIS default website running on port 80. We will configure the public IP of this Azure VM as “Custom Origin” in Azure CDN. Then run Vegeta Attack load test on Origin based URL and CDN based URL to see the different in performance in terms of latency etc.

 

Creating Azure CDN with Custom Origin

I already have created Azure VM, subnet, VNET, and configured IIS based default website along with public IP, also added sample image we plan to access through CDN. While creating Azure CDN make sure you select “Custom Origin” option provide public IP of website which we use for accessing it over internet. Refer below –

 

Create CDN custom origin.png

 

Notice below screenshot. I have not added “Origin Path” value and kept it empty. Similarly, for hist header it is empty. When I had added “origin path” value Azure CDN URL was throwing error of 404. I removed it and it worked.

 

Empty Path.png

 

After this configuration if I access the CDN URL I see an image being loaded. Similarly, if I access origin URL the same image being loaded. Refer below –

 

image load.png

 

Vegeta Attack on Azure CDN and Origin URL

I am using Vegeta Attack with Azure Container Instances to generate load against both URLs – CDN and Origin URL and below are the results –

Origin Test –

Origin Vegeta.png

 

CDN Test -

CDN Vegeta.png

 

Clearly CDN based responses are clear win! CDN based responses are not even crossing 1 second where Origin URL is going to 11 seconds sometimes.

 

Azure CDN with Azure File Storage

This another common question I get for Azure CDN.

 

“Can I use Azure Files for Azure CDN”?

Answer is: Yes, you can.

 

However, there is a catch. There is always a catch.

 

Azure Files is a SMB thing which can’t be accessed directly over internet. It requires “Authentication”. If you access Azure Files base URL there is no way how you can perform the “authentication” to access the Azure Files hosted content.

 

So, when you want to access Azure Files contents from Azure CDN you need to take care of Authentication while calling from Azure CDN. Therefore, the way we can use Azure Blob public blob/container in Azure CDN; Azure files can’t be accessed directly.

 

To cater to requirement of authentication to access Azure Files you need to use web application. So, create a web application, use Azure Files authentication inside it to allow access to Azure File Share contents and then refer those contents in Azure CDN. Of course, you will have to use “Custom Origin” in this case mapping to Web application domain or IP address.

Testing Hops

Back in 2011 I wrote two articles on CDN basics – here and here.

 

One of the articles talks about Hops used for reaching to destination and this test is still valid to learn performance improvement from CDN while using Custom Origin. This is also a very good option to showcase CDN performance boost.

Conclusion

Hope this article gave you good understanding on approach of using Azure CDN with other backends using “Custom Origin” feature.

 

2 Comments

@kunalchandratre  very interesting blog post.

we are experimenting on accelerate on premise customers web sites with azure CDN and this post is very enlightening.

I wonder if the approach works also with https and sni involved in a scenario where on the custom origin the vm offers several sites with different hostnames and TLS. Is azure CDN capable of passing sni requests?

 

thanks

 

andrea

Senior Member