Azure / Azure/data-api-builder
Challenges with Data API Integration through Azure Front Door
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
**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.
2. 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.
3. 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!
Contributor guide
Assessment
This issue has not been assessed yet.