Fixing issue with test sample for FastAPI - #458
Merged
Rodrigo Brandão (rodrigobr-msft) merged 2 commits intoJul 15, 2026
Conversation
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
July 9, 2026 22:19
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the FastAPI “empty agent” test sample to initialize the agent using environment-based configuration and MSAL authentication, and to wire JWT-based authorization into the FastAPI host so requests can be authorized consistently.
Changes:
- Load agent configuration from environment variables (with dotenv support) and construct shared SDK components (storage, MSAL connection manager, adapter, authorization).
- Update
AgentApplicationinitialization to use the new configuration/authentication components. - Add/update JWT authorization middleware wiring and app configuration setup for FastAPI.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rodrigo Brandão (rodrigobr-msft)
marked this pull request as ready for review
July 15, 2026 21:19
Kyle Rohn (kylerohn-msft)
approved these changes
Jul 15, 2026
Rodrigo Brandão (rodrigobr-msft)
enabled auto-merge (squash)
July 15, 2026 21:21
Copilot started reviewing on behalf of
Rodrigo Brandão (rodrigobr-msft)
July 15, 2026 21:21
View session
Rodrigo Brandão (rodrigobr-msft)
merged commit Jul 15, 2026
80f44cd
into
main
10 of 11 checks passed
Rodrigo Brandão (rodrigobr-msft)
deleted the
users/robrandao/fastapi-sample-fix
branch
July 15, 2026 21:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the FastAPI sample agent to improve configuration management, authentication, and application setup. The main changes include loading configuration from environment variables, integrating MSAL-based authentication, and updating how the agent application and FastAPI app are initialized.
Configuration and Authentication Improvements:
dotenvintegration andload_configuration_from_envto load agent configuration from environment variables, making the setup more flexible and secure.MsalConnectionManagerand updated the agent to use MSAL-based authentication, enabling better support for secure connections.AuthorizationandJwtAuthorizationMiddlewareto the FastAPI app for improved authorization handling. [1] [2]Application Initialization Updates: