Skip to content

Commit b1a1f37

Browse files
commit
1 parent 198bd50 commit b1a1f37

2 files changed

Lines changed: 1 addition & 99 deletions

File tree

infra/avm/modules/identity/role-assignments.bicep

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -171,61 +171,7 @@ module userAssignedManagedIdentityOpenAIContributorExisting './cross-scope-role-
171171
}
172172

173173
// ============================================================================
174-
// 2. SEARCH SERVICE ROLE ASSIGNMENTS
175-
// AI Project and Backend identities → AI Search
176-
// ============================================================================
177-
178-
// User-Assigned Managed Identity → Search Index Data Reader on AI Search
179-
resource userAssignedManagedIdentitySearchReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(aiSearchResourceId) && !empty(userAssignedManagedIdentityPrincipalId)) {
180-
name: guid(solutionName, aiSearchResourceId, userAssignedManagedIdentityPrincipalId, roleDefinitions.searchIndexDataReader)
181-
scope: aiSearchService
182-
properties: {
183-
principalId: userAssignedManagedIdentityPrincipalId
184-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.searchIndexDataReader)
185-
principalType: 'ServicePrincipal'
186-
}
187-
}
188-
189-
// ============================================================================
190-
// 3. STORAGE ROLE ASSIGNMENTS
191-
// AI Project, AI Search, and Existing Project identities → Storage
192-
// ============================================================================
193-
194-
// AI Project (New and Existing) → Storage Blob Data Contributor
195-
resource projectStorageContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(aiProjectPrincipalId)) {
196-
name: guid(solutionName, storageAccountResourceId, aiProjectPrincipalId, roleDefinitions.storageBlobDataContributor)
197-
scope: storageAccount
198-
properties: {
199-
principalId: aiProjectPrincipalId
200-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.storageBlobDataContributor)
201-
principalType: 'ServicePrincipal'
202-
}
203-
}
204-
205-
// AI Project (New and Existing) → Storage Blob Data Reader
206-
resource projectStorageReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(aiProjectPrincipalId)) {
207-
name: guid(solutionName, storageAccountResourceId, aiProjectPrincipalId, roleDefinitions.storageBlobDataReader)
208-
scope: storageAccount
209-
properties: {
210-
principalId: aiProjectPrincipalId
211-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.storageBlobDataReader)
212-
principalType: 'ServicePrincipal'
213-
}
214-
}
215-
216-
// AI Search → Storage Blob Data Reader
217-
resource searchStorageReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(aiSearchPrincipalId)) {
218-
name: guid(solutionName, storageAccountResourceId, aiSearchPrincipalId, roleDefinitions.storageBlobDataReader)
219-
scope: storageAccount
220-
properties: {
221-
principalId: aiSearchPrincipalId
222-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.storageBlobDataReader)
223-
principalType: 'ServicePrincipal'
224-
}
225-
}
226-
227-
// ============================================================================
228-
// 4. COSMOS DB ROLE ASSIGNMENTS
174+
// 2. COSMOS DB ROLE ASSIGNMENTS
229175
// User-Assigned Managed Identity → Cosmos DB (data-plane, uses sqlRoleAssignments)
230176
// ============================================================================
231177

infra/bicep/modules/identity/role-assignments.bicep

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,6 @@ resource projectSearchContributor 'Microsoft.Authorization/roleAssignments@2022-
209209
}
210210
}
211211

212-
// User-Assigned Managed Identity → Search Index Data Reader on AI Search
213-
resource userAssignedManagedIdentitySearchReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(aiSearchResourceId) && !empty(userAssignedManagedIdentityPrincipalId)) {
214-
name: guid(solutionName, aiSearchResourceId, userAssignedManagedIdentityPrincipalId, roleDefinitions.searchIndexDataReader)
215-
scope: aiSearchService
216-
properties: {
217-
principalId: userAssignedManagedIdentityPrincipalId
218-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.searchIndexDataReader)
219-
principalType: 'ServicePrincipal'
220-
}
221-
}
222-
223212
// User-Assigned Managed Identity → Search Index Data Contributor on AI Search
224213
// Extended as per accelerator need
225214
resource userAssignedManagedIdentitySearchIndexContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(aiSearchResourceId) && !empty(userAssignedManagedIdentityPrincipalId)) {
@@ -249,17 +238,6 @@ resource userAssignedManagedIdentitySearchServiceContributor 'Microsoft.Authoriz
249238
// AI Project, AI Search, and Existing Project identities → Storage
250239
// ============================================================================
251240

252-
// AI Project (New OR Existing) → Storage Blob Data Contributor
253-
resource projectStorageContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(aiProjectPrincipalId)) {
254-
name: guid(solutionName, storageAccountResourceId, aiProjectPrincipalId, roleDefinitions.storageBlobDataContributor)
255-
scope: storageAccount
256-
properties: {
257-
principalId: aiProjectPrincipalId
258-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.storageBlobDataContributor)
259-
principalType: 'ServicePrincipal'
260-
}
261-
}
262-
263241
// User-Assigned Managed Identity → Storage Blob Data Contributor on Storage Account
264242
// Extended as per accelerator need
265243
resource userAssignedManagedIdentityStorageContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(userAssignedManagedIdentityPrincipalId)) {
@@ -272,28 +250,6 @@ resource userAssignedManagedIdentityStorageContributor 'Microsoft.Authorization/
272250
}
273251
}
274252

275-
// AI Project (New OR Existing) → Storage Blob Data Reader
276-
resource projectStorageReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(aiProjectPrincipalId)) {
277-
name: guid(solutionName, storageAccountResourceId, aiProjectPrincipalId, roleDefinitions.storageBlobDataReader)
278-
scope: storageAccount
279-
properties: {
280-
principalId: aiProjectPrincipalId
281-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.storageBlobDataReader)
282-
principalType: 'ServicePrincipal'
283-
}
284-
}
285-
286-
// AI Search → Storage Blob Data Reader
287-
resource searchStorageReader 'Microsoft.Authorization/roleAssignments@2022-04-01' = if (!empty(storageAccountResourceId) && !empty(aiSearchPrincipalId)) {
288-
name: guid(solutionName, storageAccountResourceId, aiSearchPrincipalId, roleDefinitions.storageBlobDataReader)
289-
scope: storageAccount
290-
properties: {
291-
principalId: aiSearchPrincipalId
292-
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitions.storageBlobDataReader)
293-
principalType: 'ServicePrincipal'
294-
}
295-
}
296-
297253
// ============================================================================
298254
// 4. COSMOS DB ROLE ASSIGNMENTS
299255
// User-Assigned Managed Identity → Cosmos DB (data-plane, uses sqlRoleAssignments)

0 commit comments

Comments
 (0)