@@ -33,10 +33,6 @@ resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31'
3333 location : location
3434}
3535
36- resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' existing = {
37- name : containerRegistryName
38- }
39-
4036resource containerAppsEnvironment 'Microsoft.App/managedEnvironments@2023-05-01' existing = {
4137 name : containerAppsEnvironmentName
4238}
@@ -45,22 +41,10 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing
4541 name : applicationInsightsName
4642}
4743
48- resource acrPullRole 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
49- scope : containerRegistry
50- name : guid (subscription ().id , resourceGroup ().id , identity .id , 'acrPullRole' )
51- properties : {
52- principalId : identity .properties .principalId
53- roleDefinitionId : '7f951dda-4ed3-4680-a7ca-43fe172d538d'
54- principalType : 'ServicePrincipal'
55- }
56- }
57-
58-
5944// Roles
6045
6146// User roles
6247module openAiRoleUser '../shared/role.bicep' = if (empty (runningOnGh )) {
63- scope : resourceGroup ()
6448 name : guid (subscription ().id , resourceGroup ().id , identity .id , 'openaiUserRole' )
6549 params : {
6650 principalId : principalId
@@ -72,7 +56,6 @@ module openAiRoleUser '../shared/role.bicep' = if (empty(runningOnGh)) {
7256
7357// System roles
7458module openAiRoleBackend '../shared/role.bicep' = {
75- scope : resourceGroup ()
7659 name : guid (subscription ().id , resourceGroup ().id , identity .id , 'openaiServicePrincipalRole' )
7760 params : {
7861 principalId : app .identity .principalId
@@ -81,6 +64,14 @@ module openAiRoleBackend '../shared/role.bicep' = {
8164 principalType : 'ServicePrincipal'
8265 }
8366}
67+ module acrPullRole '../shared/role.bicep' = {
68+ name : guid (subscription ().id , resourceGroup ().id , identity .id , 'acrPullRole' )
69+ params : {
70+ principalId : identity .properties .principalId
71+ roleDefinitionId : '7f951dda-4ed3-4680-a7ca-43fe172d538d'
72+ principalType : 'ServicePrincipal'
73+ }
74+ }
8475
8576module fetchLatestImage '../modules/fetch-container-image.bicep' = {
8677 name : '${name }-fetch-image'
0 commit comments