%3CLINGO-SUB%20id%3D%22lingo-sub-1502056%22%20slang%3D%22en-US%22%3EAPI%20Management%20-%20Networking%20FAQs%20(Demystifying%20Series%20II)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502056%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20a%20continuation%20of%20demystifying%20common%20issues%20faced%20while%20integrating%20API%20Management%20instance%20in%20a%20virtual%20network.%20You%20can%20find%20part-I%20%3CA%20title%3D%22API%20Management%20-%20Networking%20FAQs%20(Demystifying%20Series%20I)%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-paas-developer-blog%2Fapi-management-networking-faqs-demystifying-series-i%2Fba-p%2F1500996%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EFAQ%20Scenarios%3C%2FSTRONG%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22%23b1%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EAPIM%20with%20Azure%20Firewall%3C%2FSTRONG%3E%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22%23b2%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EUsing%20custom%20DNS%20with%20APIM%3C%2FSTRONG%3E%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22%23b3%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSTRONG%3EForce%20tunneling%20traffic%20from%20Azure%20to%20on-premises%20over%20ExpressRoute%20or%20VPN%3C%2FSTRONG%3E%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22b1%22%20id%3D%22toc-hId--1301733298%22%20id%3D%22toc-hId--1301733298%22%3E%3CSTRONG%3EAPIM%20with%20Azure%20Firewall%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3EAPI%20Management%20instance%20can%20be%20configured%20to%20run%20in%20a%20VNET%20internal%20or%20external%20mode.%20Azure%20Firewall%20can%20be%20used%20to%20control%20and%20monitor%20the%20APIM%20subnet%20traffic.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ECan%20you%20run%20APIM%20in%20VNET%20external%20mode%20with%20user-defined%20route%20forcing%20default%20traffic%20to%20Azure%20firewall%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENo%3C%2FSTRONG%3E.%20This%20configuration%20will%20not%20work%20as%20client%20will%20try%20to%20access%20API%20Management%20Gateway%2Fproxy%20on%20its%20public%20IP%20address%20but%20the%20response%20from%20API%20Management%20Gateway%20will%20be%20forwarded%20to%20Azure%20Firewall.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Azure%20Firewall%20being%20fully-stateful%20will%20drop%20the%20response%20traffic.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EScenario%3C%2FSTRONG%3E%3A%20Forcing%20APIM%20subnet%20traffic%20through%20Azure%20Firewall%20using%20user-defined%20routes.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20monitoring%20purposes%2C%20we%20create%20user-defined%20routes%20to%20point%20default%20traffic%20(0.0.0.0%2F0)%20from%20API%20subnet%20to%20Azure%20Firewall.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_1-1593625581919.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202677i25EF3FBCCF0CC19F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_1-1593625581919.png%22%20alt%3D%22karthikeyanRamasamy_1-1593625581919.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERoute%20table%20having%20user-defined%20route%20(named%20FW)%20pointing%20default%20traffic%20(denoted%20with%20address%20prefix%20as%200.0.0.0%2F0)%20to%20the%20next%20hop%20as%20Azure%20Firewall.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_2-1593625581924.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202678iEA36E59FE90AED13%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_2-1593625581924.png%22%20alt%3D%22karthikeyanRamasamy_2-1593625581924.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20above%20rule%2C%20management%20traffic%20(managing%20the%20APIM%20configuration%20using%20Azure%20portal%20or%20PowerShell)%20response%20is%20also%20forced%20through%20Azure%20Firewall.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20above%20configuration%20in%20place%2C%20you%20observe%20that%20API%20are%20not%20loaded%20and%20keep%20on%20loading%20the%20page.%20If%20you%20inspect%20the%20network%20trace%2C%20you%20will%20observe%20the%20Management%20endpoint%20not%20reachable%20error.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_3-1593625581932.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202679i6407CFCBF75EB7E0%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_3-1593625581932.png%22%20alt%3D%22karthikeyanRamasamy_3-1593625581932.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EError%20message%20in%20the%20developer%20console%3C%2FP%3E%0A%3CP%3E%3CEM%3EFailed%20to%20connect%20to%20management%20endpoint%20%3CSTRONG%3Eservicename%3C%2FSTRONG%3E.management.azure-api.net%3A3443%20for%20a%20service%20deployed%20in%20a%20Virtual%20Network.%20Make%20sure%20to%20follow%20guidance%20at%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fapim-vnet-common-issues%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fapim-vnet-common-issues%3C%2FA%3E.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_4-1593625581942.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202683iE55626F3334E2E38%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_4-1593625581942.png%22%20alt%3D%22karthikeyanRamasamy_4-1593625581942.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESolution%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWe%20must%20route%20the%20management%20endpoint%20response%20traffic%20directly%20to%20internet%20to%20avoid%20response%20traffic%20getting%20dropped%20by%20Azure%20Firewall.%3C%2FP%3E%0A%3CP%3EThis%20can%20be%20achieved%20by%20adding%20routes%20in%20the%20route%20table%20associated%20with%20APIM%20subnet.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_5-1593625581945.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202681i5150FDAD82977EB5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_5-1593625581945.png%22%20alt%3D%22karthikeyanRamasamy_5-1593625581945.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20must%20add%20user%20defined%20routes%20for%20the%20control%20plane%20IP%20address%20with%20next%20hop%20as%20internet.%20The%20above%20image%20shows%20routes%20for%20global%20control%20plane%20IP%20address%20and%20region-specific%20IP%20address.%20You%20can%20find%20the%20control%20plane%20IP%20address%20for%20the%20specific%20region%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-using-with-vnet%23--control-plane-ip-addresses%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-using-with-vnet%23--control-plane-ip-addresses%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_6-1593625581948.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202682i559F8673E7E70AC2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_6-1593625581948.png%22%20alt%3D%22karthikeyanRamasamy_6-1593625581948.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22b2%22%20id%3D%22toc-hId-1185779535%22%20id%3D%22toc-hId-1185779535%22%3E%3CSTRONG%3EUsing%20custom%20DNS%20with%20APIM%26nbsp%3B%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ECan%20I%20use%20azure%20default%20DNS%20server%20for%20APIM%3F%3C%2FSTRONG%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EYes%2C%20%3C%2FSTRONG%3Eyou%20can%20use%20azure%20default%20DNS%20server%20in%20the%20following%20conditions%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Eif%20your%20solution%2Farchitecture%20does%20not%20require%20connectivity%20to%20on-premises%20or%20you%20are%20not%20accessing%20on-premises%20resources%20using%20hostnames.%3C%2FLI%3E%0A%3CLI%3Eif%20all%20your%20backend%20servers%20are%20hosted%20in%20azure%20environment.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20the%20limitation%20of%20default%20azure%20DNS%3F%3C%2FSTRONG%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWhen%20creating%20a%20Virtual%20Network%2C%20Azure%20provides%20default%20DNS%20server%20%3CSTRONG%3E%22168.63.129.16%22%3C%2FSTRONG%3E.%20You%20can%20check%20this%20under%20Virtual%20Network-%26gt%3B%20DNS%20Severs%20blade.%20This%20DNS%20server%20is%20used%20for%20name%20resolution%20for%20azure%20services%20but%20it%20cannot%20provide%20name%20resolution%20for%20on-premise%20resources.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_7-1593625581952.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202684i975B51C6E9A1505A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_7-1593625581952.png%22%20alt%3D%22karthikeyanRamasamy_7-1593625581952.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhen%20do%20we%20need%20custom%20DNS%20for%20APIM%20VNET%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3EWhen%20APIM%20is%20running%20in%20internal%20or%20external%20VNET%20mode%20and%20your%20backend%20APIs%20are%20hosted%20in%20on-prem%20servers%2C%20you%20establish%20private%20connectivity%20to%20the%20on-premise%20network%20using%20ExpressRoute%20or%20Site%20to%20Site%20VPN.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20on-prem%20servers%20will%20host%20the%20APIs.%20Although%20you%20can%20enable%20communications%20by%20using%20IP%20addresses%2C%20it%20is%20much%20simpler%20to%20use%20names%20that%20can%20be%20easily%20remembered%2C%20and%20do%20not%20change.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAzure%20default%20DNS%20server%20cannot%20resolve%20on-prem%20host%20names.%20So%2C%20we%20add%20and%20manage%20custom%20DNS%20servers%20for%20name%20resolution%20purposes.%20We%20must%20also%20take%20steps%20to%20resolve%20the%20Azure%20services%20as%20well%20by%20using%20DNS%20forwarder.%20Custom%20DNS%20should%20resolve%20on-premises%20resources%20and%20forwarder%20will%20resolve%20the%20azure%20resources.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20note%20that%20forwarding%20to%20%22%3CSTRONG%3E168.63.129.16%3C%2FSTRONG%3E%22%20will%20not%20work%20outside%20Azure%20i.e%20if%20your%20custom%20DNS%20server%20is%20in%20on-premises%2C%20you%20cannot%20forward%20queries%20to%20%22%3CSTRONG%3E168.63.129.16%3C%2FSTRONG%3E%22%20to%20resolve%20Azure%20services.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAn%20example%20DNS%20forwarder%20is%20available%20in%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fdocumentation%2Ftemplates%2F301-dns-forwarder%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Quickstart%20Templates%20gallery%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-quickstart-templates%2Ftree%2Fmaster%2F301-dns-forwarder%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGitHub%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExample%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_8-1593625581955.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202685i9943BB0D9D395FBE%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_8-1593625581955.png%22%20alt%3D%22karthikeyanRamasamy_8-1593625581955.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhy%20network%20connectivity%20show%20failures%20with%20custom%20DNS%20server%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAPIM%20has%20dependencies%20on%20other%20resources%20like%20SQL%20and%20storage.%20When%20custom%20DNS%20server%20is%20configured%20and%20if%20it%20cannot%20resolve%20the%20Azure%20services%20dependency%2C%20you%20will%20notice%20network%20connectivity%20failures.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_9-1593625581965.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202686iBF5E17CF8FB0ADBB%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_9-1593625581965.png%22%20alt%3D%22karthikeyanRamasamy_9-1593625581965.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExample%3A%20Failed%20to%20connect%20to%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fwesteurope.prod.warm.ingestion.msftcloudes.com%252F%26amp%3Bdata%3D02%257C01%257CMithila.Rao%2540microsoft.com%257Cf10540c3575d433bdbcd08d7f1ca6f92%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C637243724088780263%26amp%3Bsdata%3DHlVQFkAg0aS3%252F4nPFKYSddd3lk6PEzlIX5mFD7qYxxI%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwesteurope.prod.warm.ingestion.msftcloudes.com%3C%2FA%3E%20with%20error%20The%20remote%20name%20could%20not%20be%20resolved%3A%20'westeurope.prod.warm.ingestion.msftcloudes.com'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20because%20of%20custom%20DNS%20is%20not%20resolving%20or%20forwarding%20DNS%20queries%20to%20azure.%20We%20need%20to%20manage%20the%20DNS%20records%20or%20forward%20DNS%20queries%20as%20mentioned%20here%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-networks-name-resolution-for-vms-and-role-instances%23name-resolution-that-uses-your-own-dns-server%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-networks-name-resolution-for-vms-and-role-instances%23name-resolution-that-uses-your-own-dns-server%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EHow%20can%20I%20check%20if%20my%20custom%20DNS%20server%20is%20resolving%20azure%20services%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20use%20%3CSTRONG%3Enslookup%3C%2FSTRONG%3E%20command%20to%20test%20if%20the%20custom%20DNS%20server%20is%20able%20to%20resolve%20the%20Azure%20services.%20RDP%20into%20any%20virtual%20machine%20in%20virtual%20network%20and%20test%20the%20nslookup%20command%20for%20the%20Azure%20PaaS%20services%20or%20on-premises%20hostnames.%20You%20can%20find%20the%20name%20of%20the%20azure%20services%20in%20Network%20connectivity%20status%20blade.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_10-1593625581967.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202687iCD8F1F0A7AE2104F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_10-1593625581967.png%22%20alt%3D%22karthikeyanRamasamy_10-1593625581967.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22b3%22%20id%3D%22toc-hId--621674928%22%20id%3D%22toc-hId--621674928%22%3E%3CSTRONG%3EForce%20tunneling%20traffic%20from%20Azure%20to%20on-premises%20over%20ExpressRoute%20or%20VPN%3C%2FSTRONG%3E%3C%2FH2%3E%0A%3CP%3EWhen%20APIM%20is%20running%20in%20VNET%20external%20or%20internal%20mode%2C%20we%20often%20see%20virtual%20network%20is%20connected%20to%20on-premises%20network%20using%20Site-to-Site%20VPN%20or%20ExpressRoute.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_11-1593625581977.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202689i182B8AFF232039BB%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_11-1593625581977.png%22%20alt%3D%22karthikeyanRamasamy_11-1593625581977.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20the%20significance%20of%20force%20tunneling%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EForce%20tunneling%20lets%20you%20redirect%20or%20%22force%22%20all%20Internet-bound%20traffic%20back%20to%20your%20on-premises%20location%20via%20a%20Site-to-Site%20VPN%20tunnel%20for%20inspection%20and%20auditing.%20This%20is%20a%20critical%20security%20requirement%20for%20most%20enterprise%20IT%20policies.%20Without%20force%20tunneling%2C%20Internet-bound%20traffic%20from%20your%20APIM%20Vnet%20will%20traverse%20from%20Azure%20network%20infrastructure%20directly%20out%20to%20the%20Internet%2C%20without%20the%20option%20to%20allow%20you%20to%20inspect%20or%20audit%20the%20traffic.%20Unauthorized%20Internet%20access%20can%20potentially%20lead%20to%20information%20disclosure%20or%20other%20types%20of%20security%20breaches.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWays%20to%20do%20force%20tunneling%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CU%3EForce%20tunneling%20over%20Site-to-Site%20VPN%20(without%20BGP%20-%20%3CSPAN%3EBorder%20Gateway%20Protocol%20)%3C%2FSPAN%3E%3C%2FU%3E%20Force%20tunneling%20in%20Azure%20is%20configured%20via%20virtual%20network%20user-defined%20routes%20pointing%20default%20traffic%20to%20the%20next%20hop%20as%20%3CEM%3EVirtual%20Network%20Gateway.%20%3C%2FEM%3EPost%20this%2C%20you%20need%20to%20set%20a%20%22default%20site%22%20among%20the%20cross-premises%20local%20sites%20connected%20to%20the%20virtual%20network.%20Refer%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvpn-gateway%2Fvpn-gateway-forced-tunneling-rm%23%3A~%3Atext%3DForced%2520tunneling%2520in%2520Azure%2520is%2Cdefined%2520routes%2520and%2520IP%2520forwarding.%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvpn-gateway%2Fvpn-gateway-forced-tunneling-rm%23%3A~%3Atext%3DForced%2520tunneling%2520in%2520Azure%2520is%2Cdefined%2520routes%2520and%2520IP%2520forwarding.%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EForce%20tunneling%20can%20also%20be%20configured%20on%20Site-to-Site%20VPN%20tunnel%20with%20BGP%20(commonly%20called%20as%20BGP%20over%20IPsec)%20where%20default%20route%20is%20advertised%20by%20on-premises%20to%20Azure%20over%20BGP%20sessions.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3E%3CU%3EForce%20tunneling%20over%20ExpressRoute%3C%2FU%3E%3A%20Force%20tunneling%20is%20enabled%20by%20advertising%20a%20default%20route%20via%20the%20ExpressRoute%20BGP%20peering%20sessions.%20To%20know%20more%20about%20asymmetric%20route%20with%20ExpressRoute%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fexpressroute%2Fexpressroute-asymmetric-routing%23asymmetric-routing-with-expressroute%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fexpressroute%2Fexpressroute-asymmetric-routing%23asymmetric-routing-with-expressroute%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_12-1593625581980.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202688iD7EBCD30FB9B43D2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_12-1593625581980.png%22%20alt%3D%22karthikeyanRamasamy_12-1593625581980.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20effect%20of%20force%20tunneling%20APIM%20traffic%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3EWith%20force%20tunneling%2C%20default%2FInternet%20traffic%20from%20APIM%20subnet%20is%20forced%20to%20flow%20through%20on-premises%20which%20could%20lead%20to%20below%20possibilities%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOn-premises%20firewall%20might%20block%20internet%20traffic%20and%20connectivity%20to%20APIM%20instance%20is%20lost.%3C%2FLI%3E%0A%3CLI%3EAPIs%20will%20never%20load%20from%20portal%20since%20the%20Resource%20provider%20will%20access%20Management%20endpoint%20on%20its%20public%20IP%20addresses%20but%20the%20response%20is%20force%20tunneled%20to%20on-premises%20which%20will%20be%20blocked%20by%20fully-stateful%20firewalls.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20asymmetric%20route%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20Asymmetric%20routing%2C%20a%20packet%20traverses%20from%20a%20source%20to%20a%20destination%20in%20one%20path%20and%20takes%20a%20different%20path%20when%20it%20returns%20to%20the%20source.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20the%20solution%20for%20asymmetric%20route%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EWe%20must%20avoid%20routing%20outgoing%20response%20from%20API%20Management%20subnet%20to%20on-premises.%20To%20achieve%20this%2C%20we%20must%20add%20precise%20user%20defined%20route%20to%20force%20the%20traffic%20through%20internet.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20The%20APIM%20Resource%20Provider%20uses%20a%20set%20of%20static%20IP%20addresses%20called%20as%20control%20plane%20IP%20addresses.%20You%20can%20find%20control%20plane%20Ip%20addresses%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-using-with-vnet%23--control-plane-ip-addresses%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fapi-management%2Fapi-management-using-with-vnet%23--control-plane-ip-addresses%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3EList%20of%20control%20plane%20IP%20address%20to%20be%20added%20in%20route%20table%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegardless%20of%20the%20region%20your%20APIM%20instance%20is%20running%2C%20you%20must%20add%20global%20control%20plane%20IP%20address.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20width%3D%22630%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22228%22%3E%3CP%3E%3CSTRONG%3EAzure%20Environment%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22210%22%3E%3CP%3E%3CSTRONG%3ERegion%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22192%22%3E%3CP%3E%3CSTRONG%3EIP%20Address%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22228%22%3E%3CP%3EAzure%20Public%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22210%22%3E%3CP%3ESouth%20Central%20US%20(Global)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22192%22%3E%3CP%3E104.214.19.224%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22228%22%3E%3CP%3EAzure%20Public%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22210%22%3E%3CP%3ENorth%20Central%20US%20(Global)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22192%22%3E%3CP%3E52.162.110.80%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22228%22%3E%3CP%3EAzure%20Public%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22210%22%3E%3CP%3EEast%20US%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22192%22%3E%3CP%3E52.224.186.99%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFind%20the%20IP%20address%20of%20the%20specific%20region%20your%20APIM%20instance%20is%20running%20and%20add.%3C%2FP%3E%0A%3CP%3EFinally%2C%20the%20UDR%20will%20have%20the%20following%20routes%20as%20shown%20in%20the%20below%20image.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22karthikeyanRamasamy_13-1593625581984.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202690i7AE35D7CA1EAACC3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_13-1593625581984.png%22%20alt%3D%22karthikeyanRamasamy_13-1593625581984.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhy%20APIM%20reporting%20Network%20Connectivity%20Status%20issues%20after%20adding%20UDR%20to%20force%20traffic%20to%20on-premises%20firewall%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ESince%20APIM%20subnet%20traffic%20is%20routed%20to%20on-premises%20firewall%20and%20it%20blocks%20the%20connectivity%20to%20azure%20services.%20You%20would%20notice%20warnings%20and%20errors%20under%20Network%20Connectivity%20Status%20blade%20.%20This%20network%20connectivity%20issues%20will%20cause%20degradation%20in%20the%20ability%20to%20use%20monitor%20the%20API%20Management%20service.%3C%2FP%3E%0A%3CP%3EThe%20below%20images%20showing%20issues%20with%20such%20dependencies.%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22623%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22karthikeyanRamasamy_0-1596655685589.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210478iF41842592A11CF12%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_0-1596655685589.png%22%20alt%3D%22karthikeyanRamasamy_0-1596655685589.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20resolve%20the%20network%20connectivity%20issues%2C%20we%20must%20whitelist%20these%20services%20in%20on-premises%20firewall%20or%20you%20can%20add%20additional%20precise%20routes%20in%20the%20route%20table.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20Azure%20Monitor%20we%20can%20add%20IP%20address%20prefix%2013.92.40.223%2F32%20with%20next%20hop%20as%20Internet%20as%20shown%20below.%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22623%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22karthikeyanRamasamy_1-1596655685592.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F210477i3CBAE0DF0EDF15B2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_1-1596655685592.png%22%20alt%3D%22karthikeyanRamasamy_1-1596655685592.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1502056%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22lia-align-center%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22karthikeyanRamasamy_0-1593625481838.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202675i696CD84D19A6EFBE%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22karthikeyanRamasamy_0-1593625481838.png%22%20alt%3D%22karthikeyanRamasamy_0-1593625481838.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-left%22%3EFAQ%20Part-II%20-%20Common%20issues%20faced%20while%20integrating%20APIM%20in%20a%20Virtual%20Network%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1502056%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20API%20management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

This is a continuation of demystifying common issues faced while integrating API Management instance in a virtual network. You can find part-I here.

 

FAQ Scenarios 

APIM with Azure Firewall

API Management instance can be configured to run in a VNET internal or external mode. Azure Firewall can be used to control and monitor the APIM subnet traffic.

 

Can you run APIM in VNET external mode with user-defined route forcing default traffic to Azure firewall?

No. This configuration will not work as client will try to access API Management Gateway/proxy on its public IP address but the response from API Management Gateway will be forwarded to Azure Firewall.

               Azure Firewall being fully-stateful will drop the response traffic.

 

Scenario: Forcing APIM subnet traffic through Azure Firewall using user-defined routes.

 

For monitoring purposes, we create user-defined routes to point default traffic (0.0.0.0/0) from API subnet to Azure Firewall.

 

karthikeyanRamasamy_1-1593625581919.png

 

Route table having user-defined route (named FW) pointing default traffic (denoted with address prefix as 0.0.0.0/0) to the next hop as Azure Firewall.

 

karthikeyanRamasamy_2-1593625581924.png

 

With the above rule, management traffic (managing the APIM configuration using Azure portal or PowerShell) response is also forced through Azure Firewall.

 

With the above configuration in place, you observe that API are not loaded and keep on loading the page. If you inspect the network trace, you will observe the Management endpoint not reachable error.

 

karthikeyanRamasamy_3-1593625581932.png

 

Error message in the developer console

Failed to connect to management endpoint servicename.management.azure-api.net:3443 for a service deployed in a Virtual Network. Make sure to follow guidance at https://aka.ms/apim-vnet-common-issues.

 

karthikeyanRamasamy_4-1593625581942.png

 

Solution:

We must route the management endpoint response traffic directly to internet to avoid response traffic getting dropped by Azure Firewall.

This can be achieved by adding routes in the route table associated with APIM subnet.

 

karthikeyanRamasamy_5-1593625581945.png

 

We must add user defined routes for the control plane IP address with next hop as internet. The above image shows routes for global control plane IP address and region-specific IP address. You can find the control plane IP address for the specific region in https://docs.microsoft.com/en-us/azure/api-management/api-management-using-with-vnet#--control-plane...

 

karthikeyanRamasamy_6-1593625581948.png

Using custom DNS with APIM 

 

Can I use azure default DNS server for APIM? 

Yes, you can use azure default DNS server in the following conditions:

  • if your solution/architecture does not require connectivity to on-premises or you are not accessing on-premises resources using hostnames.
  • if all your backend servers are hosted in azure environment.

What is the limitation of default azure DNS? 

When creating a Virtual Network, Azure provides default DNS server "168.63.129.16". You can check this under Virtual Network-> DNS Severs blade. This DNS server is used for name resolution for azure services but it cannot provide name resolution for on-premise resources.

 

karthikeyanRamasamy_7-1593625581952.png

 

When do we need custom DNS for APIM VNET?

 When APIM is running in internal or external VNET mode and your backend APIs are hosted in on-prem servers, you establish private connectivity to the on-premise network using ExpressRoute or Site to Site VPN.

 

The on-prem servers will host the APIs. Although you can enable communications by using IP addresses, it is much simpler to use names that can be easily remembered, and do not change.

 

Azure default DNS server cannot resolve on-prem host names. So, we add and manage custom DNS servers for name resolution purposes. We must also take steps to resolve the Azure services as well by using DNS forwarder. Custom DNS should resolve on-premises resources and forwarder will resolve the azure resources.

 

Please note that forwarding to "168.63.129.16" will not work outside Azure i.e if your custom DNS server is in on-premises, you cannot forward queries to "168.63.129.16" to resolve Azure services.

 

An example DNS forwarder is available in the Azure Quickstart Templates gallery and GitHub

 

Example:

karthikeyanRamasamy_8-1593625581955.png

 

Why network connectivity show failures with custom DNS server?

APIM has dependencies on other resources like SQL and storage. When custom DNS server is configured and if it cannot resolve the Azure services dependency, you will notice network connectivity failures.

 

karthikeyanRamasamy_9-1593625581965.png

 

Example: Failed to connect to https://westeurope.prod.warm.ingestion.msftcloudes.com with error The remote name could not be resolved: 'westeurope.prod.warm.ingestion.msftcloudes.com'

 

This is because of custom DNS is not resolving or forwarding DNS queries to azure. We need to manage the DNS records or forward DNS queries as mentioned here https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-...

 

How can I check if my custom DNS server is resolving azure services?

You can use nslookup command to test if the custom DNS server is able to resolve the Azure services. RDP into any virtual machine in virtual network and test the nslookup command for the Azure PaaS services or on-premises hostnames. You can find the name of the azure services in Network connectivity status blade.

 

karthikeyanRamasamy_10-1593625581967.png

 

Force tunneling traffic from Azure to on-premises over ExpressRoute or VPN

When APIM is running in VNET external or internal mode, we often see virtual network is connected to on-premises network using Site-to-Site VPN or ExpressRoute.

 

karthikeyanRamasamy_11-1593625581977.png

 

What is the significance of force tunneling?

Force tunneling lets you redirect or "force" all Internet-bound traffic back to your on-premises location via a Site-to-Site VPN tunnel for inspection and auditing. This is a critical security requirement for most enterprise IT policies. Without force tunneling, Internet-bound traffic from your APIM Vnet will traverse from Azure network infrastructure directly out to the Internet, without the option to allow you to inspect or audit the traffic. Unauthorized Internet access can potentially lead to information disclosure or other types of security breaches.

 

Ways to do force tunneling:

  1. Force tunneling over Site-to-Site VPN (without BGP - Border Gateway Protocol ) Force tunneling in Azure is configured via virtual network user-defined routes pointing default traffic to the next hop as Virtual Network Gateway. Post this, you need to set a "default site" among the cross-premises local sites connected to the virtual network. Refer here: https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-forced-tunneling-rm#:~:text=Forced%20...

Force tunneling can also be configured on Site-to-Site VPN tunnel with BGP (commonly called as BGP over IPsec) where default route is advertised by on-premises to Azure over BGP sessions.

 

  1. Force tunneling over ExpressRoute: Force tunneling is enabled by advertising a default route via the ExpressRoute BGP peering sessions. To know more about asymmetric route with ExpressRoute - https://docs.microsoft.com/en-us/azure/expressroute/expressroute-asymmetric-routing#asymmetric-routi...

karthikeyanRamasamy_12-1593625581980.png

 

What is effect of force tunneling APIM traffic?

 With force tunneling, default/Internet traffic from APIM subnet is forced to flow through on-premises which could lead to below possibilities:

  • On-premises firewall might block internet traffic and connectivity to APIM instance is lost.
  • APIs will never load from portal since the Resource provider will access Management endpoint on its public IP addresses but the response is force tunneled to on-premises which will be blocked by fully-stateful firewalls.

What is asymmetric route?

In Asymmetric routing, a packet traverses from a source to a destination in one path and takes a different path when it returns to the source.

 

What is the solution for asymmetric route?

We must avoid routing outgoing response from API Management subnet to on-premises. To achieve this, we must add precise user defined route to force the traffic through internet.

              

               The APIM Resource Provider uses a set of static IP addresses called as control plane IP addresses. You can find control plane Ip addresses in https://docs.microsoft.com/en-us/azure/api-management/api-management-using-with-vnet#--control-plane...

              

List of control plane IP address to be added in route table,

 

Regardless of the region your APIM instance is running, you must add global control plane IP address.

 

Azure Environment

Region

IP Address

Azure Public

South Central US (Global)

104.214.19.224

Azure Public

North Central US (Global)

52.162.110.80

Azure Public

East US

52.224.186.99

 

Find the IP address of the specific region your APIM instance is running and add.

Finally, the UDR will have the following routes as shown in the below image.

 

karthikeyanRamasamy_13-1593625581984.png

 

Why APIM reporting Network Connectivity Status issues after adding UDR to force traffic to on-premises firewall?

Since APIM subnet traffic is routed to on-premises firewall and it blocks the connectivity to azure services. You would notice warnings and errors under Network Connectivity Status blade . This network connectivity issues will cause degradation in the ability to use monitor the API Management service.

The below images showing issues with such dependencies.

karthikeyanRamasamy_0-1596655685589.png

 

 

To resolve the network connectivity issues, we must whitelist these services in on-premises firewall or you can add additional precise routes in the route table.

 

 

For Azure Monitor we can add IP address prefix 13.92.40.223/32 with next hop as Internet as shown below.

karthikeyanRamasamy_1-1596655685592.png