@@ -17,7 +17,7 @@ param tags object = {}
1717
1818@description ('SKU for the container registry.' )
1919@allowed (['Basic' , 'Standard' , 'Premium' ])
20- param sku string = 'Premium '
20+ param sku string = 'Standard '
2121
2222@description ('Enable admin user for the registry.' )
2323param adminUserEnabled bool = false
@@ -32,6 +32,14 @@ param exportPolicyStatus string = 'enabled'
3232@description ('Principal IDs to assign AcrPull role.' )
3333param acrPullPrincipalIds array = []
3434
35+ // Additive: AcrPush for deployer so post-deploy docker push works without manual RBAC.
36+ @description ('Principal IDs to assign AcrPush role (typically the deployer).' )
37+ param acrPushPrincipalIds array = []
38+
39+ @description ('Principal type for AcrPush assignments (User for azd user, ServicePrincipal for CI).' )
40+ @allowed (['User' , 'ServicePrincipal' , 'Group' ])
41+ param acrPushPrincipalType string = 'User'
42+
3543@description ('Enable private networking.' )
3644param enablePrivateNetworking bool = false
3745
@@ -52,13 +60,25 @@ param enableTelemetry bool = true
5260// Role Assignments
5361// ============================================================================
5462var acrPullRoleId = '7f951dda-4ed3-4680-a7ca-43fe172d538d'
63+ var acrPushRoleId = '8311e382-0749-4cb8-b61a-304f252e45ec'
5564
56- var roleAssignments = [for principalId in acrPullPrincipalIds : {
65+ var pullRoleAssignments = [for principalId in acrPullPrincipalIds : {
5766 principalId : principalId
5867 roleDefinitionIdOrName : acrPullRoleId
5968 principalType : 'ServicePrincipal'
6069}]
6170
71+ var pushRoleAssignments = [for principalId in acrPushPrincipalIds : {
72+ principalId : principalId
73+ roleDefinitionIdOrName : acrPushRoleId
74+ principalType : acrPushPrincipalType
75+ }]
76+
77+ var roleAssignments = concat (
78+ !empty (acrPullPrincipalIds ) ? pullRoleAssignments : [],
79+ !empty (acrPushPrincipalIds ) ? pushRoleAssignments : []
80+ )
81+
6282// ============================================================================
6383// Private Endpoint Config
6484// ============================================================================
@@ -90,7 +110,7 @@ module containerRegistry 'br/public:avm/res/container-registry/registry:0.12.1'
90110 acrAdminUserEnabled : adminUserEnabled
91111 publicNetworkAccess : publicNetworkAccess
92112 exportPolicyStatus : exportPolicyStatus
93- roleAssignments : !empty (acrPullPrincipalIds ) ? roleAssignments : []
113+ roleAssignments : !empty (roleAssignments ) ? roleAssignments : []
94114 privateEndpoints : privateEndpointConfig
95115 networkRuleSetDefaultAction : networkRuleSetDefaultAction
96116 }
0 commit comments