41 lines
1.2 KiB
Bicep
Raw Permalink Normal View History

2024-06-26 15:45:06 -04:00
@description('The name of the Container Registry resource. Will be automatically generated if not provided.')
param registryName string
2024-06-26 15:45:06 -04:00
@description('The location of the Container Registry resource.')
param location string = resourceGroup().location
@description('Array of objects with fields principalId, principalType, roleDefinitionId')
param roleAssignments array = []
2024-06-26 15:45:06 -04:00
resource registry 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = {
name: registryName
2024-06-26 15:45:06 -04:00
location: location
sku: {
name: 'Standard'
}
properties: {
adminUserEnabled: false
2024-06-26 15:45:06 -04:00
encryption: {
status: 'disabled'
}
dataEndpointEnabled: false
publicNetworkAccess: 'Enabled'
networkRuleBypassOptions: 'AzureServices'
zoneRedundancy: 'Disabled'
anonymousPullEnabled: false
metadataSearch: 'Disabled'
}
}
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for role in roleAssignments: {
name: guid('${role.principalId}-${role.principalType}-${role.roleDefinitionId}')
scope: registry
properties: role
}
]
2024-06-26 15:45:06 -04:00
output name string = registry.name
output id string = registry.id
2024-06-26 15:45:06 -04:00
output loginServer string = registry.properties.loginServer