Skip to content

Conversation

@Prajwal-Microsoft
Copy link
Contributor

@Prajwal-Microsoft Prajwal-Microsoft commented Jun 5, 2025

Purpose

This pull request introduces several updates across documentation and infrastructure files to enhance deployment flexibility, streamline configurations, and improve support for existing resources. The most significant changes include enabling the reuse of existing Log Analytics workspaces, updating deployment scripts to improve functionality, and removing unused parameters and settings.

Documentation Updates:

  • Fabric Deployment Guide: Added instructions for reusing an existing Microsoft Fabric Workspace and clarified the use of workspace IDs. [1] [2]
  • Deployment Guide: Included a new parameter for reusing existing Log Analytics workspaces and updated the table of deployment parameters.
  • Local Setup and Deploy Guide: Updated Azure App Service deployment commands to use uvicorn instead of gunicorn and added a new app setting for port configuration. [1] [2]

Infrastructure Enhancements:

  • Support for Existing Log Analytics Workspace:

    • Introduced the existingLogAnalyticsWorkspaceId parameter in infra/deploy_ai_foundry.bicep to allow reuse of existing workspaces. Added logic to conditionally use an existing workspace or create a new one. [1] [2] [3] [4]
    • Propagated the existingLogAnalyticsWorkspaceId parameter through infra/main.bicep and infra/main.bicepparam for seamless integration. [1] [2] [3]
  • Application Insights Connection String:

    • Added support for passing the Application Insights connection string as a parameter and environment variable in infra/deploy_app_service.bicep. [1] [2]

Simplification and Cleanup:

  • Removed Unused Parameters:
    • Eliminated redundant parameters such as AzureSearchIndexIsPrechunked, AzureOpenAIModelName, and WebAppEnableChatHistory from infra/deploy_app_service.bicep. [1] [2] [3]
  • Removed Unnecessary Environment Variables:
    • Cleaned up unused environment variables like SCM_DO_BUILD_DURING_DEPLOYMENT and UWSGI_PROCESSES from the Azure App Service configuration.

These updates collectively improve the flexibility and maintainability of the deployment process while ensuring compatibility with existing resources.

Does this introduce a breaking change?

  • [] Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Prasanjeet-Microsoft and others added 19 commits May 7, 2025 13:58
* added opentelemetry log in apis

* resolved pylint issues

* resolved pylint issues

* resolved pylint issues

* resolved pylint issues

* removed space

* updated requirement file
* Replace Gunicorn with Uvicorn for the backend server and remove Gunicorn configuration

* Update deployment instructions to use Uvicorn instead of Gunicorn
* cleanup the unused variables in all the files

* fix: remove unused OPENAI_API_VERSION variable

* fix: resolve unit tests issue
feat: EXP environment changes for Log Analytics workspace
feat: EXP environment changes for Existing Fabric workspace
fix: To reuse Log Analytics across subscriptions
@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 14:22
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 refactors and cleans up code and configuration files while updating environment variables and deployment parameters to support EXP changes. Key changes include:

  • Removal of the patch for the complete_chat_request in tests and updates to test utilities.
  • Updates to dependency management such as the removal of gunicorn and addition (and deduplication) of opentelemetry packages.
  • Adjustments in infrastructure deployment files to include new parameters (e.g., existing Log Analytics Workspace) and switch to uvicorn for the web application.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/App/tests/test_app.py Removed patching for complete_chat_request to streamline test logic.
src/App/tests/backend/test_utils.py Updated the patch target from "app.requests.get" to "backend.utils.requests.get".
src/App/requirements.txt Removed gunicorn dependency and added opentelemetry packages (note duplicate dependency).
src/App/requirements-dev.txt Removed gunicorn dependency to align with production dependency changes.
src/App/gunicorn.conf.py Removed legacy gunicorn configuration to support the switch to uvicorn.
src/App/backend/chat_logic_handler.py Updated environment variable names to reflect new configuration parameters.
src/App/WebApp.Dockerfile Updated startup command from gunicorn to uvicorn with appropriate options.
src/App/.env.sample Updated and standardized environment variable values and defaults.
infra/* Updated deployment scripts and parameters (e.g., Log Analytics Workspace, resource IDs).
docs/*.md Revised deployment and customization documentation to reflect recent changes.
.github/dependabot.yml Removed an outdated pip package configuration section.
Comments suppressed due to low confidence (3)

src/App/tests/test_app.py:1219

  • The patch for complete_chat_request has been removed; please ensure that any workflows relying on this function are adequately covered by the current test setup or are intentionally deprecated.
with patch("app.complete_chat_request", new_callable=AsyncMock) as mock_complete:

src/App/backend/chat_logic_handler.py:20

  • Verify that changing the environment variable from 'OPENAI_API_VERSION' to 'AZURE_OPENAI_PREVIEW_API_VERSION' is consistently reflected in all related configurations and documentation.
api_version = os.environ.get("AZURE_OPENAI_PREVIEW_API_VERSION")

infra/deploy_ai_foundry.bicep:58

  • [nitpick] Consider adding an inline comment explaining the logic for extracting components from the existing Log Analytics Workspace ID to improve maintainability.
var useExisting = !empty(existingLogAnalyticsWorkspaceId)

@microsoft microsoft deleted a comment from Copilot AI Jun 6, 2025
* update CustomizingAzdParameters.md

* update main.bicepparam

* update deployment guide

* update key names

* Update CustomizingAzdParameters.md

* Update main.bicepparam

* Update DeploymentGuide.md

* update customizingazdparameter file

* updates files

* update documents

---------

Co-authored-by: Shreyas-Microsoft <[email protected]>
@Prajwal-Microsoft Prajwal-Microsoft merged commit f542e68 into main Jun 6, 2025
11 checks passed
@github-actions
Copy link

github-actions bot commented Jun 6, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.