Skip to content

Conversation

@Harsh-Microsoft
Copy link
Contributor

@Harsh-Microsoft Harsh-Microsoft commented Jun 12, 2025

Purpose

This pull request introduces significant updates to the AI Foundry deployment infrastructure, including replacing older AI services with new AI Foundry resources, updating API versions, and simplifying parameter usage. The changes focus on transitioning to the AI Foundry framework, optimizing resource configurations, and removing unused or redundant parameters. Below is a summary of the most important changes grouped by theme.

Transition to AI Foundry Framework:

  • Replaced aiServices and aiHub resources with aiFoundry and aiFoundryProject resources in infra/deploy_ai_foundry.bicep. This includes defining new properties such as allowProjectManagement and introducing a SystemAssigned identity. [1] [2]
  • Updated abbreviations in infra/abbreviations.json to include aiFoundry and aiFoundryProject.

API and Resource Updates:

  • Updated the Azure OpenAI API Version from 2025-01-01-preview to 2025-04-01-preview in docs/DeploymentGuide.md.
  • Upgraded aiSearch and its related configurations to use the 2025-02-01-preview API version, adding support for SystemAssigned identity and enhanced authentication options. [1] [2]

Simplification and Cleanup:

  • Removed unused parameters such as AzureSearchKey, AzureOpenAIKey, SQLDB_USERNAME, and SQLDB_PASSWORD from infra/deploy_app_service.bicep. [1] [2] [3]
  • Eliminated redundant resource definitions, including legacy AI services, storage accounts, and associated secrets from infra/deploy_ai_foundry.bicep. [1] [2]

Parameter and Script Enhancements:

  • Added new parameters aiFoundryResourceName and aiSearchResourceName to the sample data processing script in docs/DeploymentGuide.md.
  • Introduced aiFoundryProjectEndpoint and aiFoundryProjectName parameters in infra/deploy_app_service.bicep to align with the AI Foundry framework.

Role Assignments and Connections:

  • Added role assignments for Search Index Data Reader and Search Service Contributor to enable AI Foundry integration with Azure Search.
  • Defined new connections for integrating AI Foundry with Azure Search and Application Insights.

These updates collectively enhance the deployment process, align the infrastructure with the latest AI Foundry capabilities, and simplify the overall configuration.

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

@Harsh-Microsoft Harsh-Microsoft changed the title initial bicep changes for fdp feat: added fdp changes, updated openai assistants to ai agents Jun 18, 2025
…ing imports and formatting code blocks consistently across multiple files.
@Harsh-Microsoft Harsh-Microsoft changed the title feat: added fdp changes, updated openai assistants to ai agents feat: added fdp changes, updated to use ai agents instead of openai assistants Jun 18, 2025
@Avijit-Microsoft Avijit-Microsoft requested a review from Copilot June 18, 2025 15:27
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 transitions the deployment to use Azure AI Foundry resources, refactors core database and chat services, updates tests and configuration paths, and adjusts documentation and scripts to align with the new framework.

  • Replace legacy AI Hub and Cognitive Services with AI Foundry resources in Bicep templates
  • Introduce a unified sqldb_service for SQL connections and update related tests
  • Update deployment scripts and docs for new aiFoundry and aiSearch parameters

Reviewed Changes

Copilot reviewed 34 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
infra/deploy_ai_foundry.bicep Define AI Foundry account and project resources
infra/deploy_app_service.bicep Wire AI Foundry endpoints and identities into app
src/App/backend/services/sqldb_service.py New SQL DB service with managed identity support
src/App/tests/test_app.py Updated tests to use backend.common.config.config
docs/DeploymentGuide.md Bumped API version and sample script parameters
Comments suppressed due to low confidence (3)

infra/main.bicep:258

  • Typo in output variable name: FOUNDARY should be spelled FOUNDRY to match the resource naming convention.
output AI_FOUNDARY_NAME string = aifoundry.outputs.aiFoundryName

src/App/backend/services/sqldb_service.py:35

  • Consider adding unit tests for get_connection (including successful token-based connect and fallback) and for dict_cursor to ensure full test coverage of this new service.
def get_connection():

infra/scripts/run_create_index_scripts.sh:74

  • The variable signed_user_id is used but never set in this script. You should retrieve the signed-in user ID (e.g., via az ad signed-in-user show --query id -o tsv) before referencing it.
    role_assignment=$(MSYS_NO_PATHCONV=1 az role assignment list --role 53ca6127-db72-4b80-b1b0-d745d6d5456d --scope $aif_resource_id --assignee $signed_user_id --query "[].roleDefinitionId" -o tsv)

Otherwise, provide thorough answers using only data from SQL or call transcripts.
If no data is found, please respond with 'No data found for that client.' Remove any client identifiers from the final response.'''
var functionAppStreamTextSystemPrompt = '''The currently selected client's name is '{SelectedClientName}'. Treat any case-insensitive or partial mention as referring to this client.
If the user mentions no name, assume they are asking about '{SelectedClientName}'..
Copy link

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

There is an extra period before the closing quote after {SelectedClientName}—please remove the duplicate period.

Suggested change
If the user mentions no name, assume they are asking about '{SelectedClientName}'..
If the user mentions no name, assume they are asking about '{SelectedClientName}'.

Copilot uses AI. Check for mistakes.
continue
yield chunk.content # just the deltaText
finally:
thread = chunk.thread
Copy link

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

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

In the finally block, chunk may be undefined if no items were yielded, causing an UnboundLocalError. You should capture the thread reference outside the loop or guard against chunk not existing.

Suggested change
thread = chunk.thread
thread = chunk.thread if chunk else None # Guard against chunk being None

Copilot uses AI. Check for mistakes.
@Roopan-Microsoft Roopan-Microsoft merged commit 779694c into dev Jun 19, 2025
7 checks passed
Roopan-Microsoft pushed a commit that referenced this pull request Jun 20, 2025
* Implemented Log execution time per prompt in Report

* updated readme

* updated the code

* added functions

* feat: added fdp changes, updated to use ai agents instead of openai assistants (#566)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* refactor: couple of typo fix (#570)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* fix: correct variable names for managed identity and AI foundry in scripts and templates

---------

Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com>
Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com>
Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com>
Roopan-Microsoft pushed a commit that referenced this pull request Jun 27, 2025
…from popup (#578)

* feat: FDP changes, Updation to use AI agents  (#571)

* Implemented Log execution time per prompt in Report

* updated readme

* updated the code

* added functions

* feat: added fdp changes, updated to use ai agents instead of openai assistants (#566)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* refactor: couple of typo fix (#570)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* fix: correct variable names for managed identity and AI foundry in scripts and templates

---------

Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com>
Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com>
Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com>

* bug fix(#19849)

---------

Co-authored-by: Prajwal-Microsoft <v-dcprajwal@microsoft.com>
Co-authored-by: Ragini-Microsoft <v-raginich@microsoft.com>
Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com>
Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com>
Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com>
Roopan-Microsoft pushed a commit that referenced this pull request Jun 27, 2025
* Implemented Log execution time per prompt in Report

* updated readme

* updated the code

* added functions

* feat: added fdp changes, updated to use ai agents instead of openai assistants (#566)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* refactor: couple of typo fix (#570)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* fix: correct variable names for managed identity and AI foundry in scripts and templates

* feat: quota check during azd up (#579)

* quota-check-during azd up

* updated bicep and parameter json

* fix: There is no progress/Process message when deleting chat history from popup (#578)

* feat: FDP changes, Updation to use AI agents  (#571)

* Implemented Log execution time per prompt in Report

* updated readme

* updated the code

* added functions

* feat: added fdp changes, updated to use ai agents instead of openai assistants (#566)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* refactor: couple of typo fix (#570)

* initial bicep changes for fdp

* update role assignments in bicep

* feat: initial fdp changes for client advisor

* updated post deployment scripts to use keyless authentication

* rebuilt main.json

* fix configuration handling and error checking in backend services

* updated unit tests

* Refactor code for improved readability and maintainability by organizing imports and formatting code blocks consistently across multiple files.

* fix: correct variable names for managed identity and AI foundry in scripts and templates

---------

Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com>
Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com>
Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com>

* bug fix(#19849)

---------

Co-authored-by: Prajwal-Microsoft <v-dcprajwal@microsoft.com>
Co-authored-by: Ragini-Microsoft <v-raginich@microsoft.com>
Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com>
Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com>
Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com>

* updated openai version (#581)

* deleted params

---------

Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com>
Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com>
Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com>
Co-authored-by: Priyanka-Microsoft <v-prisinghal@microsoft.com>
Co-authored-by: Bangarraju-Microsoft <v-golib@microsoft.com>
Co-authored-by: Prajwal-Microsoft <v-dcprajwal@microsoft.com>
Co-authored-by: Ragini-Microsoft <v-raginich@microsoft.com>
@github-actions
Copy link

github-actions bot commented Jul 1, 2025

🎉 This PR is included in version 1.5.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.

3 participants