Skip to content

Commit 1eed442

Browse files
refactor: remove API key parameter and switch to AAD authentication for AI Foundry connection
1 parent 9aa0490 commit 1eed442

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

infra/main.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,6 @@ module aiSearchFoundryConnection 'modules/aifp-connections.bicep' = {
17591759
searchServiceResourceId: searchService.id
17601760
searchServiceLocation: searchService.location
17611761
searchServiceName: searchService.name
1762-
searchApiKey: searchService.listAdminKeys().primaryKey
17631762
}
17641763
dependsOn: [
17651764
aiFoundryAiServices

infra/modules/aifp-connections.bicep

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1+
@description('Name of the AI Foundry search connection')
12
param aifSearchConnectionName string
3+
4+
@description('Name of the Azure AI Search service')
25
param searchServiceName string
6+
7+
@description('Resource ID of the Azure AI Search service')
38
param searchServiceResourceId string
9+
10+
@description('Location/region of the Azure AI Search service')
411
param searchServiceLocation string
12+
13+
@description('Name of the AI Foundry account')
514
param aiFoundryName string
15+
16+
@description('Name of the AI Foundry project')
617
param aiFoundryProjectName string
7-
@secure()
8-
param searchApiKey string
918

1019
resource aiSearchFoundryConnection 'Microsoft.CognitiveServices/accounts/projects/connections@2025-04-01-preview' = {
1120
name: '${aiFoundryName}/${aiFoundryProjectName}/${aifSearchConnectionName}'
1221
properties: {
1322
category: 'CognitiveSearch'
1423
target: 'https://${searchServiceName}.search.windows.net'
15-
authType: 'ApiKey'
16-
credentials: {
17-
key: searchApiKey
18-
}
24+
authType: 'AAD'
1925
isSharedToAll: true
2026
metadata: {
2127
ApiType: 'Azure'

0 commit comments

Comments
 (0)