refactor: Refactor authentication handling and update role assignment#977
Merged
Conversation
…nd simplify user role checks Add search contributor role assignment in Bicep template Comment out AI agent setup steps in Azure YAML Update dependencies in requirements.txt for compatibility
Avijit-Microsoft
approved these changes
Jun 25, 2026
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.
Purpose
This pull request introduces several key changes focused on improving authentication flexibility and simplifying API route security. The main updates include adding utility functions for extracting user authentication details, providing a sample user for development, and removing enforced authentication dependencies from multiple API routers. Additionally, there are infrastructure enhancements related to Azure role assignments.
Authentication & Authorization Improvements:
get_authenticated_user_detailsandget_tenantidutility functions insrc/api/auth/auth_utils.pyto extract user details and tenant ID from request headers, supporting both Easy Auth and a local development fallback.sample_userdictionary insrc/api/auth/sample_user.pyto allow the app to function without authentication in development environments.get_current_userdependency from all API endpoints insrc/api/modules/embeddings/router.py,src/api/modules/ingestion/router.py,src/api/modules/pipelines/router.py, andsrc/api/modules/processing/router.py, making endpoints accessible without enforced authentication. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]Infrastructure & Azure Role Assignments:
searchContribRoleininfra/modules/roles.bicepto grant the backend service principal contributor access to the search service.azure.yamlto prevent failures during deployment when the agent is not required. [1] [2]These changes collectively improve the developer experience, simplify local development, and enhance infrastructure role management.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation