Skip to content

fix: Add support for reusing existing Azure AI Foundry projects in deployment#157

Open
Saswato-Microsoft wants to merge 5 commits into
microsoft:devfrom
Saswato-Microsoft:psl-aiproject-fix
Open

fix: Add support for reusing existing Azure AI Foundry projects in deployment#157
Saswato-Microsoft wants to merge 5 commits into
microsoft:devfrom
Saswato-Microsoft:psl-aiproject-fix

Conversation

@Saswato-Microsoft
Copy link
Copy Markdown
Contributor

@Saswato-Microsoft Saswato-Microsoft commented May 15, 2026

Purpose

This pull request introduces improvements to the deployment documentation and infrastructure configuration, focusing on making "bring your own" (BYO) resource scenarios clearer and easier to use. The main changes include adding dedicated guides for reusing existing Azure resources (such as Log Analytics, AI Foundry Projects, and Fabric Capacity/Workspace), updating parameter handling in the Bicep templates to support BYO AI Foundry Projects, and simplifying the main deployment guide to reference these new guides.

Documentation Restructuring and Additions:

  • Added new dedicated guides for reusing existing resources:
  • Simplified the main deployment guide (docs/deploymentguide.md) by removing lengthy, embedded BYO instructions and replacing them with links to the new dedicated guides. [1] [2]
  • Removed redundant or outdated BYO documentation from docs/parameter_guide.md, which is now covered by the new guides.

Infrastructure as Code (Bicep) Enhancements:

  • Added support for reusing an existing Azure AI Foundry Project:
    • Introduced a new existingAiProjectResourceId parameter in infra/main.bicep and infra/main.bicepparam, including logic to parse and use this resource if provided. [1] [2]
    • Updated outputs in infra/main.bicep to expose effective AI Foundry resource details and BYO status.
    • Automatically disables deployAiFoundry and related parameters when BYO Foundry Project is detected.
    • Documented the new existingAiProjectResourceId parameter in the deployment guide's parameter table.

These changes improve maintainability, clarity, and user experience for teams deploying with existing Azure 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

…ployment

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
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

Adds “Bring Your Own” (BYO) Azure AI Foundry project support so deployments can target an existing Foundry account/project (including cross-subscription), instead of always provisioning new Foundry resources.

Changes:

  • Introduces existingAiProjectResourceId input and outputs parsed Foundry account/project/RG/subscription details from that resource ID.
  • Updates preprovisioning to parse AZURE_EXISTING_AI_PROJECT_RESOURCE_ID and publish the correct azd env values for downstream automation.
  • Expands deployment docs/parameter guide with BYO AI Foundry usage and output references.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/preprovision-integrated.ps1 Detects/parses an existing AI Foundry project resource ID and sets azd env values for cross-RG/sub usage.
infra/main.bicepparam Reads AZURE_EXISTING_AI_PROJECT_RESOURCE_ID, passes it to main.bicep, and conditionally disables Foundry/project deployment toggles.
infra/main.bicep Adds existingAiProjectResourceId param, parses segments into outputs, and emits BYO-related outputs.
docs/parameter_guide.md Documents BYO AI Foundry behavior, setup, permissions, and outputs.
docs/deploymentguide.md Adds BYO AI Foundry parameter guidance and example azd env set usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/main.bicepparam Outdated
Comment thread infra/main.bicep Outdated
Comment thread docs/parameter_guide.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 11:04
Copy link
Copy Markdown
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread infra/main.bicepparam
Comment thread scripts/preprovision-integrated.ps1
Comment thread infra/main.bicep Outdated
Comment thread docs/deploymentguide.md Outdated
Comment thread docs/deploymentguide.md Outdated
Comment thread docs/parameter_guide.md Outdated
Copilot AI review requested due to automatic review settings May 18, 2026 12:10
Copy link
Copy Markdown
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

Copilot reviewed 7 out of 13 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

docs/parameter_guide.md:92

  • The Parameter Guide no longer documents how to configure BYO Log Analytics or the new BYO Foundry project (existingAiProjectResourceId / AZURE_EXISTING_AI_PROJECT_RESOURCE_ID). This conflicts with the PR description and leaves readers without a reference in this guide; either add the missing section(s) or update the PR description and include a link here to the new reuse guides.
---

## Table of Contents
1. [Basic Parameters](#basic-parameters)
2. [Deployment Toggles](#deployment-toggles)
3. [Network Configuration](#network-configuration)
4. [Microsoft Foundry Configuration](#microsoft-foundry-configuration)
5. [Individual Service Configuration](#individual-service-configuration)
6. [Common Customization Examples](#common-customization-examples)

Comment thread docs/re-use-log-analytics.md
Comment thread docs/re-use-foundry-project.md
Comment thread infra/main.bicep
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.

4 participants