%3CLINGO-SUB%20id%3D%22lingo-sub-1537892%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20API%20Management%20Gateway%20in%20Azure%20Stack%20Hub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1537892%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20article%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F433488%22%20target%3D%22_blank%22%3E%40rctibi%3C%2FA%3E!%20Thanks%20for%20sharing!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHappy%20Azure%20Stacking!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1537263%22%20slang%3D%22en-US%22%3EAzure%20API%20Management%20Gateway%20in%20Azure%20Stack%20Hub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1537263%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAs%20companies%20continue%20their%20cloud%20journey%2C%20they%20are%20more%20and%20more%20adopting%20a%20microservice%20architecture%20as%20part%20of%20their%20application%20modernization.%20In%20this%20blog%20post%2C%20we%20have%20Walter%20Oliver%20(%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fwalterov%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%40walterov%3C%2FA%3E)%20who%20is%20a%20Program%20Manager%20in%20the%20Azure%20Stack%20Hub%20team%20to%20explore%20how%26nbsp%3BAzure%20API%20Management%20Gateway%20on%20Azure%20Stack%20Hub%20can%20help%20in%20the%20hybrid%20strategy%20for%20these%20services.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWhile%20some%20of%20the%20applications%20are%20being%20deployed%20on%20Azure%2C%20companies%20face%20challenges%20with%20operational%20consistency%20when%20it%20comes%20to%20those%20apps%20that%20must%20remain%20on%20premises.%20That%20is%20one%20of%20the%20scenarios%20where%20Azure%20Stack%20Hub%20(ASH)%20can%20provide%20the%20platform%20where%20to%20host%20their%20on-premises%20applications%2C%20while%20keeping%20operational%20consistency.%20Enterprises%20are%20increasingly%20using%20Kubernetes%20on%20Azure%20Stack%20Hub%20as%20their%20choice%20for%20their%20microservices%2C%20as%20they%20seek%20increased%20autonomy%20for%20their%20development%20teams%2C%20flexibility%2C%20and%20modularity.%20But%20the%20process%20of%20decoupling%20single%20tier%20monolithic%20applications%20into%20smaller%20API%20services%20brings%20new%20problems%3A%20how%20do%20you%20know%20what%20are%20these%20services%3F%20Do%20they%20meet%20the%20security%20requirements%3F%20How%20are%20they%20accessed%20and%20monitored%3F%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAzure%20API%20Management%20(APIM)%20helps%20address%20these%20issues.%20APIM%20is%20part%20of%20the%20Microsoft%20hybrid%20strategy%2C%20it%20will%20help%20you%20in%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EPublishing%20a%20catalog%20of%20APIs%20available%20and%20control%20access%20to%20them%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EPreventing%20DOS%20attacks%20for%20externally%20available%20APIs%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EImplementing%20security%20policies%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EOnboarding%20the%20ISV%20partner%20ecosystem%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESupporting%20your%20microservices%20program%20with%20a%20robust%20internal%20API%20program%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%225%22%3EChallenges%20to%20API%20Management%20on%20Premises%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EHowever%2C%20since%20the%20Azure%20API%20Management%20service%20is%20on%20the%20cloud%2C%20utilizing%20it%20implies%20a%20round%20trip%20to%20the%20cloud%20and%20then%20to%20the%20on-premises%20service%20to%20service%20every%20call.%20In%20some%20cases%2C%20this%20is%20acceptable%2C%20but%20in%20many%20it%20is%20not%20(figure%201).%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_0-1595369145195.png%22%20style%3D%22width%3A%20572px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207020iFEEEB8DA77C1475F%2Fimage-dimensions%2F572x236%3Fv%3D1.0%22%20width%3D%22572%22%20height%3D%22236%22%20title%3D%22rctibi_0-1595369145195.png%22%20alt%3D%22rctibi_0-1595369145195.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%3EFigure%201.%20API%20Management%20without%20self-hosted%20gateway%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20solve%20it%20the%20Azure%20APIM%20team%20created%20the%20API%20Management%20self-hosted%20gateway.%20The%20self-hosted%20gateway%2C%20as%20the%20name%20implied%2C%20can%20be%20hosted%20locally%20in%20your%20data%20center%20(figure%202).%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22rctibi_1-1595369145212.png%22%20style%3D%22width%3A%20567px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207021i9AD9940B272D1EFA%2Fimage-dimensions%2F567x238%3Fv%3D1.0%22%20width%3D%22567%22%20height%3D%22238%22%20title%3D%22rctibi_1-1595369145212.png%22%20alt%3D%22rctibi_1-1595369145212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%3EFigure%202.%20API%20Management%20with%20self-hosted%20gateway%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-497983814%22%20id%3D%22toc-hId-497983814%22%20id%3D%22toc-hId-497983814%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%225%22%3ERunning%20the%20Self-hosted%20Gateway%20in%20Azure%20Stack%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20APIM%E2%80%99s%20self-hosted%20gateway%20feature%20enables%20Azure%20Stack%20Hub%20customers%20(and%20customers%20in%20general)%20to%20manage%20their%20on-premises%20microservices%20APIs%20on%20a%20central%20portal%20in%20Azure.%20The%20self-hosted%20gateway%20is%20a%20containerized%2C%20functionally%20equivalent%20version%20of%20the%20managed%20gateway%20deployed%20to%20Azure%20as%20part%20of%20every%20API%20Management%20service.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENow%20you%20can%20deploy%20it%20inside%20Azure%20Stack%20Hub%20as%20a%20Linux%20-based%20Docker%20container%20from%20the%20Microsoft%20Container%20Registry.%20This%20means%20that%20you%20can%20hosted%20inside%20the%20AKS-engine-deployed%20Kubernetes%20cluster%20inside%20ASH.%20In%20cases%20where%20you%20have%20microservices%20APIs%20exposed%20to%20applications%20inside%20the%20Kubernetes%20cluster%20all%20the%20calls%20happen%20locally%20with%20minimal%20latency%20and%20no%20extra%20data%20transfer%20costs.%20More%20importantly%2C%20it%20also%20ensures%20that%20compliance%20is%20maintained%20since%20there%20are%20not%20round%20trips%20to%20Azure.%20Yet%2C%20all%20the%20benefits%20of%20utilizing%20APIM%20from%20Azure%20remain%3A%20single%20point%20of%20management%2C%20observability%2C%20and%20discovery%20of%20all%20APIs%20within%20the%20organization.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3EBefore%20you%20attempt%20to%20deploy%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3Ethe%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3Eself%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3E-hosted%20gateway%2C%20you%20need%20to%20have%20a%20Kubernetes%20cluster.%20You%20can%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3Edeploy%20one%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3E%26nbsp%3Bby%20using%20the%20AKS%20engine%20on%20Azure%20Stack%20Hub%2C%20foll%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3Eow%20the%20instructions%20provided%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CA%20class%3D%22Hyperlink%20SCXW50187669%20BCX8%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure-stack%2Fuser%2Fazure-stack-kubernetes-aks-engine-overview%3Fview%3Dazs-2002%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20class%3D%22TextRun%20Underlined%20SCXW50187669%20BCX8%22%20data-contrast%3D%22none%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%20data-ccp-charstyle%3D%22Hyperlink%22%3Ehere%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3E%26nbsp%3Bfor%20installing%20and%20managing%20Kubernetes%20cluster%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3Es%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW50187669%20BCX8%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW50187669%20BCX8%22%3E.%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3EFor%20complete%20documentation%20on%20AIPM%20self-hosted%20gateway%20see%20the%20overview%20%5B%23%24dp60%5D%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fself-hosted-gateway-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20To%20provision%20the%20gateway%20in%20APIM%20in%20Azure%20follow%20the%20instructions%20%5B%23%24dp59%5D%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-howto-provision-self-hosted-gateway%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20To%20deploy%20the%20gateway%20containers%20in%20Kubernetes%20follow%20the%20instructions%20%5B%23%24dp62%5D%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fhow-to-deploy-self-hosted-gateway-kubernetes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%225%22%3EConsiderations%20when%20running%20the%20gateway%20in%20Azure%20Stack%20Hub%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EA%20common%20question%20is%20whether%20there%20is%20a%20need%20for%20opening%20ports%20for%20inbound%20connectivity%2C%20the%20answer%20is%20no.%20Self-hosted%20gateway%20only%20requires%20outbound%20TCP%2FIP%20connectivity%20to%20Azure%20on%20port%20443%2C%20it%20follows%20a%20pull%20model%2C%20not%20a%20push%20model%20for%20communication.%20Connectivity%20is%20required%20so%20that%20information%20such%20as%20health%20reporting%2C%20updates%2C%20events%2C%20logs%2C%20and%20metrics%20can%20be%20transferred.%20This%20also%20implies%20that%20when%20there%20is%20no%20communication%20with%20Azure%2C%20the%20data%20does%20not%20flow%2C%20yet%20the%20gateway%20continues%20to%20operate%20as%20expected.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EWhen%20running%20the%20gateway%20container%20in%20your%20Kubernetes%20cluster%20with%20the%20configuration%20backup%20option%2C%20you%20will%20notice%20an%20extra%20managed%20disk%20being%20created%20in%20the%20cluster%2C%20this%20is%20the%20disk%20where%20the%20configuration%20backup%20is%20stored.%20This%20is%20particularly%20useful%20in%20case%20that%20connection%20to%20Azure%20can%20become%20unavailable.%20Notice%20that%20the%20gateway%20container%20is%20not%20meant%20to%20be%20run%20on%20an%20ASH%20stamp%20that%20will%20be%20disconnected%20from%20the%20internet%20or%20is%20planned%20to%20be%20disconnected%20most%20of%20the%20time.%20In%20fact%2C%20if%20the%20stamp%20is%20disconnected%20temporarily%20and%20for%20some%20reason%20the%20gateway%20container%20is%20stopped%2C%20Kubernetes%20will%20try%20to%20restart%20it%20but%20if%20the%20option%20of%20running%20with%20backup%20configuration%20was%20off%2C%20it%20will%20fail.%20In%20those%20cases%2C%20you%20need%20to%20ensure%20that%20connectivity%20to%20Azure%20is%20restored.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EAnother%20question%20is%20whether%20that%20Gateway%20container%20automatically%20discovers%20the%20available%20APIs.%20The%20answer%20is%20that%20they%20are%20not%2C%20you%20must%20explicitly%20go%20to%20the%20Azure%20APIM%20portal%20and%20register%20the%20APIs%20you%20need%20to%20manage.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EIn%20the%20case%20that%20you%20have%20APIs%20in%20another%20Kubernetes%20cluster%20(or%20anywhere%20in%20your%20data%20center)%20that%20you%20would%20like%20to%20manage%20you%20can%20publish%20them%20via%20the%20same%20gateway%20container%20or%20provision%20and%20deploy%20another%20gateway%20instance%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EDeploying%20a%20new%20microservice%20and%20publishing%20its%20API%20or%20applying%20changes%20to%20an%20existing%20one%20is%20something%20that%20is%20better%20formalized%20in%20a%20CI%2FCD%20Pipeline.%20Getting%20familiarized%20with%20the%20available%20operations%20will%20be%20useful%2C%20see%20the%20reference%20-ERR%3AREF-NOT-FOUND-here.%20For%20a%20guide%20on%20how%20to%20architect%20a%20CI%2FCD%20pipeline%20with%20corresponding%20repo%20see%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fapimanagement%2F2019-12-01%2Fgateway%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eblog%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%225%22%3ESummary%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAzure%E2%80%99s%20API%20Management%20service%20is%20very%20helpful%20for%20managing%20large%20microservices%20deployments%2C%20now%20the%20self-hosted%20APIM%20Gateway%20makes%20it%20very%20appealing%20for%20including%20APIs%20deployed%20on%20premises.%20The%20documentation%20provided%20online%20in%20Azure%20covers%20the%20basic%20concepts%2C%20provisioning%2C%20and%20deploying%20of%20self-hosted%20gateways%2C%20the%20summary%20provided%20above%20is%20an%20introduction%20to%20the%20subject%20tailored%20to%20Azure%20Stack%20Hub%20customers.%20Subsequent%20posts%20will%20include%20a%20sample%20deployment%20of%20an%20API%20and%20its%20publishing%20through%20APIM%20on%20Azure.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1607912%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20API%20Management%20Gateway%20in%20Azure%20Stack%20Hub%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1607912%22%20slang%3D%22en-US%22%3E%3CP%3EVery%20informative%2C%20thank%20you%20Tibi%20!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

 

As companies continue their cloud journey, they are more and more adopting a microservice architecture as part of their application modernization. In this blog post, we have Walter Oliver (@walterov) who is a Program Manager in the Azure Stack Hub team to explore how Azure API Management Gateway on Azure Stack Hub can help in the hybrid strategy for these services.

 

While some of the applications are being deployed on Azure, companies face challenges with operational consistency when it comes to those apps that must remain on premises. That is one of the scenarios where Azure Stack Hub (ASH) can provide the platform where to host their on-premises applications, while keeping operational consistency. Enterprises are increasingly using Kubernetes on Azure Stack Hub as their choice for their microservices, as they seek increased autonomy for their development teams, flexibility, and modularity. But the process of decoupling single tier monolithic applications into smaller API services brings new problems: how do you know what are these services? Do they meet the security requirements? How are they accessed and monitored?

Azure API Management (APIM) helps address these issues. APIM is part of the Microsoft hybrid strategy, it will help you in:

  1. Publishing a catalog of APIs available and control access to them
  2. Preventing DOS attacks for externally available APIs
  3. Implementing security policies
  4. Onboarding the ISV partner ecosystem
  5. Supporting your microservices program with a robust internal API program

 

Challenges to API Management on Premises

However, since the Azure API Management service is on the cloud, utilizing it implies a round trip to the cloud and then to the on-premises service to service every call. In some cases, this is acceptable, but in many it is not (figure 1).

 

rctibi_0-1595369145195.png

Figure 1. API Management without self-hosted gateway

 

To solve it the Azure APIM team created the API Management self-hosted gateway. The self-hosted gateway, as the name implied, can be hosted locally in your data center (figure 2).

rctibi_1-1595369145212.png

Figure 2. API Management with self-hosted gateway

 

 

Running the Self-hosted Gateway in Azure Stack

The APIM’s self-hosted gateway feature enables Azure Stack Hub customers (and customers in general) to manage their on-premises microservices APIs on a central portal in Azure. The self-hosted gateway is a containerized, functionally equivalent version of the managed gateway deployed to Azure as part of every API Management service.

 

Now you can deploy it inside Azure Stack Hub as a Linux -based Docker container from the Microsoft Container Registry. This means that you can hosted inside the AKS-engine-deployed Kubernetes cluster inside ASH. In cases where you have microservices APIs exposed to applications inside the Kubernetes cluster all the calls happen locally with minimal latency and no extra data transfer costs. More importantly, it also ensures that compliance is maintained since there are not round trips to Azure. Yet, all the benefits of utilizing APIM from Azure remain: single point of management, observability, and discovery of all APIs within the organization.

 

Before you attempt to deploy the self-hosted gateway, you need to have a Kubernetes cluster. You can deploy one by using the AKS engine on Azure Stack Hub, follow the instructions provided here for installing and managing Kubernetes clustersFor complete documentation on AIPM self-hosted gateway see the overview here. To provision the gateway in APIM in Azure follow the instructions here. To deploy the gateway containers in Kubernetes follow the instructions here.

 

Considerations when running the gateway in Azure Stack Hub

  • A common question is whether there is a need for opening ports for inbound connectivity, the answer is no. Self-hosted gateway only requires outbound TCP/IP connectivity to Azure on port 443, it follows a pull model, not a push model for communication. Connectivity is required so that information such as health reporting, updates, events, logs, and metrics can be transferred. This also implies that when there is no communication with Azure, the data does not flow, yet the gateway continues to operate as expected.
  • When running the gateway container in your Kubernetes cluster with the configuration backup option, you will notice an extra managed disk being created in the cluster, this is the disk where the configuration backup is stored. This is particularly useful in case that connection to Azure can become unavailable. Notice that the gateway container is not meant to be run on an ASH stamp that will be disconnected from the internet or is planned to be disconnected most of the time. In fact, if the stamp is disconnected temporarily and for some reason the gateway container is stopped, Kubernetes will try to restart it but if the option of running with backup configuration was off, it will fail. In those cases, you need to ensure that connectivity to Azure is restored.
  • Another question is whether that Gateway container automatically discovers the available APIs. The answer is that they are not, you must explicitly go to the Azure APIM portal and register the APIs you need to manage.
  • In the case that you have APIs in another Kubernetes cluster (or anywhere in your data center) that you would like to manage you can publish them via the same gateway container or provision and deploy another gateway instance
  • Deploying a new microservice and publishing its API or applying changes to an existing one is something that is better formalized in a CI/CD Pipeline. Getting familiarized with the available operations will be useful, see the reference here. For a guide on how to architect a CI/CD pipeline with corresponding repo see this blog.

 

Summary

Azure’s API Management service is very helpful for managing large microservices deployments, now the self-hosted APIM Gateway makes it very appealing for including APIs deployed on premises. The documentation provided online in Azure covers the basic concepts, provisioning, and deploying of self-hosted gateways, the summary provided above is an introduction to the subject tailored to Azure Stack Hub customers. Subsequent posts will include a sample deployment of an API and its publishing through APIM on Azure.

 

2 Comments
Senior Member

Great article @rctibi! Thanks for sharing!

 

Happy Azure Stacking!!!

Occasional Visitor

Very informative, thank you Tibi !