Skip to content

Commit 22b01a3

Browse files
Merge pull request #338 from microsoft/psl-fixPrincipalTypeIssue
fix: add principalType as 'ServicePrincipal' for role assignments
2 parents 601907b + 00268ba commit 22b01a3

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

infra/modules/role.bicep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ resource aiUserAccessFoundry 'Microsoft.Authorization/roleAssignments@2022-04-01
2929
properties: {
3030
roleDefinitionId: aiUser.id
3131
principalId: principalId
32+
principalType: 'ServicePrincipal'
3233
}
3334
}
3435

@@ -38,6 +39,7 @@ resource aiDeveloperAccessFoundry 'Microsoft.Authorization/roleAssignments@2022-
3839
properties: {
3940
roleDefinitionId: aiDeveloper.id
4041
principalId: principalId
42+
principalType: 'ServicePrincipal'
4143
}
4244
}
4345

@@ -47,5 +49,6 @@ resource cognitiveServiceOpenAIUserAccessFoundry 'Microsoft.Authorization/roleAs
4749
properties: {
4850
roleDefinitionId: cognitiveServiceOpenAIUser.id
4951
principalId: principalId
52+
principalType: 'ServicePrincipal'
5053
}
5154
}

infra/old/deploy_ai_foundry.bicep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ resource aiDevelopertoAIProject 'Microsoft.Authorization/roleAssignments@2022-04
169169
properties: {
170170
roleDefinitionId: aiDeveloper.id
171171
principalId: aiHubProject.identity.principalId
172+
principalType: 'ServicePrincipal'
172173
}
173174
}
174175

infra/old/main.bicep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ module aiFoundryStorageAccount 'br/public:avm/res/storage/storage-account:0.18.2
680680
{
681681
principalId: userAssignedIdentity.outputs.principalId
682682
roleDefinitionIdOrName: 'Storage Blob Data Contributor'
683+
principalType: 'ServicePrincipal'
683684
}
684685
]
685686
}
@@ -760,6 +761,7 @@ module aiFoundryAiProject 'br/public:avm/res/machine-learning-services/workspace
760761
principalId: containerApp.outputs.?systemAssignedMIPrincipalId!
761762
// Assigning the role with the role name instead of the role ID freezes the deployment at this point
762763
roleDefinitionIdOrName: '64702f94-c441-49e6-a78b-ef80e0188fee' //'Azure AI Developer'
764+
principalType: 'ServicePrincipal'
763765
}
764766
]
765767
}

0 commit comments

Comments
 (0)