@@ -6,7 +6,7 @@ param gptModelName string
66param gptModelVersion string
77param managedIdentityObjectId string
88param aiServicesEndpoint string
9- param aiServices object
9+ param aiServicesKey string
1010param aiServicesId string
1111
1212var storageName = '${solutionName }hubstorage'
@@ -133,11 +133,8 @@ resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview'
133133 properties : {
134134 category : 'AIServices'
135135 target : aiServicesEndpoint
136- authType : 'ApiKey '
136+ authType : 'AAD '
137137 isSharedToAll : true
138- credentials : {
139- key : aiServices .Key .key1
140- }
141138 metadata : {
142139 ApiType : 'Azure'
143140 ResourceId : aiServicesId
@@ -159,6 +156,19 @@ resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-p
159156 }
160157}
161158
159+ resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
160+ name : '64702f94-c441-49e6-a78b-ef80e0188fee'
161+ }
162+
163+ resource aiDevelopertoAIProject 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
164+ name : guid (aiHubProject .id , aiDeveloper .id )
165+ scope : resourceGroup ()
166+ properties : {
167+ roleDefinitionId : aiDeveloper .id
168+ principalId : aiHubProject .identity .principalId
169+ }
170+ }
171+
162172resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
163173 parent : keyVault
164174 name : 'TENANT-ID'
@@ -187,7 +197,7 @@ resource azureOpenAIApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-pr
187197 parent : keyVault
188198 name : 'AZURE-OPENAI-KEY'
189199 properties : {
190- value : aiServices . Key . key1 //aiServices_m.listKeys().key1
200+ value : aiServicesKey //aiServices_m.listKeys().key1
191201 }
192202}
193203
@@ -251,7 +261,7 @@ resource cogServiceKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-previe
251261 parent : keyVault
252262 name : 'COG-SERVICES-KEY'
253263 properties : {
254- value : aiServices . Key . key1
264+ value : aiServicesKey
255265 }
256266}
257267
0 commit comments