Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenges with Data API Integration through Azure Front Door #2488

Open
Soeffiej opened this issue Dec 8, 2024 · 0 comments
Open

Challenges with Data API Integration through Azure Front Door #2488

Soeffiej opened this issue Dec 8, 2024 · 0 comments

Comments

@Soeffiej
Copy link

Soeffiej commented Dec 8, 2024

Issue Summary
We are currently facing multiple issues with integrating our Data API, hosted as an Azure App Service Linux Container, with Azure Front Door. Below are the details of the setup and the specific issues encountered.

Setup Details

  1. Data API Hosting: The Data API is hosted as an Azure App Service Linux Container.
  2. Database: The Data API uses an Azure SQL database.
  3. Routing via Front Door: Azure Front Door is used to expose the Data API. The route configuration in Front Door is as follows:
    • Route: /api/ maps to the backend /api, which is the Azure App Service hosting the Data API.
  4. Client apps are outside our domain so manipulations from the client apps are not possible.

Issues Identified

  1. Root Route Issue
  • Problem:
    • The Data API has a route / (root) used as the status page. This conflicts with the need to host multiple APIs with distinct paths (e.g., /api, /api2, /api3) through Azure Front Door.
    • Direct access to / for the Data API does not align with our multi-API architecture.
  • Potential Solution:
    • Expose the status page of the Data API at /api/status instead of /. We need guidance on how to implement this change or if there’s an alternative approach to handle this scenario.
  1. Swagger Documentation Access
  • Problem:
    • The Data API hosts Swagger documentation on the endpoint /swagger. When accessed through Front Door (/api/swagger), the initial request is routed correctly to the App Service. However, the OpenAPI URL triggers a second redirect, resulting in an error indicating that the OpenAPI path is not found.
  • Potential Solution:
    • Advice is needed on how to handle secondary redirects through Azure Front Door or how to configure the Data API to avoid such issues.
  1. Pagination URL Issue
  • Problem:
    • When the first request to the Data API is made, a pagination URL is returned in the response. This URL points to the static endpoint of the App Service.
    • Subsequent requests using this static endpoint fail when routed through Azure Front Door.
  • Potential Solution:
    • The Data API seems unaware of being behind Azure Front Door. Can the pagination URL generation logic be updated to return the Front Door endpoint instead of the static App Service URL? If so, what would be the recommended approach?

Expected Outcome

  • Status Page: Ability to access the Data API status page through a route like /api/status while maintaining compatibility with other APIs hosted via Front Door.

  • Swagger Documentation: Successful access to Swagger documentation through /api/swagger, including handling secondary redirects.

  • Pagination URLs: Pagination URLs should be Front Door-aware, allowing seamless pagination requests.
    Additional Context

  • These issues are blocking us from hosting multiple APIs behind Azure Front Door efficiently.

  • Any advice, workarounds, or updates to the Data API configuration to address these issues would be highly appreciated.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant