Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/DeploymentGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ When you start the deployment, most parameters will have **default values**, but
| **GPT Model Capacity** | Sets the GPT model capacity. | 150 |
| **Image Tag** | Docker image tag used for container deployments. | latest |
| **Enable Telemetry** | Enables telemetry for monitoring and diagnostics. | true |

| **Existing Log Analytics Workspace** | To reuse an existing Log Analytics Workspace ID instead of creating a new one. | *(none)* |
| **Existing Azure AI Foundry Project** | To reuse an existing Azure AI Foundry Project ID instead of creating a new one. | *(none)* |

</details>

Expand All @@ -176,6 +177,14 @@ To adjust quota settings, follow these [steps](./AzureGPTQuotaSettings.md).

</details>

<details>

<summary><b>Reusing an Existing Azure AI Foundry Project</b></summary>

Guide to get your [Existing Project ID](/docs/re-use-foundry-project.md)

</details>

### Deploying with AZD

Once you've opened the project in [Codespaces](#github-codespaces), [Dev Containers](#vs-code-dev-containers), or [locally](#local-environment), you can deploy it to Azure by following these steps:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions docs/re-use-foundry-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[← Back to *DEPLOYMENT* guide](/docs/DeploymentGuide.md#deployment-options--steps)

# Reusing an Existing Azure AI Foundry Project
To configure your environment to use an existing Azure AI Foundry Project, follow these steps:
---
### 1. Go to Azure Portal
Go to https://portal.azure.com

### 2. Search for Azure AI Foundry
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.

![alt text](../docs/images/re_use_foundry_project/azure_ai_foundry_list.png)

### 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

![alt text](../docs/images/re_use_foundry_project/navigate_to_projects.png)

### 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

![alt text](../docs/images/re_use_foundry_project/project_resource_id.png)

### 6. Set the Foundry Project Resource ID in Your Environment
Run the following command in your terminal
```bash
azd env set AZURE_ENV_FOUNDRY_PROJECT_ID '<Existing Foundry Project Resource ID>'
```
Replace `<Existing Foundry Project Resource ID>` with the value obtained from Step 5.

### 7. Continue Deployment
Proceed with the next steps in the [deployment guide](/docs/DeploymentGuide.md#deployment-options--steps).
6 changes: 3 additions & 3 deletions infra/modules/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ module existing_cognigive_service_dependencies 'modules/dependencies.bicep' = if
projectName: projectName
projectDescription: projectDescription
azureExistingAIProjectResourceId: existingFoundryProjectResourceId
location: location
location: cognitiveServiceExisting.?location!
deployments: deployments
diagnosticSettings: diagnosticSettings
lock: lock
Expand Down Expand Up @@ -311,8 +311,8 @@ output endpoint string = useExistingService ? cognitiveServiceExisting.propertie
output endpoints endpointType = useExistingService ? cognitiveServiceExisting.properties.endpoints : cognitiveService.properties.endpoints

@description('The principal ID of the system assigned identity.')
output systemAssignedMIPrincipalId string? = useExistingService ? cognitiveServiceExisting.identity.principalId : cognitiveService.?identity.?principalId
output systemAssignedMIPrincipalId string? = useExistingService ? cognitiveServiceExisting.?identity.?principalId : cognitiveService.?identity.?principalId

@description('The location the resource was deployed into.')
output location string = useExistingService ? cognitiveServiceExisting.location : cognitiveService.location

Expand Down
4 changes: 2 additions & 2 deletions infra/modules/account/modules/dependencies.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ param name string
])
param sku string = 'S0'

@description('Optional. Location for all Resources.')
param location string = resourceGroup().location
@description('Optional. Location for Cognitive Services.')
param location string

@description('Optional. Tags of the resource.')
param tags object?
Expand Down
16 changes: 12 additions & 4 deletions infra/modules/account/modules/project.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
param name string

@description('Required. The location of the Project resource.')
param location string = resourceGroup().location
param location string

@description('Optional. The description of the AI Foundry project to create. Defaults to the project name.')
param desc string = name
Expand Down Expand Up @@ -40,11 +40,19 @@ resource aiProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-pre
}
}

// Assign identity to existing project
resource existingProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = if (useExistingProject && !empty(existingProjName)) {
name: existingProjName
parent: cogServiceReference
location: location
identity: { type: 'SystemAssigned' }
}

@description('AI Project metadata including name, resource ID, and API endpoint.')
output aiProjectInfo aiProjectOutputType = {
name: useExistingProject ? existingProjName : aiProject.name
resourceId: useExistingProject ? azureExistingAIProjectResourceId : aiProject.id
apiEndpoint: useExistingProject ? existingProjEndpoint : aiProject.properties.endpoints['AI Foundry API']
name: useExistingProject ? existingProject.name : aiProject.name
resourceId: useExistingProject ? existingProject.id : aiProject.id
apiEndpoint: useExistingProject ? existingProject.properties.endpoints['AI Foundry API'] : aiProject.properties.endpoints['AI Foundry API']
}

@export()
Expand Down
Loading