Skip to content

Commit 87f1bf9

Browse files
Sync toolkit modules and align DEPLOYMENT_FLAVOR env var with agentic PR
- Sync container-registry.bicep (avm + bicep): SKU default Standard, retention policy - Sync cosmos-db-mongo.bicep (avm): networkAclBypass AzureServices - Rename AZURE_ENV_DEPLOYMENT_FLAVOR to DEPLOYMENT_FLAVOR in main.parameters.json Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 18e7ef7 commit 87f1bf9

4 files changed

Lines changed: 31 additions & 8 deletions

File tree

infra/avm/modules/compute/container-registry.bicep

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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.')
2323
param adminUserEnabled bool = false
@@ -32,6 +32,14 @@ param exportPolicyStatus string = 'enabled'
3232
@description('Principal IDs to assign AcrPull role.')
3333
param 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.')
3644
param enablePrivateNetworking bool = false
3745

@@ -52,13 +60,25 @@ param enableTelemetry bool = true
5260
// Role Assignments
5361
// ============================================================================
5462
var 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
}

infra/avm/modules/data/cosmos-db-mongo.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module cosmosAccount 'br/public:avm/res/document-db/database-account:0.19.0' = {
9191
]
9292
diagnosticSettings: !empty(diagnosticSettings) ? diagnosticSettings : []
9393
networkRestrictions: {
94-
networkAclBypass: 'None'
94+
networkAclBypass: 'AzureServices'
9595
publicNetworkAccess: publicNetworkAccess
9696
}
9797
privateEndpoints: enablePrivateNetworking ? [

infra/bicep/modules/compute/container-registry.bicep

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ param tags object = {}
1818

1919
@description('SKU for the container registry.')
2020
@allowed(['Basic', 'Standard', 'Premium'])
21-
param sku string = 'Premium'
21+
param sku string = 'Standard'
2222

2323
@description('Enable admin user.')
2424
param adminUserEnabled bool = false
@@ -30,6 +30,9 @@ param publicNetworkAccess string = 'Enabled'
3030
@description('Export policy status.')
3131
param exportPolicyStatus string = 'enabled'
3232

33+
@description('Retention policy status.')
34+
param retentionPolicyStatus string = 'disabled'
35+
3336
// ============================================================================
3437
// Resource Deployment
3538
// ============================================================================
@@ -50,7 +53,7 @@ resource containerRegistry 'Microsoft.ContainerRegistry/registries@2025-04-01' =
5053
status: exportPolicyStatus
5154
}
5255
retentionPolicy: {
53-
status: 'enabled'
56+
status: retentionPolicyStatus
5457
days: 7
5558
}
5659
trustPolicy: {
@@ -72,4 +75,4 @@ output name string = containerRegistry.name
7275
output loginServer string = containerRegistry.properties.loginServer
7376

7477
@description('The resource ID of the container registry.')
75-
output resourceId string = containerRegistry.id
78+
output resourceId string = containerRegistry.id

infra/main.parameters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"deploymentFlavor": {
6-
"value": "${AZURE_ENV_DEPLOYMENT_FLAVOR}"
6+
"value": "${DEPLOYMENT_FLAVOR=bicep}"
77
},
88
"solutionName": {
99
"value": "${AZURE_ENV_NAME}"

0 commit comments

Comments
 (0)