MerryFairyTalesAD440 / API

1 stars 2 forks source link

Application Gateway to all functions for production #92

Open niss3n opened 5 years ago

niss3n commented 5 years ago

I need to clarify the task with Toddy. From reading about Application Gateways, it seems they just balance network loads for VMs and give routes. Since we are using serverless functions, and our routes have been defined in our functions, I'm not sure if this is the way we should go. I think the main function in the dev environment should be configured in the Platform settings with a custom domain. If so, I will be needing to meet with the dev-ops team to get the SSL cert so I can configure it.

Estimate: 6 hours

niss3n commented 5 years ago

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain

niss3n commented 5 years ago

Spent about 10 hours reading some documentation and trying different things. There is no clear information that makes sense of how to implement the app gateway using functions. I had the backend pools set to the dev-functions and had paths rerouted. I was able to return a 404 error instead of a 502 error. But I can't figure it because all the document is either creating VMs and having the app gateways as the network load balancer.

There was one article I followed that guided me through changing the root folder in the function itself, but I didn't want to break something before the presentations.

niss3n commented 5 years ago

http://devchat.live/en/2018/07/02/how-to-map-url-path-based-rules-in-application-gateway-for-your-azure-web-app-service/

niss3n commented 5 years ago

I cannot re-route a URL to something that isn't a path on the server. The application gateway can take an existing path and direct it to something else on the server (e.g. I can omit the "v1" ) from the path and abstract everything so when I go to the IP, it takes me to languages (given a hardcoded path up to that point of course).

For example, It could be something like this.

http://api-dev.1edusite.com/v1/books/{bid}/pages/{pid}/languages/{lid} ----> http://40.76.18.182/

Pull Request

Didn't need to make one this sprint.

Testing

app gateway: http://40.76.18.182/v1/books dev function: https://api-dev.1edusite.com/v1/books/

Wiki

https://github.com/MerryFairyTalesAD440/API/wiki/Application-Gateway

Working Implementation

http://40.76.18.182/v1/books

Time Spent

17 hours in total with this sprint including the first week of researching. I couldn't find much help with configuring the application gateway with serverless functions. It was a lot of trial and error to get it done. I had some help from Devon and Clint along the way.

Bug

116