fix: Add support for reusing existing Azure AI Foundry projects in deployment#157
Open
Saswato-Microsoft wants to merge 4 commits into
Open
fix: Add support for reusing existing Azure AI Foundry projects in deployment#157Saswato-Microsoft wants to merge 4 commits into
Saswato-Microsoft wants to merge 4 commits into
Conversation
…ployment Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
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
existingAiProjectResourceIdinput and outputs parsed Foundry account/project/RG/subscription details from that resource ID. - Updates preprovisioning to parse
AZURE_EXISTING_AI_PROJECT_RESOURCE_IDand publish the correctazd envvalues 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ting Azure resources and add new reference documents
Contributor
There was a problem hiding this comment.
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 on lines
+17
to
+27
|  | ||
|
|
||
| ### 3. Copy Resource ID | ||
|
|
||
| In the **Overview** pane, click on **JSON View**. | ||
|
|
||
|  | ||
|
|
||
| Copy the **Resource ID** that is your Workspace ID. | ||
|
|
||
|  |
Comment on lines
+15
to
+43
| In the search bar at the top, type "Azure AI Foundry" and click on it. Then select the Foundry service instance where your project exists. | ||
|
|
||
|  | ||
|
|
||
| ### 3. Navigate to Projects under Resource Management | ||
|
|
||
| On the left sidebar of the Foundry service blade: | ||
|
|
||
| - Expand the **Resource Management** section | ||
| - Click on **Projects** (this refers to the active Foundry project tied to the service) | ||
|
|
||
| ### 4. Click on the Project | ||
|
|
||
| From the Projects view: Click on the project name to open its details. | ||
|
|
||
| > **Note:** You will see only one project listed here, as each Foundry service maps to a single project in this accelerator. | ||
|
|
||
|  | ||
|
|
||
| ### 5. Copy Resource ID | ||
|
|
||
| In the left-hand menu of the project blade: | ||
|
|
||
| - Click on **Properties** under **Resource Management** | ||
| - Locate the **Resource ID** field | ||
| - Click on the copy icon next to the Resource ID value | ||
|
|
||
|  | ||
|
|
| output keyVaultResourceId string = effectiveKeyVaultResourceId | ||
| output storageAccountResourceId string = effectiveStorageAccountResourceId | ||
| output aiFoundryProjectName string = aiFoundryProjectName | ||
| output aiFoundryProjectName string = effectiveAiFoundryProjectName |
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 comprehensive support for "Bring Your Own" (BYO) Azure AI Foundry Project resources, allowing deployments to reuse an existing Foundry project rather than provisioning a new one. The changes include new configuration parameters, environment variable handling, deployment logic, and updated documentation. Additionally, the documentation for reusing a Log Analytics Workspace has been refactored and moved into a dedicated guide for clarity.
Key changes include:
BYO Azure AI Foundry Project Support:
existingAiProjectResourceIdparameter toinfra/main.bicepandinfra/main.bicepparam, allowing users to specify an existing Foundry project resource ID. When set, the deployment skips creating new Foundry account/project resources and targets the existing project for downstream automation. [1] [2]infra/main.bicepto handle the BYO Foundry project, including parsing resource ID segments and exposing relevant outputs such asaiFoundryProjectName,aiFoundryAccountName,aiFoundryResourceGroup, andaiFoundrySubscriptionId.infra/main.bicepparamso thatdeployAiFoundryanddeployAfProjectare auto-disabled when BYO mode is active. [1] [2]scripts/preprovision-integrated.ps1to detect and parse the BYO Foundry project resource ID, ensuring downstream automation and environment variables are set correctly for cross-subscription scenarios. [1] [2] [3]Documentation Improvements:
docs/re-use-foundry-project.md, with step-by-step instructions (including Azure Portal screenshots) for configuring deployments to reuse an existing Azure AI Foundry Project.docs/deploymentguide.md) to reference new dedicated guides for reusing both Foundry projects and Log Analytics workspaces, improving clarity and discoverability. [1] [2]docs/re-use-log-analytics.md, with detailed steps and visuals for reusing an existing Log Analytics Workspace.docs/parameter_guide.mdin favor of the new dedicated guide.Parameter Table and Environment Variable Updates:
existingAiProjectResourceIdto the parameter table indocs/deploymentguide.md, clarifying its purpose and associated environment variable.These changes collectively make it much easier and safer to deploy into environments that already have existing Azure AI Foundry or Log Analytics resources, supporting cross-subscription scenarios and improving documentation for end users.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information