@@ -22,21 +22,12 @@ param cognitiveServicesAccountName string = foundryHubName
22
22
@description ('Name of the GPT-4o model deployment' )
23
23
param gpt4oDeploymentName string = 'gpt-4o'
24
24
25
- @description ('GPT-4o model name' )
26
- param gpt4oModelName string = 'gpt-4o'
27
-
28
- @description ('GPT-4o model version' )
29
- param gpt4oModelVersion string = '2024-05-13'
30
-
31
25
@description ('Capacity for the GPT-4o model deployment' )
32
26
param gpt4oCapacity int = 1
33
27
34
28
@description ('Name of the embedding model deployment' )
35
29
param embeddingModelDeploymentName string = 'text-embedding-ada-002'
36
30
37
- @description ('Embedding model version' )
38
- param embeddingModelVersion string = '2'
39
-
40
31
@description ('Name of the GPT-4o mini deployment' )
41
32
param gpt4oMiniModelDeploymentName string = 'gpt-4o-mini'
42
33
@@ -64,9 +55,6 @@ param aiFoundryProjectName string = '${foundryHubName}-project'
64
55
@description ('Display name for the AI Foundry Project' )
65
56
param aiFoundryProjectDisplayName string = 'Voice Agent Multi Modal Workshop'
66
57
67
- @description ('API version for Azure OpenAI API' )
68
- param apiVersion string = '2023-05-15'
69
-
70
58
@description ('Abbreviations to use for resource naming' )
71
59
param abbrs object
72
60
@@ -108,139 +96,43 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2019-04-01' = {
108
96
tags : tags
109
97
}
110
98
111
- resource aiHub 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' = {
112
- name : foundryHubName
99
+ // Add Cognitive Services account of kind AIServices
100
+ resource cognitiveServicesAccount 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
101
+ name : cognitiveServicesAccountName
113
102
location : location
114
- kind : 'hub'
103
+ tags : tags
104
+ kind : 'AIServices'
105
+ sku : {
106
+ name : accountSku
107
+ }
115
108
identity : {
116
109
type : 'SystemAssigned'
117
110
}
118
111
properties : {
119
- description : 'Azure AI Foundry Hub'
120
- friendlyName : 'AI Foundry Hub'
112
+ allowProjectManagement : true
121
113
publicNetworkAccess : 'Enabled'
122
- storageAccount : storageAccount .id
123
- containerRegistry : containerRegistry .outputs .resourceId
124
- applicationInsights : applicationInsightsResourceId
125
- keyVault : keyVault .outputs .resourceId
126
114
}
127
- tags : tags
128
115
}
129
116
130
117
// Create the AI Foundry Project
131
- resource aiProject 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' = {
118
+ resource aiProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
119
+ parent : cognitiveServicesAccount
132
120
name : aiFoundryProjectName
133
121
location : location
134
- kind : 'project'
135
122
identity : {
136
123
type : 'SystemAssigned'
137
124
}
138
125
properties : {
139
- description : 'AI Foundry Project for Video RAG'
140
- friendlyName : aiFoundryProjectDisplayName
141
- hubResourceId : aiHub .id
142
- publicNetworkAccess : 'Enabled'
126
+ description : aiFoundryProjectDisplayName
143
127
}
144
128
tags : tags
145
129
}
146
130
147
- // Connect the Azure OpenAI endpoint to the AI Foundry Project
148
- resource aiServiceConnection 'Microsoft.MachineLearningServices/workspaces/connections@2023-08-01-preview' = {
149
- parent : aiProject
150
- name : '${foundryHubName }-ai-connection'
151
- properties : {
152
- category : 'AzureOpenAI'
153
- target : cognitiveServicesAccount .properties .endpoint
154
- authType : 'ApiKey'
155
- isSharedToAll : true
156
- credentials : {
157
- key : cognitiveServicesAccount .listKeys ().key1
158
- }
159
- metadata : {
160
- resourceName : cognitiveServicesAccount .name
161
- ApiType : 'Azure'
162
- ApiVersion : apiVersion
163
- }
164
- }
165
- }
166
-
167
- // Add Cognitive Services account of kind AIServices
168
- resource cognitiveServicesAccount 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
169
- name : cognitiveServicesAccountName
170
- location : location
171
- tags : tags
172
- kind : 'AIServices'
173
- sku : {
174
- name : accountSku
175
- }
176
- properties : {
177
- customSubDomainName : cognitiveServicesAccountName
178
- networkAcls : {
179
- defaultAction : 'Allow'
180
- }
181
- publicNetworkAccess : 'Enabled'
182
- }
183
- }
184
-
185
131
var contentUnderstandingEndpoint = 'https://${cognitiveServicesAccountName }.services.ai.azure.com/'
186
132
187
- // User-assigned managed identity for the deployment script
188
- resource deploymentScriptIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
189
- name : 'id-deploymentscript-${resourceToken }'
190
- location : location
191
- tags : tags
192
- }
193
-
194
- // Create role assignment for the deployment script identity to manage Cognitive Services
195
- resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
196
- name : guid (resourceGroup ().id , deploymentScriptIdentity .id , 'Contributor' )
197
- scope : cognitiveServicesAccount
198
- properties : {
199
- principalId : deploymentScriptIdentity .properties .principalId
200
- roleDefinitionId : subscriptionResourceId ('Microsoft.Authorization/roleDefinitions' , 'b24988ac-6180-42a0-ab88-20f7382dd24c' ) // Contributor role
201
- principalType : 'ServicePrincipal'
202
- }
203
- }
204
-
205
133
// Generate a unique token for resource naming
206
134
var resourceToken = uniqueString (subscription ().id , resourceGroup ().id , cognitiveServicesAccountName )
207
135
208
-
209
- // resource chatModelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2025-04-01-preview' = {
210
- // parent: cognitiveServicesAccount
211
- // name: gpt4oDeploymentName
212
- // sku: {
213
- // capacity: gpt4oCapacity
214
- // name: openAiSkuName
215
- // }
216
- // properties: {
217
- // model: {
218
- // format: openAiModelFormat
219
- // name: gpt4oModelName
220
- // version: gpt4oModelVersion
221
- // }
222
- // }
223
- // }
224
-
225
- // resource embeddingModelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2025-04-01-preview' = {
226
- // parent: cognitiveServicesAccount
227
- // name: embeddingModelDeploymentName
228
- // sku: {
229
- // capacity: gpt4oCapacity
230
- // name: openAiSkuName
231
- // }
232
- // properties: {
233
- // model: {
234
- // format: openAiModelFormat
235
- // name: embeddingModelDeploymentName
236
- // version: embeddingModelVersion
237
- // }
238
- // }
239
- // dependsOn: [
240
- // chatModelDeployment
241
- // ]
242
- // }
243
-
244
136
resource gpt4oMiniModelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2025-04-01-preview' = {
245
137
parent : cognitiveServicesAccount
246
138
name : gpt4oMiniModelDeploymentName
@@ -295,12 +187,4 @@ output embeddingModelDeploymentName string = embeddingModelDeploymentName
295
187
output gpt4oMiniModelDeploymentName string = gpt4oMiniModelDeploymentName
296
188
output gpt4oMiniModelVersion string = gpt4oMiniModelVersion
297
189
output realtimeModelDeploymentName string = realtimeModelDeploymentName
298
- output aiProjectName string = aiProject .name
299
- output aiProjectId string = aiProject .id
300
- output aiProjectPrincipalId string = aiProject .identity .principalId
301
- output aiServiceConnectionName string = aiServiceConnection .name
302
- output aiServiceConnectionId string = aiServiceConnection .id
303
- output resourceId string = aiHub .id
304
- output name string = aiHub .name
305
- output principalId string = aiHub .identity .principalId
306
190
output containerRegistryName string = containerRegistry .outputs .name
0 commit comments