SOLVED

Complicated Application Gateway Setup

%3CLINGO-SUB%20id%3D%22lingo-sub-1505969%22%20slang%3D%22en-US%22%3EComplicated%20Application%20Gateway%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1505969%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20looking%20to%20set%20up%20a%20complicated%20application%20gateway%20and%20seem%20to%20be%20struggling%20to%20get%20to%20get%20things%20right%20and%20am%20not%20sure%20if%20it%20something%20I%20am%20doing%20wrong%20or%20a%20limitation%20that%20I%20need%20to%20work%20around.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20want%20to%20do%20is%20have%20the%20gateway%20handle%20sub%20domain%20routing%20(pretty%20easy)%20and%20path%20based%20routing%20(on%20it's%20on%20pretty%20easy)%20and%20direct%20the%20traffic%20to%20app%20service%20end%20points%20(not%20sure%20if%20this%20is%20causing%20the%20problem%20due%20to%20multi%20tenancy)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20sub%20domains%20are%20used%20currently%20to%20manage%20our%20different%20development%20environments%20(eg%20uat.contoso.com%20and%20dev.contoso.com)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20path%20based%20routing%20is%20for%20the%20various%20applications%20that%20we%20run.%20(uat.contoso.com%2Fapplication1%20and%20uat.contoso.com%2Fapplication2)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20love%20to%20change%20some%20of%20these%20things%20but%20the%20routing%20is%20legacy%20and%20a%20lot%20of%20stakeholders%20in%20the%20organisation%20are%20resistant%20to%20change.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20a%20few%20times%20to%20set%20things%20up%20the%20way%20I%20believe%20they%20should%20be%20set%20up%20but%20I%20get%20404%20errors%26nbsp%3B%20or%20redirects%20to%20the%20app%20service%20url%20(which%20I%20am%20avoiding%20as%20I%20want%20to%20create%20and%20internal%20private%20url%20not%20a%20public%20one)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20pointers%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E-Grae%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1505969%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Gateway%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Erouting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1506017%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Application%20Gateway%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1506017%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20setup%20health%20probes%20properly%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1507566%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Application%20Gateway%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1507566%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F118209%22%20target%3D%22_blank%22%3E%40Youdhbir%20Singh%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThe%20health%20probes%20are%20responding%20with%20healthy.%20Correct%20me%20if%20I%20am%20wrong%20but%20health%20probes%20are%20only%20there%20to%20determine%20if%20traffic%20can%20be%20routed%20to%20an%20end%20point.%20So%20if%20a%20health%20probe%20reports%20healthy%20then%20the%20application%20gateway%20routes%20traffic.%20If%20not%20then%20the%20gateway%20responds%20to%20the%20client%20with%20a%20502%20error.%20In%20this%20case%20I%20am%20receiving%20a%20404%20so%20it%20shouldn't%20be%20the%20health%20probes%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3EGrae%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1510385%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Application%20Gateway%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1510385%22%20slang%3D%22en-US%22%3EHello%2C%3CBR%20%2F%3ECan%20you%20please%20elaborate%20more%20about%20how%20you%20are%20setting%20up%20the%20application%20gateway%2C%3CBR%20%2F%3Eif%20you%20cannot%20share%20a%20lot%20of%20details%20can%20you%20please%20give%20me%20more%20information%20about%20how%20you%20are%20setting%20up%20the%20probes%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%2C%3CBR%20%2F%3ECharbel%20Hanna%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1513917%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Application%20Gateway%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1513917%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F573584%22%20target%3D%22_blank%22%3E%40Charbelhanna%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThanks%20for%20reply.%3C%2FP%3E%3CP%3ESOLVED%3C%2FP%3E%3CP%3EI%20ended%20up%20solving%20my%20issue%20not%20through%20app%20gateway%20but%20through%20app%20service.%20Basically%20the%20problem%20was%20the%20HTTP%20settings%20needed%20to%20be%20set%20to%20override%20with%20new%20host%20name%20as%20it%20is%20an%20app%20service.%20This%20combined%20with%20the%20path%20based%20mapping%20resulted%20in%20a%20virtual%20path%20that%20did%20not%20exist.%20I%20attempted%20to%20use%20rewriting%20but%20that%20only%20went%20so%20far%20but%20setting%20a%20virtual%20path%20%22%2Fappname%22%20to%20point%20at%20%22site%2Fwwwroot%22%20and%20changing%20the%20default%20to%20point%20to%20a%20dummy%20folder%20achieved%20the%20outcome.%20I%20did%20need%20to%20change%20my%20health%20probes%20after%20this%20but%20again%20I%20would%20like%20to%20point%20out%20this%20was%20not%20a%20health%20probe%20issue%20it%20was%20a%20routing%20based%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1513925%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Application%20Gateway%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1513925%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20also%20like%20to%20point%20out%20that%20URL%20rewrites%20are%20in%20preview%20and%20I%20did%20try%20them%20but%20they%20did%20not%20solve%20my%20problem%20at%20this%20stage.%20I%20will%20update%20if%20I%20find%20a%20different%20option%20in%20the%20future.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi,

I am looking to set up a complicated application gateway and seem to be struggling to get to get things right and am not sure if it something I am doing wrong or a limitation that I need to work around.

 

What I want to do is have the gateway handle sub domain routing (pretty easy) and path based routing (on it's on pretty easy) and direct the traffic to app service end points (not sure if this is causing the problem due to multi tenancy)

 

The sub domains are used currently to manage our different development environments (eg uat.contoso.com and dev.contoso.com)

 

The path based routing is for the various applications that we run. (uat.contoso.com/application1 and uat.contoso.com/application2)

 

I would love to change some of these things but the routing is legacy and a lot of stakeholders in the organisation are resistant to change. 

 

I have tried a few times to set things up the way I believe they should be set up but I get 404 errors  or redirects to the app service url (which I am avoiding as I want to create and internal private url not a public one)

 

Any pointers would be appreciated.

-Grae

5 Replies
Highlighted

Did you setup health probes properly?

Highlighted

Hi @Youdhbir Singh ,

The health probes are responding with healthy. Correct me if I am wrong but health probes are only there to determine if traffic can be routed to an end point. So if a health probe reports healthy then the application gateway routes traffic. If not then the gateway responds to the client with a 502 error. In this case I am receiving a 404 so it shouldn't be the health probes?

 

Cheers

Grae

Highlighted
Hello,
Can you please elaborate more about how you are setting up the application gateway,
if you cannot share a lot of details can you please give me more information about how you are setting up the probes?

Thank you,
Charbel Hanna
Highlighted
Solution

Hi @Charbelhanna ,

Thanks for reply.

SOLVED

I ended up solving my issue not through app gateway but through app service. Basically the problem was the HTTP settings needed to be set to override with new host name as it is an app service. This combined with the path based mapping resulted in a virtual path that did not exist. I attempted to use rewriting but that only went so far but setting a virtual path "/appname" to point at "site/wwwroot" and changing the default to point to a dummy folder achieved the outcome. I did need to change my health probes after this but again I would like to point out this was not a health probe issue it was a routing based issue.

 

Thanks

Highlighted

I would also like to point out that URL rewrites are in preview and I did try them but they did not solve my problem at this stage. I will update if I find a different option in the future.