Skip to content

Conversation

@JinLee794
Copy link
Collaborator

This pull request introduces significant changes to the infrastructure provisioning for AI services, primarily by integrating a new Azure AI Foundry module and updating how model deployments are managed. It also refactors environment variables and documentation to align with these changes, and removes some obsolete resources. The updates improve modularity, clarity, and future extensibility of the infrastructure code.

AI Foundry Integration:

  • Added a new Terraform module (modules/ai/foundry.tf) for provisioning Azure AI Foundry resources, including account, project, model deployments, role assignments, and diagnostic settings. This module outputs key resource identifiers and endpoints for downstream use. [1] [2]
  • Integrated the AI Foundry module into the main Terraform configuration (ai-foundry.tf), passing in relevant variables and wiring outputs for use by other resources.
  • Updated container app environment variables to use endpoints and IDs from the AI Foundry module, replacing direct references to the legacy Speech/OpenAI resources. [1] [2]

Model Deployment Refactor:

  • Standardized model deployment variable and resource names from openai_models to model_deployments throughout Terraform code and documentation, improving clarity and consistency. [1] [2] [3] [4] [5] [6]
  • Updated the AI Foundry module to handle model deployments internally, further decoupling model provisioning from the rest of the infrastructure.

Environment and Configuration Updates:

  • Reduced default pool sizes and prewarming batch sizes in generate-env.sh to lower resource usage, likely for development or cost optimization.
  • Added new local variables for AI Foundry resource naming and project metadata in main.tf.
  • Added a "SecurityControl" = "Ignore" tag to resource tags for compliance or policy purposes.

Cleanup and Minor Fixes:

  • Removed an obsolete azurerm_role_assignment for ACS Speech User and commented-out Cosmos DB resource block. [1] [2]
  • Fixed a property name from source_arm_resource_id to source_resource_id in Event Grid topic resource for ACS.

Documentation Updates:

  • Updated README.md to reflect new variable/resource names and usage patterns for model deployments and AI Foundry integration. [1] [2] [3]

These changes collectively modernize the AI infrastructure setup, making it more modular, maintainable, and aligned with Azure's latest offerings.

@JinLee794 JinLee794 requested a review from Copilot September 26, 2025 17:24
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 the AI infrastructure to use Azure AI Foundry instead of separate Speech and OpenAI services, improving modularity and alignment with Azure's latest offerings. The changes standardize naming conventions and reduce default resource usage for development environments.

Key changes:

  • Introduces a new Azure AI Foundry Terraform module that consolidates Speech and OpenAI services
  • Standardizes variable naming from openai_models to model_deployments across all configurations
  • Reduces default pool sizes and prewarming batch sizes in development scripts

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
infra/terraform/modules/ai/ New AI Foundry module with account, project, and model deployment provisioning
infra/terraform/variables.tf Renamed openai_models variable to model_deployments
infra/terraform/outputs.tf Updated outputs to use AI Foundry module endpoints instead of direct service references
infra/terraform/containers.tf Updated container environment variables to use AI Foundry module outputs
devops/scripts/azd/helpers/generate-env.sh Reduced default pool sizes from 50-100 to 5-10 for development optimization

Comment on lines +307 to +319
# value = "https://${azurerm_cognitive_account.speech.custom_subdomain_name}.cognitiveservices.azure.com/"
}

env {
name = "AZURE_SPEECH_DOMAIN_ENDPOINT"
value = "https://${azurerm_cognitive_account.speech.custom_subdomain_name}.cognitiveservices.azure.com/"
value = module.ai_foundry.openai_endpoint
# value = "https://${azurerm_cognitive_account.speech.custom_subdomain_name}.cognitiveservices.azure.com/"
}

env {
name = "AZURE_SPEECH_RESOURCE_ID"
value = azurerm_cognitive_account.speech.id
value = module.ai_foundry.account_id
# value = azurerm_cognitive_account.speech.id
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

Remove commented-out code to improve maintainability. Multiple instances of commented legacy code should be cleaned up throughout the file.

Copilot uses AI. Check for mistakes.
…dling and provide fallback for Service Principal authentication; improve error messaging and preview functionality.
@JinLee794 JinLee794 merged commit 815cd25 into main Sep 26, 2025
3 of 4 checks passed
@JinLee794 JinLee794 deleted the feature/foundry-project branch September 26, 2025 18:05
pablosalvador10 pushed a commit that referenced this pull request Dec 19, 2025
…pps/rtagent/frontend/vite-6.4.1

Bump vite from 6.3.5 to 6.4.1 in /apps/rtagent/frontend
JinLee794 pushed a commit that referenced this pull request Dec 19, 2025
JinLee794 added a commit that referenced this pull request Dec 19, 2025
JinLee794 added a commit that referenced this pull request Dec 19, 2025
Refactoring AI Services (Speech/OAI) to use AI Foundry Projects
JinLee794 added a commit that referenced this pull request Dec 23, 2025
…pps/rtagent/frontend/vite-6.4.1

Bump vite from 6.3.5 to 6.4.1 in /apps/rtagent/frontend
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