Skip to content

Commit 052ac1b

Browse files
fix: Bug fix for Project endpoint
1 parent bc4f842 commit 052ac1b

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

infra/modules/account/main.bicep

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ resource cognitiveServiceExisting 'Microsoft.CognitiveServices/accounts@2025-04-
254254
scope: resourceGroup(existingCognitiveServiceDetails[2], existingCognitiveServiceDetails[4])
255255
}
256256

257-
module cognigive_service_dependencies 'modules/dependencies.bicep' = if(!useExistingService) {
257+
module cognitive_service_dependencies './modules/dependencies.bicep' = if(!useExistingService) {
258258
params: {
259259
projectName: projectName
260260
projectDescription: projectDescription
@@ -271,7 +271,7 @@ module cognigive_service_dependencies 'modules/dependencies.bicep' = if(!useExis
271271
}
272272
}
273273

274-
module existing_cognigive_service_dependencies 'modules/dependencies.bicep' = if(useExistingService) {
274+
module existing_cognitive_service_dependencies './modules/dependencies.bicep' = if(useExistingService) {
275275
params: {
276276
name: cognitiveServiceExisting.name
277277
projectName: projectName
@@ -311,20 +311,20 @@ output endpoint string = useExistingService ? cognitiveServiceExisting.propertie
311311
output endpoints endpointType = useExistingService ? cognitiveServiceExisting.properties.endpoints : cognitiveService.properties.endpoints
312312

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

316316
@description('The location the resource was deployed into.')
317-
output location string = '' //cognitiveService.location
317+
output location string = useExistingService ? cognitiveServiceExisting.location : cognitiveService.location
318318

319319
import { secretsOutputType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'
320320
@description('A hashtable of references to the secrets exported to the provided Key Vault. The key of each reference is each secret\'s name.')
321-
output exportedSecrets secretsOutputType = {}//cognigive_service_dependencies.outputs.exportedSecrets
321+
output exportedSecrets secretsOutputType = useExistingService ? existing_cognitive_service_dependencies.outputs.exportedSecrets : cognitive_service_dependencies.outputs.exportedSecrets
322322

323323
@description('The private endpoints of the congitive services account.')
324-
output privateEndpoints privateEndpointOutputType[] = [] //cognigive_service_dependencies.outputs.privateEndpoints
324+
output privateEndpoints privateEndpointOutputType[] = useExistingService ? existing_cognitive_service_dependencies.outputs.privateEndpoints : cognitive_service_dependencies.outputs.privateEndpoints
325325

326-
import { aiProjectOutputType } from './modules/project.bicep'
327-
output aiProjectInfo aiProjectOutputType = useExistingService ? existing_cognigive_service_dependencies.outputs.aiProjectInfo : cognigive_service_dependencies.outputs.aiProjectInfo
326+
import { aiProjectOutputType } from './project.bicep'
327+
output aiProjectInfo aiProjectOutputType = useExistingService ? existing_cognitive_service_dependencies.outputs.aiProjectInfo : cognitive_service_dependencies.outputs.aiProjectInfo
328328

329329
// ================ //
330330
// Definitions //

infra/modules/account/modules/project.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ param azureExistingAIProjectResourceId string = ''
1919
// // Extract components from existing AI Project Resource ID if provided
2020
var useExistingProject = !empty(azureExistingAIProjectResourceId)
2121
var existingProjName = useExistingProject ? last(split(azureExistingAIProjectResourceId, '/')) : ''
22-
var existingProjEndpoint = useExistingProject ? format('https://{0}.services.ai.azure.com/api/projects/{0}', existingProjName) : ''
22+
var existingProjEndpoint = useExistingProject ? format('https://{0}.services.ai.azure.com/api/projects/{1}', aiServicesName, existingProjName) : ''
2323

2424
// Reference to cognitive service in current resource group for new projects
2525
resource cogServiceReference 'Microsoft.CognitiveServices/accounts@2024-10-01' existing = {

0 commit comments

Comments
 (0)