Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

Documentation was outdated regarding authentication architecture (functions use AuthorizationLevel.Anonymous but are secured by Static Web Apps) and frontend implementation status (Blazor frontend is fully implemented, not "to be implemented").

Updated Documentation

Authentication architecture:

  • Documented SWA + Azure AD enforces authentication upstream via staticwebapp.config.json
  • Functions use AuthorizationLevel.Anonymous and trust SWA authentication layer
  • Added authentication flow: SWA validates → session cookies → Functions trust SWA
  • Included Azure AD configuration steps for deployment

Frontend implementation:

  • Changed status from "to be implemented" to current state
  • Documented Fluent UI components, Markdig rendering, PDF export, interactive visualization

Files updated:

  • README.md - Architecture overview, security section, project structure
  • Bezalu.ProjectReporting.API/README.md - Security model
  • docs/architecture.md - Authentication architecture, data flow
  • docs/deployment.md - Azure AD configuration
  • docs/frontend.md - Frontend overview, auth behavior

Authentication Flow

User → SWA (validates Azure AD) → API request with SWA cookies → Functions (trust SWA)

The key design: Functions don't need function keys because SWA's authenticated role requirement on /api/* routes provides authentication before requests reach Azure Functions.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Change HTTP trigger authorization to Anonymous Update documentation for SWA authentication and implemented frontend Dec 24, 2025
Copilot AI requested a review from MWG-Logan December 24, 2025 14:41
@MWG-Logan MWG-Logan marked this pull request as ready for review December 24, 2025 14:51
Copilot AI review requested due to automatic review settings December 24, 2025 14:51
@MWG-Logan MWG-Logan merged commit 05a2c00 into dev Dec 24, 2025
5 of 6 checks passed
@MWG-Logan MWG-Logan deleted the copilot/sub-pr-29 branch December 24, 2025 14:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates documentation to accurately reflect the current authentication architecture (Static Web Apps with Azure AD handles authentication upstream, Azure Functions use AuthorizationLevel.Anonymous) and corrects the frontend implementation status from "to be implemented" to fully implemented with details about the Blazor WebAssembly features.

  • Changed frontend documentation from "to be implemented" to describing the fully functional Blazor WebAssembly application with Fluent UI components, Markdig rendering, and PDF export
  • Documented the authentication architecture where Static Web Apps enforces Azure AD authentication before requests reach Azure Functions
  • Added detailed authentication flow descriptions and Azure AD configuration steps across all documentation files

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docs/frontend.md Added authentication section explaining SWA/Azure AD integration, updated key behaviors to reflect authentication requirement, clarified HTTP client behavior with SWA routing
docs/deployment.md Added Azure AD configuration steps for both integrated and separate deployment scenarios, documented SWA authentication enforcement
docs/architecture.md Updated data flow to include authentication steps, added new "Authentication Architecture" section explaining the SWA authentication layer
README.md Updated project overview to reflect three projects including Shared DTOs, changed frontend status from "to be implemented" to implemented with feature details, expanded security section with authentication flow diagram, updated project structure to show all three projects
Bezalu.ProjectReporting.API/README.md Updated security section to document SWA authentication layer and AuthorizationLevel.Anonymous pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Authentication Architecture
- **Static Web Apps** handles authentication via Azure AD (Entra ID)
- `staticwebapp.config.json` enforces `authenticated` role for `/api/*` routes
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying the full path to the configuration file (e.g., "Bezalu.ProjectReporting.Web/staticwebapp.config.json") to help readers locate this file in the project structure.

Suggested change
- `staticwebapp.config.json` enforces `authenticated` role for `/api/*` routes
- `Bezalu.ProjectReporting.Web/staticwebapp.config.json` enforces `authenticated` role for `/api/*` routes

Copilot uses AI. Check for mistakes.
- Add Entra ID or other auth on Static Web Apps; issue front-end access token; secure Functions with Easy Auth or custom.
- **Azure Static Web Apps** integrated with **Azure AD (Entra ID)** for authentication
- Configure authentication provider in Azure Portal under SWA > Settings > Authentication
- `staticwebapp.config.json` enforces authentication:
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying the full path to the configuration file (e.g., "Bezalu.ProjectReporting.Web/staticwebapp.config.json") to help readers locate this file in the project structure.

Suggested change
- `staticwebapp.config.json` enforces authentication:
- `Bezalu.ProjectReporting.Web/staticwebapp.config.json` enforces authentication:

Copilot uses AI. Check for mistakes.
- Configured in `staticwebapp.config.json`:
- `/api/*` routes require `authenticated` role
- Unauthenticated users redirected to `/.auth/login/aad`
- SWA session cookies automatically included in API requests
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent terminology: This line refers to "SWA session cookies" while line 28 refers to "SWA authentication cookies". Consider using consistent terminology throughout the documentation to refer to the same concept.

Suggested change
- SWA session cookies automatically included in API requests
- SWA authentication cookies automatically included in API requests

Copilot uses AI. Check for mistakes.
### Authentication Flow

1. User accesses the Blazor WebAssembly app hosted on Azure Static Web Apps
2. Static Web Apps enforces authentication via Azure AD (configured in `staticwebapp.config.json`)
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states "configured in staticwebapp.config.json" but doesn't specify where this file is located. Consider adding the file path (e.g., "configured in Bezalu.ProjectReporting.Web/staticwebapp.config.json") to help readers locate this configuration file.

Suggested change
2. Static Web Apps enforces authentication via Azure AD (configured in `staticwebapp.config.json`)
2. Static Web Apps enforces authentication via Azure AD (configured in `Bezalu.ProjectReporting.Web/staticwebapp.config.json`)

Copilot uses AI. Check for mistakes.

## Authentication
- **Azure Static Web Apps** handles authentication via Azure AD (Entra ID)
- Configured in `staticwebapp.config.json`:
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider specifying the full path to the configuration file (e.g., "Configured in Bezalu.ProjectReporting.Web/staticwebapp.config.json") to help readers locate this file in the project structure.

Suggested change
- Configured in `staticwebapp.config.json`:
- Configured in `Bezalu.ProjectReporting.Web/staticwebapp.config.json`:

Copilot uses AI. Check for mistakes.
- Markdown + Markdig chosen for flexibility in AI summary formatting.
- QuestPDF chosen for deterministic server-side PDF rendering.
- **Azure Static Web Apps** provides integrated hosting, authentication, and API routing.
- **Function AuthorizationLevel.Anonymous** used because authentication is enforced upstream by SWA.
Copy link

Copilot AI Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "Function AuthorizationLevel.Anonymous" reads awkwardly. Consider rewording to "Azure Functions use AuthorizationLevel.Anonymous" for better clarity and readability.

Suggested change
- **Function AuthorizationLevel.Anonymous** used because authentication is enforced upstream by SWA.
- **Azure Functions use AuthorizationLevel.Anonymous** because authentication is enforced upstream by SWA.

Copilot uses AI. Check for mistakes.
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

Successfully merging this pull request may close these issues.

2 participants